Can the Tag Manager and raw tracking code be combined?

TLDR; Is it possible to combine the use of _paq with the Tag Manager?

We’ve developed a complete set of ecommerce tracking code for BigCommerce using the raw tracking method. i.e. _paq

We did not use the Tag Manager solution for several reasons:

To replicate the features we implement in one script would require quite a bit of setup work for every client, and introduce a good probability of errors. The ecommerce events, basic events, custom dimensions, goals and user data. With the ecommerce ones sending product information.

Some tags could take advantage of the GA4 events we send, but even then things need slight modifications to make the data look right (re multiple categories).

BigCommerce has its own consent system that we can integrate with. I don’t know if the Piwik Pro Consent Manager can work with others?

Our system is working well, however…

I noticed some features that only seem to be available via the Tag Manager. e.g. Heatmaps.

When we added the Tag Manager we noticed the bounce rate dropped to zero, indicating a double tracking issue. We switched “Track page views manually” and this did not fix it.

Is it possible to combine the use of _paq with the Tag Manager?

Hi @Tony!

The quick answer is yes - Piwik PRO Tag Manager is actually using _paq functions that are available in the documentation :slight_smile: .

If you were to install the container (that means Piwik PRO Tag Manager + Consent Manager) you would be able to look into each of the tags and the code these are generating and placing on your website.

(this is a screenshot from the Tag Manager debugger) looking at the main Piwik PRO tag:

As you can see, this code is pretty similar to the No Piwik PRO Tag Manager installation method. There’s just some additional code that handles anonymization and deanonymization automatically based on our Consent Manager and few other things like JS error tracking that you can control from the Tag Manager UI.

1 Like

That was very helpful.

I’ve checked the code and network traffic and can confirm only the one page view is sent for the home page. So I don’t get how its bounce rate dropped from about 50% to 6%.

My code does call enableHeartBeatTimer. Could that cause reduced bounces?

My code does call enableHeartBeatTimer. Could that cause reduced bounces?

Only specific events can “prevent” bounces from happening.

Bounces: The number of sessions during which visitors viewed an entry page but didn’t continue to another page view, goal conversion or ecommerce conversion. If a visitor performs a download, search or other custom event and leaves the entry page, the session is counted as a bounce.

I think it’s best to check the session log or tracker debugger and see what events are sent now and compare them to what was being sent before you have introduced these changes to your tracking setup.

1 Like

Very helpful again.

After some testing I discovered that the duplicate page view did not happen when the browser showed the debugging overlay. I switched to testing in incognito and I could see the second page view.

It seems that the Tag Manager container is sending a page view, even though I have de activated the Piwik Pro tag and set it to manual page views. If I remove the Tag Manager entirely, all is fine.

Using a breakpoint confirmed that trackPageView was being called from the init of the container.

Doh!, I’m an idiot. We never Published our Tag Manager changes, so it was still set to automatic page views. I activated and published and all worked as expected.

Thanks for all the help. We now have a Piwik Pro eCommerce solution for BigCommerce stores :sunglasses:

If your interested, we use our Tag Rocket app to detect lots of client side events like add to cart. Then a custom script uses its API to create and send the right data to Piwik Pro as things happen. BigCommerce stores with Tag Rocket installed just need to add the script and set a few variables.

1 Like