tag-manager icon indicating copy to clipboard operation
tag-manager copied to clipboard

Implement trigger groups feature for Matomo Tag Manager

Open SW-Vincent opened this issue 1 year ago • 5 comments

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 avatar Mar 10 '23 16:03 SW-Vincent

@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

AltamashShaikh avatar Mar 13 '23 03:03 AltamashShaikh

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? Screen Shot 2023-03-20 at 11 33 19 AM

Stan-vw avatar Mar 19 '23 22:03 Stan-vw

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 :

screencapture-stago-matomo-cloud-index-php-2023-03-20-10_03_06

There are 2 things that would make it better than GTM :

  1. 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.

  2. 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 :

screencapture-stago-matomo-cloud-index-php-2023-03-20-10_39_00

I hope i didn't make too many mistakes for i am not english speaker ;)

SW-Vincent avatar Mar 20 '23 09:03 SW-Vincent

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.

9joshua avatar Mar 26 '24 23:03 9joshua

Put like that it kind of joins the following issue https://github.com/matomo-org/tag-manager/issues/761

SW-Vincent avatar Mar 27 '24 08:03 SW-Vincent