Strange combos of triggers not working

I am completely mystified. Some users start their visit to my website at https://[mysite]/store/?inapp=1

I want an event trigger for each on their first load.

I have a trigger that checks if PageURL contains “/store/” and if it contains “inapp=1”. This trigger fires if I am in preview mode, and the event it triggers is shown as triggering. However for real users, this event never arrives in the reports or realtime view.

I changed it to check if PageUrl contains “/store/?inapp=1” and this works, triggering the same event, which arrives in matomo.

Why? The “bad” one seems better, you could have another URL parameter stuffed in there and should still work. Except it doesn’t work, except in the preview.

Any help is appreciated.

GOOD
{
“idtrigger”: 1458,
“type”: “PageView”,
“name”: “Store Page Inapp”,
“parameters”: [],
“conditions”: [
{
“comparison”: “contains”,
“actual”: “PageUrl”,
“expected”: “/store/?inapp=1”
}
],
“created_date”: “2021-11-19 23:26:15”,
“updated_date”: “2021-11-19 23:26:15”,
“created_date_pretty”: “Nov 19, 2021 23:26:15”,
“updated_date_pretty”: “Nov 19, 2021 23:26:15”
},

BAD
{
“idtrigger”: 1390,
“type”: “PageView”,
“name”: “Store Page Inapp”,
“parameters”: [],
“conditions”: [
{
“comparison”: “contains”,
“actual”: “PageUrl”,
“expected”: “/store”
},
{
“comparison”: “contains”,
“actual”: “PageUrl”,
“expected”: “inapp=1”
}
],
“created_date”: “2021-11-19 18:05:57”,
“updated_date”: “2021-11-19 18:05:57”,
“created_date_pretty”: “Nov 19, 2021 18:05:57”,
“updated_date_pretty”: “Nov 19, 2021 18:05:57”
},

Solved. And this is crazy: splitting the rule like that was enough that saving the new Version crossed over PHP’s default 30 second maximum execution time. So what happens when that happens?

  • MTM cuts the end off your settings and the last few things you added don’t go in the file.
  • MTM does not show an error message. but the save window does not close itself, which registers as odd, but the spinner icon goes away, guess it worked?
  • The webconsole shows a 500 error if you’re watching.
  • MTM lets you publish the partial saved file, and then you’re surprised that things don’t work like they did in the preview.

This is why things work in the tag manager preview: it’s using the draft. But when you publish, it fails to move everything to production, and that’s why your customers don’t trigger the events.

I think that at a minimum matomo needs to:

  • Show you an error message when saving a version failed.
  • Warn you, and make you confirm, before you publish a version that was the result of a failed save.

Ideally i suppose the timeout should longer for important and longer running tasks like saving or importing settings, and maybe the save should be transactional and not result in half saved files. But, the error messages and warning would have saved me dozens of hours in debugging this crazy thing.

I see enough people on these forums with things that work fine in the preview, but don’t work at all when they publish, that I don’t think that what happened to me here is uncommon at all.

Anyway, I think matomo is otherwise a great piece of software. But this particular issue really wasted a lot of my time.