matomo-org / tag-manager

Free Open Source Matomo Tag Manager - A simple way to manage and maintain all of your (third-party) tags on your website.
https://matomo.org
GNU General Public License v3.0
174 stars 58 forks source link

Sequencing Tags in Tag Manager #294

Open dl-lim opened 3 years ago

dl-lim commented 3 years ago

In Google Tag Manager, there’s a Tag Sequencing feature to allow tags to fire sequentially, so that, for example, one initiates a tracking pixel, and another fires asynchronously for individual events but are dependent on the first pixel.

Is there a similar feature here on Matomo Tag Manager? I note “Fire delay” and “Priority” but if the first script hasn’t finished firing, the second one may fire to no effect, since it is dependent on the first. This is definitely an important feature - for instance, with Facebook Pixels, which is a fairly popular tracking pixel that can be managed by MTM.

If there isn't currently a reliable way to do this yet, may I suggest a Feature Request?

tsteur commented 3 years ago

Thanks for creating this feature request @alderson59 👍

I don't think there is a similar feature yet except for fire delay and priority.

dsp76 commented 2 years ago

This is really a problem, as I would like to extend a bit:

Situation "Google Ads" Tag and Event:

Two Triggers:

  1. page view, when opted into "marketing"
  2. page view, when opted into "marketing" and conversion happened

Two Tags:

  1. Google Ads general tag triggered by trigger 1
  2. Google Ads event code for conversion triggered by trigger 2 and depending on tag 1

Whatever happened, the 2nd tag was called before the 1st tag. Not working.

I can't prioritize triggers - so I made a test. I knew, I created trigger 2 first and added trigger 1 later. Both are page view triggers.

When I deleted trigger 2 and recreated it (now after trigger 1) it started working correctly!

Is it, that after each pulled trigger, the related tags will be called in their order - before the next trigger will be processed? And are they worked on in order they have been created? Than prioritizing or sequenzing of triggers is also necessary - as otherwise prioritizing tags will have no effect at all.

dsp76 commented 2 years ago

alternatively a triggered tag may force another tag to be called before (if it wasn't yet). this would solve the issue as well.