Closed DarkLink571 closed 3 months ago
Hi @DarkLink571 . Thank you for taking the time to create this issue. Reading through your description, I would say that's actually the expected behaviour. If both tags used the same trigger and the priority wasn't honoured, that would be an issue. However, if they use different triggers, there isn't really a clear way to enforce the priority as they could be triggered at very different times. Even being triggered at relatively the same time, since the triggers were different, the tags are processed separately. Do you have any insights on this @AltamashShaikh ?
@snake14 You are correct, @DarkLink571 Can you please elaborate more on what seems to be incorrect for you ?
Hi @snake14 and @AltamashShaikh If the two different triggers will trigger under the same conditions, for example when I use two pageview triggers but with different extra conditions, I would assume all tags that should be fired on a pageview will be ordered by priority, independent of the trigger that triggers them.
@DarkLink571 Can you share the screenshot of 2 triggers ?
Here is an example of what I expected to work. The setup tag should fire on every page and it is important for it to always fire before the conversion tag.
@DarkLink571 I just tried this created a function in my HTML file where we have included the MatomoTagManagerCode.
<script>
function trackCustom(trackingType) {
console.log(trackingType, 'trackingType');
}
</script>
Now created 2 tags to fire on pageView
trigger
trackCustom('pageView');
trackCustom('conversion');
I can see "Custom HTML should fire first" being executed first and "Custom HTML should fire second" after that.
Just FYI. the priority should be lower if you want it to execute first.
Custom HTML should fire first
Custom HTML should fire second
This is not exactly what I meant. In this example, the setup of the tracking function should also be done in the Tag Manager and not be hardcoded. The pageview tracking may be included in this snippet (e.g. in some Google snippets the gtag is loaded and used in the same code-block). I left out the pageview tracking since it wasn't important for the example.
The important part is: Two different tags may fire on the same event but not the same trigger. The order of the tags cannot be controlled with the priority. In the example I gave, an error may occur because the tracking function is not defined despite the tag loading the function triggers on the same event and has a higher priority.
@DarkLink571 If its a different trigger, even though the functionality is same, it won't work the way you are saying, we would recommend you to trigger the 2nd tag on a customEvent
trigger and fire the customEvent
after the first tag is fired.
Hi @DarkLink571 . We are closing this issue as we won't be changing how it currently works.
When two or more tags are fired at the same time, the priority of the tags is not used if the tags don't have the same trigger.
Steps to reproduce:
I guess this is not the expected behaviour and I haven't found an open issue for this yet.