Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', '{$ganalytics_id}']);
- // Recommanded value by Google doc and has to before the trackPageView
- _gaq.push(['_setSiteSpeedSampleRate', 5]);
- {if isset($pageTrack)}_gaq.push(['_trackPageview', '{$pageTrack}']);{/if}
- {if $isOrder eq true} {* If it's an order we need more data for stats *}
- _gaq.push(['_addTrans',
- '{$trans.id}', {* order ID - required *}
- '{$trans.store}', {* affiliation or store name *}
- '{$trans.total}', {* total - required *}
- '{$trans.tax}', {* tax *}
- '{$trans.shipping}', {* shipping *}
- '{$trans.city}', {* city *}
- '{$trans.state}', {* state or province *}
- '{$trans.country}' {* country *}
- ]);
- {foreach from=$items item=item}
- _gaq.push(['_addItem',
- '{$item.OrderId}', {* order ID - required *}
- '{$item.SKU}', {* SKU/code - required *}
- '{$item.Product}', {* product name *}
- '{$item.Category}', {* category or variation *}
- '{$item.Price}', {* unit price - required *}
- '{$item.Quantity}' {* quantity - required *}
- ]);
- {/foreach}
- {* submits transaction to the Analytics servers *}
- {literal}
- _gaq.push(['_trackTrans']);
- {/literal}
- {/if}
- {literal}
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })(); {/literal}
- </script>
- {if $isOrder eq true and $doWebGain eq true} {* WEBGAINS *}
- <script language="javascript" type="text/javascript">
- if(location.protocol.toLowerCase() == "https:") wgProtocol="https";
- else wgProtocol="http";
- wgUri = wgProtocol + "{$wgUri}" + "&wgprotocol=" + wgProtocol + "&wglocation=" + location.href;
- document.write('<sc'+'ript language="JavaScript" type="text/javascript" src="'+wgUri+'"></sc'+'ript>');
- </script>
- <noscript>
- <img src="https://{$wgSubDomain}.webgains.com/transaction.html?wgrs=1&{$wgQueryString}&wgprotocol=https" alt="" width="1" height="1"/>
- </noscript>
- {/if}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement