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

Can you provide the configuration of the MTM configuration variable, page view trigger and page vew tag ?
Also a screenshot of your preview mode when trigger is fired and tag executed?
And finally a screenshot of the HTTP console

Sure! This looks like all the settings as I have them in the UI:

"parameters": {
	"matomoUrl": "https:\/\/42m.eu\/matomo\/",
	"idSite": "1",
	"enableLinkTracking": true,
	"enableCrossDomainLinking": true,
	"enableDoNotTrack": false,
	"enableJSErrorTracking": true,
	"enableHeartBeatTimer": false,
	"trackAllContentImpressions": false,
	"trackVisibleContentImpressions": false,
	"disableCookies": false,
	"requireConsent": false,
	"requireCookieConsent": false,
	"setSecureCookie": false,
	"cookieDomain": "www.fortomorrow.eu",
	"cookiePath": "",
	"cookieSameSite": "None",
	"disableBrowserFeatureDetection": false,
	"domains": [{
		"domain": "https:\/\/42m.eu"
	}, {
		"domain": "https:\/\/www.fortomorrow.eu"
	}],
	"alwaysUseSendBeacon": false,
	"userId": "",
	"customDimensions": [],
	"bundleTracker": true,
	"registerAsDefaultTracker": true,
	"jsEndpoint": "matomo.js",
	"trackingEndpoint": "matomo.php"
},

I didn’t have a page view trigger and tag before (I didn’t see the need as page views were and are tracked by Matomo Analytics). I added one and published the new version without seeing a difference in the Analytics.

My page view trigger:

Page view tag:

Preview mode:

Console output:


creating container 
running container 
The condition is met for trigger Pageview 
Object { referencedTags: (1) […], id: 720, type: "PageView", name: "Pageview", conditions: [], parameters: [], getId: getId(), setUp: setUp(), addReferencedTag: addReferencedTag(i), getReferencedTags: getReferencedTags()
, … }

firing this tag 
Object { type: "Matomo", name: "Page view", fireTriggerIds: (1) […], blockTriggerIds: [], fireLimit: "unlimited", fireDelay: 0, startDate: null, endDate: null, numExecuted: 1, blocked: false, … }

fired this tag 
Object { type: "Matomo", name: "Page view", fireTriggerIds: (1) […], blockTriggerIds: [], fireLimit: "unlimited", fireDelay: 0, startDate: null, endDate: null, numExecuted: 1, blocked: false, … }

event:  
Object { tags: (1) […], variables: [], metTrigger: {…}, name: "mtm.PageView", eventData: {…}, container: {…}, time: "15:58:44.464", index0: 0, index: 1 }

Hey @heurteph-ei, did you see anything out of the ordinary here?

I am not sure to understand…

Do you see page view events in your Matomo?
If yes, you also mentionned:

So how the page view was sent to Matomo?

Is the site ID on your new instance the good one? (ie: 1)

Can you also provide the browser JavaScript console log (press F12) and also the network log (filtered on matomo)

Alright, sorry for any confusion. Yes, so what I meant is that Matomo does track page views, whether there’s an MTM page view tag enabled or not. It does that because I’ve embedded the Matomo snippet in our site.

The site ID is still 1.

I’ve included the JS console log with the debugger enabled in my previous message. Without the debugger, the console remains empty.

Network log:

| Status | Method | Domain    | File                  | Initiator     | Type | Transferred |
| 200    | GET    | 🔒 42m.eu | matomo.js             | /:276 (script) | js  | 62,88 kB    |
| 200    | GET    | 🔒 42m.eu | container_DAoEsG8O.js | /:291 (script) | js  | 124,85 kB    |

By the way, I tried if removing the Matomo snippet and only using the MTM snippet would give me MTM data, but it didn’t.

Sorry, there is something that I don’t understand. The network log you “shared” just mention the JS files used by Matomo, but no trace of the page view. Whereas you also said:

On my side (Firefox), the call to Matomo scripts is aborted due to unsecured connection whereas the main document is secured:

Also you try to load Matomo twice (one with standard JavaScript tracking, another with MTM). In this case you risk to track some (each?) event twice… Note that the Matomo base code is included in the MTM container

Regarding the network logs: I couldn’t include a screenshot last time, but it looks like that over here the files are properly loaded. Firefox:

Chrome:

Safari in a brand new iOS simulator:

No idea why your Firefox refuses to download with the unsecure connection as a reason. After all, the request is via https. Are you sure it’s not a content blocker/Enhanced Tracking Protection being sensitive about the files coming from another domain? I normally would assume it would be my computer doing something out of the ordinary, but I tried this on several devices and browsers.

The network log you “shared” just mention the JS files used by Matomo, but no trace of the page view. Whereas you also said:

Matomo does track page views

Now I don’t understand how you would expect page views in the network logs :smiley: What I meant with that Matomo does track page views is that, in Matomo I get to see visits and all the other stats that come with Matomo without MTM. Example:

Also you try to load Matomo twice (one with standard JavaScript tracking, another with MTM). […] Note that the Matomo base code is included in the MTM container

I suspected that already. Problem is that if I don’t load matomo.js separately, no visits are tracked at all. I get the point—the current setup is not as it should be. But just to get the basic stats, until I get the MTM container to work, I will load matomo.js separately.

Really appreciate your persistence trying to help us out here, by the way!

I found: There is a security policy based on Symantec that disable URLs categorised as suspicious:
https://sitereview.bluecoat.com/#/lookup-result/https%253A%252F%252F42m.eu%252F
You have to declare the site as safe in order to make everybody access the tracking website…

Thanks to your screenshots, I saw that you filtered the logs on js files only, so the tracking is not visible:


Select [All] in order to be able to see tracking hits…

Look at your Matomo configuration:


Either JavaScript tracking:

Or via MTM:

Thanks for the bluecoat link!

Thanks to your screenshots, I saw that you filtered the logs on js files only, so the tracking is not visible:

Ah I see now! Here’s another screenshot without filtering. What’s interesting here is that you can see Facebook tracking events listed (f.e. the bottom two entries). I set up MTM tags for the same events, but they’re not listed:

As for the Matomo settings, they’re similar to yours:

MTM settings too:

It is the same screenshot


1 → Probably a page view event
2 → An event tracking (Category is Tracking, Action is View the tracking)

This is not settings, this is the code to add to your page if you want to do regular JavaScript tracking (1st screenshot) or MTM tracking (2nd screenshot).
In your code I screenshooted in message 7, Matomo is called twice:

  • Number 1 is the bootstrap for standard JS tracking (it is almost the same as the one defined in Measurables>Tracking Code>JavaScript Tracking Code
  • Number 2 is the bootstrap for MTM tracking. But some part are missing… (_mtm stuffs and startTime)

Yes: page views are tracked, and so are custom events defined in my custom JS. The problem is that none of my MTM events are tracked.

When I remove the first bit of code loading Matomo (and not MTM) in your screenshot, I don’t get any page view tracking at all anymore.

When I remove the second bit, loading MTM, it doesn’t affect tracking (I still get page views and custom events). The only difference it makes is that (as expected) the MTM preview mode doesn’t work anymore.

Just to rule out anything with the way I load Matomo and MTM, I embedded the tracking codes as described in your screenshots too. The results are the same:

2 → An event tracking (Category is Tracking , Action is View the tracking )

This is an event tracked via JS, not set up in MTM.

Number 2 is the bootstrap for MTM tracking. But some part are missing… ( _mtm stuffs and startTime )

Those are on line 260 and 261 of the screenshot.

Just to make super sure I wasn’t mistaken when I did those tests two weeks ago, I’ve just removed the Matomo snippet again. Now there’s no longer any event tracking visible in the Network tab:

Just as before, MTM preview works fine:

And just as before, I’m no longer getting page views in Matomo …

Very strange…
Try to remove any reference of _paq in your code (and keep only the part of code dedicated to MTM).
Still in debug mode, try to fire only the Page view tag (and nothing else)… So just open the page :wink:
Share the network tab (screenshot) filtered on 42m and/or filtered on matom
(in your last screenshot there were too many disturbing hits and too many fired tags…)

Alright, here you go!

OK, good, it seems the page view has been sent (matomo.php?action_name=Nachhaltig schenken:...)
And only with MTM.
Now, trigger one click event

Sure!

Still not visible in Matomo though :cry:

Check the siteID of the request corresponds to the target site ID in your Matomo server
Check on the visits on real time dashboard:

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

Check in the Matomo log file if there is tracking error…

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.