Tag Manager + regular tracking code

I use the normal JS tracking code to implement matomo to my website.

I’ve just added the tag manager code aswell. Since then everything is tracked twice.
I’m not talking about events that appear next to the normal “tracking” (switching pages on the website).
Everything is twice. When I go to another page I have two entries for the exact same thing.

Aren’t this two methods meant to be used together? Do I have to load something first (tag manager or regular matomo) to make this work?

Thank you for you help!

Well, I found the error. Seems like I ha a default tag that tracked page views.

Hi Jona, I was wondering about whether one is supposed to embed both the normal Matomo tracking snippet and the Tag Manager’s. Because Tag Manager has a ‘Bundle Tracker’ option in the site variable. How did you get it to work?

1 Like

I agree with @kslstn.
When you add the MTM bootstrap code, you don’t have to add the pure JavaScript bootstrap code, because MTM already loads the whole JavaScript (_paq) engine…

Well, I just added both codes. I didn’t set up anything special besides removing the trigger for pageviews. Might be obsolete, I’m not exactly sure.

In MTM, if you create a trigger on PageView event, and then create a Matomo tag (PageView event) on triggered on the trigger just created at the previous step, then you can remove the JavaScript bootstrap (as it also sends a PageView event to Matomo)
I would suggest you mostly use MTM instead of regular JS, as it is more flexible in the configuration…
Have a look at (especially on intro and training videos):

Thanks, that’s really good to know. My issue must be elsewhere: the MTM script loads, which is confirmed by the preview server, but connection it doesn’t pass on the data to Analytics. I’m no longer getting any default analytics when I remove the default tracker. With what you said, that makes it likely there’s something wrong in my MTM setup (as opposed to the default Matomo setup).