tag-manager
tag-manager copied to clipboard
Implement trigger groups feature for Matomo Tag Manager
A group of triggers would only trigger when all of its components have been triggered at least once.
Summary
I noticed this feature for Google Tag Manager and it would do a fine addition to Matomo Tag Manager features ! Thanks to that, matomo users would have a better control over events order of execution, as it is sometimes necessary that some events are triggered before others.
Your Environment
- Matomo Version: Matomo Cloud
@SW-Vincent This looks like a good feature request, I have added this for prioritisation so that our product team could check and take further action on it
Thanks for the suggestion. I've not used that feature in GTM, could you help me understand it?
I'm wondering what the userflow of it is, would it be a new option in the Trigger selection screen (attached) that then has another layer of triggers to choose?
Hi,
It would indeed need a new option in the screen selection.
Then, the user would select triggers just as it can be done for tags, except:
it doesn't fire a tag but a trigger it doesn't fire when at least one trigger has fired but when all triggers have been fired at least once instead This GTM functionality has flaws that need not to be repeated:
It is not possible to trigger it more than once per page view Since there is no "reset," it is not working as it should for SPA. If you want to make it the exact same way as GTM, it would look as follows :
There are 2 things that would make it better than GTM :
-
Define "reset" triggers: each time any of the reset triggers is fired, reset the history for the group of triggers (e.g., page view trigger for SPA). -> Some error handling preventing selecting one trigger from the group would be nice. -> An option for resetting the count when the trigger group itself fires would also be wonderful.
-
After the conditions have been met (i.e., the group has been fired once), triggers each time one trigger of the group is fired (optional). The selection for this section would be limited to the triggers conditioning the group.
Here is an exemple of how it would look :
I hope i didn't make too many mistakes for i am not english speaker ;)
I have another Cloud customer who needs the ability to only fire a Tag when multiple triggers have fired. In this case there would be a primary trigger (All Elements Click) and a dependent trigger (Custom Event). In this example the Tag should not fire unless a button was clicked after a consent status event was pushed to the mtm data layer.
Put like that it kind of joins the following issue https://github.com/matomo-org/tag-manager/issues/761