Tag Manager no longer passing data to Matomo Analytics after moving to another domain

Check the siteID of the request corresponds to the target site ID in your Matomo server

The siteID, 1, corresponds with the site ID in Matomo and MTM:

Check on the visits on real time dashboard:

There are no new visits since I made the changes. Beside my own visits, I would have had several real visitors appear at this time.

Don’t you have cookie preventing to be tracked, or are you in the blacklist of your Matomo?

No and no. Before I removed the Matomo embed, I could see myself show up on the Real-time dashboard. As mentioned, I tried different devices. Other networks too.

Try to check on the Apache log if the requests you send to Matomo are registered.
Try also to check the Matomo log file, and see if there is any error in it…
Also you can try to replay the requests (matomo.php), on Firefox right click on one of them and click on Update and replay menu (or something like that), and try to simplify it to see if there is some parameter that prevent Matomo to understand it…

Hi @heurteph-ei, I hope you had a great weekend! Thanks for following up once more. Because you pointing out we can analyze the situation by looking at the Network activitiy I discovered the following.

Old setup: both Matomo and MTM embedded

  1. Event requests are sent in debug mode
  2. Event requests are not sent without debug mode

Current setup: only MTM embedded

  1. Newly created tags send data to Matomo! (Last Friday I hadn’t noticed this yet, because I forgot to publish the new MTM settings version)
  2. None of my existing MTM tags are working. But when I remove them and create new ones … I get to see them in Matomo! Oddly, for some I have to create new triggers too.
  3. For some reason my custom paq_push('trackEvent' ...) events are posted to my website domain instead of my Matomo domain, showing 404s on the Network tab. I think I’ll just need to create custom triggers for those in MTM

Summarizing this long thread

I may still be overlooking something, but this is what I learned:

  1. When using MTM, the normal Matomo script should not be loaded.
  2. When moving Matomo + MTM to another domain, you may have to remove all your triggers and tags.
  3. Custom events with paq_push don’t work with MTM.

Very excited that we managed to get to a solution! Thanks again for your help!

If you call _paq.puch(...) before MTM has been initialized on you page, the calls will be made to… the page host!
For this particular case, I had to use my own “buffer” (JavaScript array) in which I pushed my events.
Then on Page View trigger, I run a JavaScript tag that will pull each event stored in the “buffer”.
But if you can through MTM, it would be better…

Yeah I see what you mean. I decided to remove most of my custom events, because I can add replace them with MTM triggers. Makes for cleaner code and better separation of concerns anyway!