Created
August 14, 2012 19:19
-
-
Save danilowm/3351938 to your computer and use it in GitHub Desktop.
Tracker Google Analytics Carrinho de Compras
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
var gaJsHost = (("https:" == document.location.protocol ) ? "https://ssl." : "http://www."); | |
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); | |
</script> | |
<script type="text/javascript"> | |
try { | |
var pageTracker = _gat._getTracker("UA-xxxxx-x"); | |
pageTracker._trackPageview(); | |
pageTracker._addTrans( | |
'99999', // Código do Pedido | |
'danilowm', // Nome da Loja | |
'1.99', // Preço Total do Pedido | |
'', // Taxa | |
'0.00', // Valor do Frete | |
'Sao Paulo', // Cidade | |
'SP', // Estado | |
'BRA' // País | |
); | |
// Loop de Produtos na Cesta - para cada produto | |
pageTracker._addItem( | |
'99999', // Código do Pedido | |
'1231321', // SKU | |
'Nome do Produto', // Nome do Produto | |
'Categoria', // Categoria | |
'1.99', // Preço | |
'10' // Quantidade | |
); | |
pageTracker._trackTrans(); | |
} catch(err) {} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment