add category tracking for ecommerce items

This commit is contained in:
2014-07-15 15:40:34 +00:00
parent 006410b925
commit ab9eaf64d6
10 changed files with 213 additions and 16 deletions

@ -11,7 +11,7 @@
[{strip}]
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '[{ $oD3GASettings->getValue('sD3GAId') }]']);
_gaq.push(['_setAccount', '[{$oD3GASettings->getValue('sD3GAId')}]']);
[{if $oD3GASettings->getValue('blD3GAAnonymizeIP')}]
_gaq.push(['_gat._anonymizeIp']);
@ -137,33 +137,34 @@
[{assign var="currate" value=$order->oxorder__oxcurrate->value}]
_gaq.push(['_addTrans',
'[{ $order->oxorder__oxordernr->value }]', [{* // order ID - required *}]
'[{ $oxcmp_shop->oxshops__oxname->value}]', [{* // affiliation or store name *}]
[{if $oD3GASettings->getValue('blD3GAUseNetto') }]
'[{$order->oxorder__oxordernr->value}]', [{* // order ID - required *}]
'[{$oxcmp_shop->oxshops__oxname->value}]', [{* // affiliation or store name *}]
[{if $oD3GASettings->getValue('blD3GAUseNetto')}]
'[{math equation="s / r" s=$order->getOrderNetSum() r=$currate format="%.2f"}]', [{* // total - required - has to be gross sum *}]
[{else}]
'[{math equation="s / r" s=$order->getTotalOrderSum() r=$currate format="%.2f"}]', [{* // total - required *}]
[{/if}]
'[{math equation="s - r" s=$order->getTotalOrderSum() r=$order->getOrderNetSum() format="%.2f"}]', [{* // tax *}]
'[{math equation="s / r" s=$order->oxorder__oxdelcost->value r=$currate format="%.2f"}]', [{* // shipping *}]
'[{ $order->oxorder__oxbillcity->value }]', [{* // city *}]
'[{ $order->oxorder__oxbillstate->value }]', [{* // state or province *}]
'[{ $order->oxorder__oxbillcountry->value }]' [{* // country *}]
'[{$order->oxorder__oxbillcity->value}]', [{* // city *}]
'[{$order->oxorder__oxbillstate->value}]', [{* // state or province *}]
'[{$order->oxorder__oxbillcountry->value}]' [{* // country *}]
]);
[{foreach from=$order->getOrderArticles() item=oOrderArticle}]
_gaq.push(['_addItem',
'[{ $order->oxorder__oxordernr->value }]', [{* // order ID - required *}]
'[{ $oOrderArticle->oxorderarticles__oxartnum->value }]', [{* // SKU/code *}]
'[{ $oOrderArticle->oxorderarticles__oxtitle->value }]', [{* // product name *}]
'[{ $oOrderArticle->oxorderarticles__oxselvariant->value }]', [{* // category or variation *}]
[{if $oD3GASettings->getValue('blD3GAUseNetto') }]
'[{$order->oxorder__oxordernr->value}]', [{* // order ID - required *}]
'[{$oOrderArticle->oxorderarticles__oxartnum->value}]', [{* // SKU/code *}]
'[{$oOrderArticle->oxorderarticles__oxtitle->value}]', [{* // product name *}]
'[{$oOrderArticle->oxorderarticles__d3_galocator->value}]', [{* // category or variation *}]
[{*'[{$oOrderArticle->oxorderarticles__oxselvariant->value}]', [{* // category or variation *}]
[{if $oD3GASettings->getValue('blD3GAUseNetto')}]
[{assign var="oPrice" value=$oOrderArticle->getPrice()}]
'[{math equation="s / r" s=$oPrice->getNettoPrice() r=$currate format="%.2f"}]', [{* // unit price - required *}]
[{else}]
'[{ $oOrderArticle->oxorderarticles__oxprice->value }]', [{* // unit price - required - is not currency depended *}]
'[{$oOrderArticle->oxorderarticles__oxprice->value}]', [{* // unit price - required - is not currency depended *}]
[{/if}]
'[{ $oOrderArticle->oxorderarticles__oxamount->value }]' [{* // quantity - required *}]
'[{$oOrderArticle->oxorderarticles__oxamount->value}]' [{* // quantity - required *}]
]);
[{/foreach}]

@ -33,7 +33,8 @@
'id': '[{$order->oxorder__oxordernr->value}]', [{* Transaktions-ID *}]
'name': '[{$oOrderArticle->oxorderarticles__oxtitle->value}]', [{* Produktname *}]
'sku': '[{$oOrderArticle->oxorderarticles__oxartnum->value}]', [{* SKU/Code *}]
'category': '[{$oOrderArticle->oxorderarticles__oxselvariant->value}]', [{* Kategorie oder Ausf<EFBFBD>hrung *}]
'category': '[{$oOrderArticle->oxorderarticles__d3_galocator->value}]', [{* Kategorie oder Ausf<EFBFBD>hrung *}]
[{*'category': '[{$oOrderArticle->oxorderarticles__oxselvariant->value}]', [{* Kategorie oder Ausf<EFBFBD>hrung *}]
'price': '[{$sPrice}]', [{* Preis pro Einheit *}]
'quantity': '[{$oOrderArticle->oxorderarticles__oxamount->value}]' [{* Menge *}]
});