// Push Product View Data to Matomo - Populate parameters dynamically
_paq.push(['setEcommerceView',
"0123456789", // (Required) productSKU
"Ecommerce Analytics Book", // (Optional) productName
"Books", // (Optional) categoryName
9.99 // (Optional) price
]);
// You must also call trackPageView when tracking a product view
_paq.push(['trackPageView']);
The problem is, once someoen visits my product page let’s say product-1 then the normal ```
_paq.push([‘trackPageView’]);
which is in the initialization code gets called, and then the ecommerce view event requires also the track page view to be called, this causes duplicate events for the product page view e.g. I see them in logs as if they are visited twice...
How to fix this?
@refueled yes, you basically need to structure your code where you have a product view event to not call the track page view.
I made it so that the initialization code calls track page view on every page except product pages, I did that by using url contains and have something unique for the product page.
it’s stupid that it works like that but it is what it is.