Trigger groups in Google Tag Manager – News Couple

Trigger groups in Google Tag Manager

Trigger group It is the latest type of trigger that you can add to a tag in Google Tag Manager. It allows you to create dependencies between multiple triggers, not even firing the tag Fire each trigger in the group at least once.

This creates an interesting new form in Google Tag Manager, because until now it hasn’t been possible to create triggers based on earlier specific key values ​​(event In this case). With the Trigger Group, the information about the triggers launched on the page is kept internally in the GTM, and once all the triggers configured in the Trigger Group indicate complete, the Trigger Group will fire whatever tag they are attached to.


Simmer . Newsletter

Subscribe to the Simmer newsletter to get the latest news and content from Simo Ahava right in your inbox!

How to create a Trigger group

You will find a file Trigger group within the trigger workflow. So, in the Google Tag Manager user interface, select Catalysts, Then the new, and finally click on the option “Choose the type of player to start setup”.

Create a new player

In the overlay that opens, select File Trigger group Selection.

Trigger set icon

Now you will see the configuration screen.

Trigger group configuration

Its trigger groups very simple operational logic.

  1. tap on Choose a catalyst (or the blue plus button) in the middle of the configuration screen.

  2. Choose one or more of the existing triggers from the overlay that opens.

Every operator you add to the Trigger Group will do Need to shoot the page Several times as it appears in the Trigger Group of the same group to launch any tag attached to it.

Note that You can add a player more than once. By adding a Trigger Group more than once to the Group, that specific Trigger must be fired as many times as it has been added to the Group for the Trigger Group to work.

The The order of the players in the group does not matter. Trigger set will be launched once all the built-in triggers are fired at once, Regardless of the order.

Once you are done adding the triggers, you can also add additional shooting conditions by selecting some cases From the selection “this trigger is called on”. Any condition you add here must pass in addition to the mass shooting triggers.

When you’re done, you can add the Trigger set to your tags. A Trigger group works just like a normal trigger in that once its conditions are met (i.e. all triggers in the group have been fired), the tag itself will be fired.

Following the example of another article recently, you can create a Trigger with a Scroll Depth player and a Timer player. The Trigger won’t fire until both the Scroll Depth player and the Timer player are triggered, which means you can delay your tag from firing until the user has scrolled far enough and has spent some time on the page.

In this example, I have a Scroll Depth trigger that fires at 50 Percent scrolling, and a Timer trigger that fires in 30 seconds of dwell time on the page.

clash trigger

Trigger Group combines Timer and Scroll Depth into a decent engagement tracker.

Example 2: Wait for the All Pages launcher to run first

This example should be correct if you want to create a trigger command between two triggers (and as a result, the tags that trigger the fire). One classic example is waiting for the pageview tag to be activated in Google Analytics before any event tag.

Although it’s a myth that collecting events before pageviews is somehow detrimental to analytics (GA is more than capable of aggregating a session in which the login was not a pageview), the exercise is still useful.

In this Trigger set, we have a file actual Trigger we want to fire the tag using plus all pages Effects. The idea is that the event trigger itself won’t do anything until the all pages trigger is also fired.

Wait for all pages to start

Remember that you can’t prove ranking In the Trigger group. The Trigger deck will be launched as soon as all the triggers included within it have been released – regardless of the order. So the basic assumption here is that event – nonIdle The trigger will never be fired before all pages Effects.

It might make more sense to use tag sequences in most cases where you want to create a sequence to launch items, but in particular when you have a large number of tags depending on a very similar dependency, it may be easier to use a Trigger Group instead.

Another common use case for Trigger Groups is to ensure that other triggers are not launched until the user gives their consent or engages in analytics and ad tracking efforts.

It may not have the same elegance as the tag sequence or have the event trigger an approval status dataLayer (or write it in a cookie), but it only allows you to fire tags after a specific ‘Granted Consent’ event has been pushed to dataLayer.

Anyway, here’s what the Trigger group would look like for a tag that I want to fire when the user is logged in, but I also want to make sure the user agrees to be tracked on my website:

Granted Consent Set

Example 4: Participation Form

Another example of engagement metrics (which Trigger groups are great for), is tracking whether a user has interacted with a specified amount of form fields before marking them as interacting with the form.

For this to work, you need a trigger that activates when the user changes the value of the form field. It’s easy to do with a custom event listener, which is the name of the event you’re listening on 'change':

var form = document.querySelector('#someForm');
form.addEventListener('change', function(e) 
    event: 'formFieldChanged',

And then you can create a custom event trigger for formFieldChanged event name. Once you do that, creating a Trigger group where the user must interact with the form fields three times before firing the tag is simple:

Multiple fields interacted with the form

Things to consider

Here are some things to keep in mind when working with Trigger Groups.

Trigger groups cannot be used as general exceptions

You can’t use the Trigger Group as a trigger exception, because the only thing a Trigger Group can block from firing is the same.

This is a bit unfortunate, as it wouldn’t be too difficult to come up with use cases where you want prevent Tag from firing if some triggers have already been fired.

Trigger combos will only be fired once

When a Trigger Group fires because all the triggers listed inside have been fired, the Trigger Group will not launch again Even if the triggers are inserted into the fire again.

This may not be a big deal, but there are some ramifications. For example, if you have a Scroll Depth trigger that runs at depths of 25, 50, 75 and 100 percent, and then you combine this with a 30-second timer trigger in the Trigger array, the Trigger will fire only once when the Scroll Depth trigger has been triggered Run the Timer trigger (at least once). Thus, it is not possible to wait for the Trigger to fire again until the scroll depth threshold becomes a certain value, for example.

Trigger group doesn’t do that Reset After launching it once.

Trigger groups do not replace combined triggers

This means that if a Trigger group is added to a tag, you may want to make sure that the triggers within that group are not inadvertently added to the tag as well. In fact, the triggers you add to the group don’t need to be added to any tag at all – they can only exist for the Trigger Group itself.

The dataLayer The object is so naked

Trigger Group adds a new event to the GTM default event dictionary: gtm.triggerGroup. The object that gets pushed with this event is basically just a file gtm.triggers key, matching the container’s ID alongside the Trigger Group’s ID itself:

Trigger set in the data layer

In other words, there are no details about the stimuli within the group in the object it is being pushed into dataLayer.


Trigger groups are a great addition to the Google Tag Manager arsenal. It sure is refreshing to have some extra logic on how to add the triggers to the tag.

We’re still far from being able to create complex logic between stimuli (IF…ELSE, NOT, etc), but this is definitely a step in the right direction.

I’m particularly excited about the idea of ​​persisting the previous values ​​of the data layer keys (in the form of knowing which triggers have been launched before) on the page. Perhaps this idea will be extended even further so that we can actually query the history of the data layer on any given page. And wildly think, maybe this information continues across pages, so that a Trigger can fire based on multi-page conditions!

Let me know if you have more examples where Trigger groups might be useful!

Source link

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button