Erik Baan
Erik Baan

Reputation: 436

combine multiple google tag manager triggers

I'm trying to achieve the following:

My problem is combining the condition 'active tag' (checking for account id) with a 'booking created' event without duplicating logic. Because every trigger is an OR condition, not an AND condition.

Currently, this results in creating exceptions that are very specific, and contain most of the triggers like 'Booking created', specific for a tag (Analytics / Criteo / Adwords). Resulting in having to still make very specific (duplicate) triggers, instead of re-using them. Main issue is exceptions have to match the event type of the trigger. And triggers cannot be combined nor extended.

My tags / triggers configuration looks like this now:

current GTM configuration with specific exceptions

My questions:

Upvotes: 3

Views: 7351

Answers (2)

Omar Venturi
Omar Venturi

Reputation: 91

There is a more powerful and easiest way to combine triggers in multiple AND and OR.

First of all: if you need to combine triggers with just OR condition, you can simply add a list of triggers when you are configuring a tag. I am no talking about exceptions, just triggers. You can click on the (+) symbol and every trigger you add is managed with OR condition.

But, if you need, for instance, to add two triggers in AND? There is a very simple way that does not imply the regex.

Is the trigger group feature. Here are the steps.

  1. Create all the triggers you need to compose (in this phase you don't need to combine them, just one trigger at a time)
  2. Then create a new trigger, but in this case, choose the last type in the list, that is "trigger group". Et voilà... you can combine in the group any of the existing triggers and define if you wnat combine them with AND or OR!!!! :)

Finally, go to your tag and use the GROUP instead of the single trigger.

That's all

Upvotes: 4

Eike Pierstorff
Eike Pierstorff

Reputation: 32780

If your main problem is that "exceptions have to match the event type of the trigger", the common workaround is to use a trigger of the type "custom event", check "use regex" and enter ".*" (without the quotes), which matches all events, including the built-in pageview (gtm.js), DOM ready (gtm.dom) and Window loaded (gtm.load). Then add conditions as needed.

GTM trigger custom events

Upvotes: 3

Related Questions