Group triggers together

Hello!

I want to group multiple triggers together so both of them need to be trigger for a tag to fire.
I can’t find any information about this and there is no option to choose between OR/AND when setting the triggers to use on the tag.

Is there any way to achive this?

1 Like

Hi Daniel!

I have the same problem as you. My solution was to create a “custom javascript” variable and add the condition in the javascript. Did you solve your issue?

Hi @victorpalmgren ,
how did you do it?

@daniellundahl did you find a solution? Maybe a plugin or similar? Its what Google Tag Manager provides with “Trigger Groups” and when I did some initial research I was fearing its missing. So its missing for real?

It was a neat solution to combine e.g. page view and a data layer event from the consent tools in order to trigger only with permission. For everyone else who might think why this is needed.

Hi,
I am new to Matomo but what it worked for me was to create the triggers through the tag by clicking create new trigger each time I wanted to add a trigger and I did this for all the triggers i needed to link to the tag. This works like OR . I am not sure how this could work if you want to use the AND condition. I guess you have to use a custom javascript as Victor suggests :slight_smile:

@StellaZaf did you suceed? How did you do it?

@dsp76 Yes, I did it as I describe in my previous comment. But if you do as I suggest, it works only when you want to have OR condition between your triggers.

Thats how it should work:

  • read the datalayer variable into a Matomo custom variable
  • limit the concerned trigger by checking this custom variable

No custom JavaScript needed.