GTM ProductLevelTracking PT

From Wiki

Jump to: navigation, search

Product Level Tracking

Product Level Tracking permite que o anunciante gere relatórios muito mais detalhados, onde o desempenho de produtos individuais pode ser facilmente mensurado.

1) Crie uma nova tag, do tipo "HTML Customizado" e cole o seguinte código:

<script type="text/javascript">
var transactionProducts = {{transactionProducts}};
AWIN.Tracking.Sale.plt = '';
for (i = 0; i < transactionProducts.length; i++) {
AWIN.Tracking.Sale.plt += "AW:P|XXXXX|{{Awin - Transaction ID}}|" +
transactionProducts[i]['id'] + "|" +
transactionProducts[i]['name'] + "|" +
transactionProducts[i]['price'] + "|" +
transactionProducts[i]['quantity'] + "|" +
transactionProducts[i]['sku'] + "|" +
"DEFAULT" + "|" +
transactionProducts[i]['category'] + "\n";
}
var basketForm = document.createElement('form');
basketForm.setAttribute('style', 'display:none;');
basketForm.setAttribute('name', 'basket_form');
var basketTextArea = document.createElement('textarea');
basketTextArea.setAttribute('wrap', 'physical');
basketTextArea.setAttribute('id', 'aw_basket');
basketTextArea.value = AWIN.Tracking.Sale.plt;
basketForm.appendChild(basketTextArea);
document.getElementsByTagName('body')[0].appendChild(basketForm);
<!----End Product Level Tracking--->
</script> 
<script defer="defer" src="https://www.dwin1.com/XXXXX.js" type="text/javascript"></script>

2) Ajuste as variáveis para que reflitam o seu container. Descrição das variáveis necessárias:

* {{transactionProducts}} - Precisa refletir o array de produtos dentro do carrinho.
* {{Awin - Transaction ID}} - Precisa refletir o ID do pedido.
* XXXXX - Deve ser substituído pelo MID (Merchant ID) do anunciante, existem duas instâncias deste valor no códio anteriormente apresentado, altere ambas!

3) Adicione o mesmo "trigger" da tag de conversão, o da página de sucesso!

Privacy

Due to new European legislation regarding how websites store information about you, AWIN is updating its privacy policy. You can see the new version of our policy here. If you would like to see the information we capture on this website, please click here for further details. In order to accept cookies on this site please click the 'I ACCEPT' button