Dobrý den,
chci aktivovat měření konverzí pro můj e-shop
http://www.sgsport.cz/obchod.
Vložil jsem následující kód:
Kód:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'GOOGLE_ID']);
_gaq.push(['_trackPageview']);
{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>
Ale mám dojem, že je funkční pouze pro prestashop 1.4 a nižší. Nevíte někdo jak se změnily proměnné u 1.5? Případně de dělám chybu, že se konverze neměří?
Mockrát děkuji za každou radu.
S pozdravem Martin Opatrný