We have a react site (not SPA) with quite some dynamic content on the pages.
Out of the box this results in a lot of duplicate page view events being logged, we managed to bring it down by setting stuff to manual and using the react integration to push a pageview event manually.
However we still get automatic page view events being pushed towards piwik. What am I doing wrong ?
Most likely you have this setting enabled. You don’t need it if all the events are controlled manually. Also, those additional events might be created by a full page reload since the Piwik PRO tag in tag manager tracks by default the page view. Of course, that also can be disabled.
We’ve played around with the SPA setting but it’s currently not enabled yet we see automatic triggers happening.
For full context: the piwik code snipped is injected through this gatsby plugin: gatsby-plugin-piwik-pro | Gatsby (gatsbyjs.com)
Also I noticed that the automatically triggered event is sending different data (or at least logging stuff differently in the console).
I was thinking we could maybe use some trigger to filter out the automatic one but I can’t seen to target the manually send one as this only has a title which I can’t target in a trigger as far as I know.
How can we disable the default page view tracking?
Main menu → Tag Manager → Tags → Piwik PRO tag
You can also use the Tag manager debug mode to check which tags are firing.
Unfortunately that is enabled, yet we see automatic logging of page views as per my previous screenshot.
Looks like a bug .
In debug mode it shows only 1 tag being fired.
However in the console we see 2 entries (see above screenshot)
And in the tracker debigger we also see 2 entries:
I figured out the ghost loggings… the gatsby plugin we use to inject the react dependency on our site is actually doing more, it’s also firing a manual pageView event which in our case is being hit at the wrong moment.
We’ll probably either make our own gatsby plugin or ask the author of this to fix this
gatsby-plugin-piwik-pro/gatsby-browser.js at main · leevi978/gatsby-plugin-piwik-pro · GitHub
Thanks @kuba for your insights it did really help to solve things, we’ll get there.
Great that you figured it out. Thanks for the link - I’ll forward it to our integrations team and maybe together with the author we’ll be able to make it more usable.