SocialGouv / matomo-next

Matomo for Next.js applications
Apache License 2.0
152 stars 22 forks source link

Setting up Matomo's Tag Manager #61

Closed kafkasl closed 3 years ago

kafkasl commented 3 years ago

I am trying to set up matomo's tag manager. Emitting events and tracking in general was working correctly using the call:

init({ url: MATOMO_URL, siteId});

However, I am unsure as to where I should place the tag manager call. I have tried to add the container's js into the init call (replacing the original one) because the container JS file just extends the matomo.js one as far as I can tell. It does not seem to work.

init({ url: MATOMO_URL, siteId, jsTrackerFile: 'js/container_lXXXXX.js' });

Am I missing something? Do I need to initialize both things? How can I debug this?

kafkasl commented 3 years ago

I'm closing as I've seen this is not supported and we managed to set it up separately (using the library for normal tracking & normal head script injection for tag manager).