Hello.
I use Joomla and VirtueMart editorial system.
For some sites, I don’t see statistics of sold products and categories, but only total orders.
I want to make sure I measure everything correctly.
I use this extension to insert the tracking code:
https://www.virtueplanet.com/extensions/vp-conversion-tracking
I insert two codes into the pages.
The first code is inserted on all pages of the site:
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(["setCookieDomain", "*.mydomain.eu"]);
_paq.push(["setDomains", ["*.mydomain.eu"]]);
_paq.push(["setDoNotTrack", true]);
_paq.push(["disableCookies"]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//mydomain.eu/matomo-35sa41afg413sd/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src="//mydomain.eu/matomo-35sa41afg413sd/matomo.php?idsite=1&rec=1" style="border:0;" alt="" /></p></noscript>
This second code is inserted by the plugin only in the last step of the order:
<script>
{{# items }}
_paq.push(['addEcommerceItem',
"{{ product_sku }}",
"{{ product_name }}",
"{{ category_name }}",
{{ product_final_price }},
{{ product_quantity }}
]);
{{/ items }}
_paq.push(['trackEcommerceOrder',
"{{ order_number }}",
{{ order_total_rounded }},
{{ order_subtotal }},
{{ order_tax }},
{{ order_shipment }},
{{ order_discount }}
]);
</script>
Am I correct?
I suspect that in the second code there are no line names, only values… so I have to follow the exact order of each line in the code? Because matomo believes that the first line will always be the product_sku of the product?