<!-- Piwik -->
{*Piwik PageID*}
{assign var="piwikID" value="1"}
{*Piwik Domain*}
{if $smarty.server.HTTPS eq "on"}
{assign var="piwikDomain" value="https://www.euredomain.de/piwik/"}
{else}
{assign var="piwikDomain" value="http://www.euredomain.de/piwik/"}
{/if}
{*
Piwik Goals
- empty if not used
- add Goals in Piwik => insert ID here
*}
{assign var="piwikGoal_register" value="4"}
{assign var="piwikGoal_cart" value="5"}
{assign var="piwikGoal_selectaccount" value="6"}
{assign var="piwikGoal_orderunregistered" value="7"}
{assign var="piwikGoal_shippingaddress" value="8"}
{assign var="piwikGoal_payment" value="9"}
{assign var="piwikGoal_confirm" value="10"}
{assign var="piwikGoal_startpage" value="11"}
{literal}
<script type="text/javascript">
var _paq = _paq || [];
{/literal}
{*order TODO Test*}
{if $Bestellung->kBestellung>0 && $AktuelleSeite == "BESTELLVORGANG"}
{foreach name=pos from=$Bestellung->Positionen item=Position key=counter}
{if $Position->kArtikel > 0}
{*_paq.push(['addEcommerceItem',
"9780786706211", // (required) SKU: Product unique identifier
"Endurance: Shackleton's Incredible Voyage", // (optional) Product name
"Adventure Books", // (optional) Product category. You can also specify an array of up to 5 categories eg. ["Books", "New releases", "Biography"]
8.8, // (recommended) Product price
1 // (optional, default to 1) Product quantity
]);*}
_paq.push(['addEcommerceItem', "{$Position->cArtNr}", "{$Position->Artikel->cName}", "", {$Position->Artikel->Preise->fVK[0]}, {$Position->nAnzahl}]);
{/if}
{/foreach}
{*_paq.push(['trackEcommerceOrder',
"A10000123", // (required) Unique Order ID
35, // (required) Order Revenue grand total (includes tax, shipping, and subtracted discount)
30, // (optional) Order sub total (excludes shipping)
5.5, // (optional) Tax amount
4.5, // (optional) Shipping amount
false // (optional) Discount offered (set to false for unspecified parameter)
]);*}
_paq.push(['trackEcommerceOrder', "{$Bestellung->cBestellNr}", {$Bestellung->fGesamtsumme}, {$Bestellung->fWarensumme}, {$Bestellung->fSteuern}, {$Bestellung->fVersand}, false ]);
{*cart*}
{elseif $smarty.session.Warenkorb->PositionenArr}
{foreach name=pos from=$smarty.session.Warenkorb->PositionenArr item=Position key=counter}
{if $Position->kArtikel > 0}
{*_paq.push(['addEcommerceItem',
"9780786706211", // (required) SKU: Product unique identifier
"Endurance: Shackleton's Incredible Voyage", // (optional) Product name
"Adventure Books", // (optional) Product category. You can also specify an array of up to 5 categories eg. ["Books", "New releases", "Biography"]
8.8, // (recommended) Product price
1 // (optional, default to 1) Product quantity
]);*}
_paq.push(['addEcommerceItem', "{$Position->cArtNr}", "{$Position->Artikel->cName}", "", {$Position->Artikel->Preise->fVK[0]}, {$Position->nAnzahl}]);
{/if}
{/foreach}
_paq.push(['trackEcommerceCartUpdate',{$WarenkorbGesamtsumme[0]|replace:".":""|replace:",":"."|replace:" €":""}]); // (recommended) Cart amount
{/if}
{if $AktuelleSeite == "PRODUKTE"}
{*Produktuebersicht*}
{elseif $AktuelleSeite == "ARTIKEL"}
_paq.push(['setEcommerceView', "{$Artikel->cArtNr}", "{$Artikel->cName}", ""{*category*}, {$Artikel->Preise->fVK[0]}]);
{elseif $AktuelleSeite == "STARTSEITE"}
_paq.push(['trackGoal', {$piwikGoal_startpage}]);
{elseif $AktuelleSeite == "REGISTRIEREN" && $piwikGoal_register > 0}
_paq.push(['trackGoal', {$piwikGoal_register}]);
{elseif $AktuelleSeite == "WARENKORB" && $piwikGoal_cart > 0}
_paq.push(['trackGoal', {$piwikGoal_cart}]);
{elseif $AktuelleSeite == "BESTELLVORGANG"}
{if $step == "accountwahl" && $piwikGoal_orderunregistered > 0}
_paq.push(['trackGoal', {$piwikGoal_selectaccount}]);
{elseif $step == "unregistriert bestellen" && $piwikGoal_orderunregistered > 0}
_paq.push(['trackGoal', {$piwikGoal_orderunregistered}]);
{elseif $step == "Lieferadresse" && $piwikGoal_shippingaddress > 0}
_paq.push(['trackGoal', {$piwikGoal_shippingaddress}]);
{elseif $step == "Zahlung" && $piwikGoal_payment > 0}
_paq.push(['trackGoal', {$piwikGoal_payment}]);
{elseif $step == "Bestaetigung" && $piwikGoal_confirm > 0}
_paq.push(['trackGoal', {$piwikGoal_confirm}]);
{else}
{*alert("aktuelle Seite Bestellvorgang: {$AktuelleSeite}\r\nStep:{$step}");*}
{/if}
{else}
{*//alert("unknown page: {$AktuelleSeite}");*}
{/if}
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
{literal}
(function() {
var u="{/literal}{$piwikDomain}{literal}";
_paq.push(["setTrackerUrl", u+"piwik.php"]);
_paq.push(["setSiteId", "{/literal}{$piwikID}{literal}"]);
var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
})();
</script>
{/literal}
<noscript><p><img src="{$piwikDomain}piwik.php?idsite={$piwikID}" style="border:0" alt=""></p></noscript>
<!-- End Piwik Tag -->