Created
January 27, 2014 06:08
-
-
Save anova/8643894 to your computer and use it in GitHub Desktop.
This file contains 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
<!-- | |
Çok önemli 1. adım: Analytics üzerinden site mutlaka e-ticaret sitesi olarak ayarlanmalıdır. | |
--> | |
<script type="text/javascript"> | |
var _gaq = _gaq || []; | |
//********************************************************************************* | |
//********************************************************************************* | |
//*************** DEĞİŞTİRİLMESİ GEREKEN ALAN 1 : UA-TRACK-ID ******************* | |
//********************************************************************************* | |
//********************************************************************************* | |
_gaq.push(['_setAccount', 'UA-TRACK-ID']); | |
_gaq.push(['_trackPageview']); | |
_gaq.push(['_addTrans', | |
'{{ siparis.id }}', // order ID - required | |
//********************************************************************************* | |
//********************************************************************************* | |
//*************** DEĞİŞTİRİLMESİ GEREKEN ALAN 2 : Store Name ******************* | |
//********************************************************************************* | |
//********************************************************************************* | |
'Store Name', // affiliation or store name | |
'{{ siparis.son_tutar|noktali_fiyat }}', // total - required | |
'{{ siparis.kdv_toplam|noktali_fiyat }}', // tax | |
'{{ siparis.kargo_tutar|noktali_fiyat }}', // shipping | |
'{{ siparis.teslimat_ilce.isim }}', // city | |
'{{ siparis.teslimat_sehir.isim }}', // state or province | |
'Turkey' | |
]); | |
{% for si in siparis.siparisitem_set.all %} | |
_gaq.push(['_addItem', | |
'{{ si.siparis.id }}', // order ID - required | |
'{{ si.urun.stok_kodu }}', // SKU/code - required | |
'{{ si.urun.name }}', // product name | |
'{{ si.urun.main_category.name }}', // category or variation | |
'{{ si.birim_fiyat|noktali_fiyat }}', // unit price - required | |
'{{ si.adet }}' // quantity - required | |
]); | |
{% endfor %} | |
_gaq.push(['_trackTrans']); //submits transaction to the Analytics servers | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment