About cookies on this site

We use cookies to collect and analyse information on site performance and usage, to provide social media features and to enhance and customise content and advertisements. Learn more

Cookie settings

About cookies on this site

Cookies used on the site are categorized and below you can read about each category and allow or deny some or all of them. Learn more

Necessary

Some cookies are required to provide core functionality. The website won't function properly without these cookies and they are enabled by default and cannot be disabled.

Preferences

Preference cookies enables the web site to remember information to customize how the web site looks or behaves for each user. This may include storing selected currency, region, language or color theme.

Analytical cookies

Analytical cookies help us improve our website by collecting and reporting information on its usage.

Marketing cookies

Marketing cookies are used to track visitors across websites to allow publishers to display relevant and engaging advertisements. By enabling marketing cookies, you grant permission for personalized advertising across various platforms.

  • Courses
    • Paid courses
    • Course bundles
    • Free courses
  • Blog
  • Resources
    • Youtube channel
    • E-books and Guides
    • GTM Recipes
    • View All Resources
    • GTM Community
    • GA4 community
  • Services
  • About
    • About
    • Contact
  • Login
  • Courses
    • Paid courses
    • Course bundles
    • Free courses
  • Blog
  • Resources
    • Youtube channel
    • E-books and Guides
    • GTM Recipes
    • View All Resources
    • GTM Community
    • GA4 community
  • Services
  • About
    • About
    • Contact
  • Login

January 1, 2022

Triggers in Server Google Tag Manager Containers

When server-side Google Tag Manager was introduced, there was only one type of trigger, Custom. But when the number of them increased, it’s time for a quick blog post explaining each type and their differences. Let’s take a look at triggers in Server Google Tag Manager containers.

By the way, if you want to learn much more about server-side GTM setup, take a look at my Intermediate/Advanced GTM course.

Enroll in Intermediate Google Tag Manager course

This blog post assumes that you already have at least a very basic understanding of how SGTM works. If you are completely new to this, take a look at this tutorial first. P.S. you would learn much more about SGTM in this course.

As of the moment of writing this article, there are 3 types of triggers, Custom, Page View, and Custom event.

In the future, the number of them might grow.

 

Custom trigger in server Google Tag Manager

This type of triggers is the first one that was available when SGTM was launched. When a Server Container Client accepts the incoming request, processes it, and makes its data available in the container for other tags, you can use a Custom trigger to fire a tag.

An example of a Custom trigger could look like this:

It means that the tag will fire on any incoming request that was processed by a Client named GA4.

If you want, you can use different conditions in a trigger. For example, if you want your trigger to be activated ONLY when the incoming request contains a specific GA4 measurement ID (e.g. G-1234567), then your trigger’s condition could look like this (Note: you first must enable the built-in Query String variable in the Variables > Configure section):

And that is pretty much what you need to know about the custom trigger. You specify conditions in the trigger and when every time a request is processed by any client in the server container, the trigger will be evaluated. If trigger conditions are met, it is activated and all linked tags will fire.

 

Page View trigger in server Google Tag Manager

This trigger (as well as the Custom Event trigger) is created to make the lives of SGTM users a little more convenient. There is nothing groundbreaking here, just a little bit more convenience.

Page View trigger (including All Pages) trigger means that: “the trigger will be activated if the incoming request was processed by a client and generated a page_view event. That event should be visible in the preview mode of server GTM:

That’s it.

You could re-create the same trigger condition by using the aforementioned Custom trigger where the condition is “Event Name” is “page_view”.

The most common example of when can you get this kind of event in the server GTM container is when you have GA4 tags (in the web container), those tags send data to your server-side endpoint AND you have a GA4 client configured in the server container. So when the web GA4 tag sends the page_view, it is then processed by the GA4 client in SGTM and that page_view event is displayed in the preview mode.

With the introduction of the Page View trigger, we now have a default All Pages trigger, that, well, fires on *all* incoming page_view events. But if you want your trigger to be more specific, you can go to Triggers > New (in SGTM) and add additional conditions:

 

Custom event trigger in server Google Tag Manager

Custom event trigger works in the exact same way as the Page View trigger. The only difference is that you can pick the name of the event on which you want to fire. Where can you find the event names? In the preview mode:

For example, if you want a tag to fire only on user_engagement events, then your trigger configuration should look like this:

 

Custom trigger vs Custom Event trigger in server-side GTM

The custom trigger is the OG trigger that was introduced together with the launch of SGTM. You can configure it to fire on any incoming request that was claimed and processed by a client.

The custom event trigger (compared to Custom trigger) has one predefined built-in condition, which is the Event Name contains (or Matches Regex) XXXX. You must replace XXXX with the event name that you want to use (e.g. add_to_cart, purchase, or anything else). That event must be visible in the server GTM preview mode right here:

 

Triggers in Server Google Tag Manager Containers: Final words

Honestly, I wasn’t expecting this kind of guide to appear on my blog. When SGTM was introduced, it had only one trigger and I thought that this is how it will always work. However, it looks like the Google Tag Manager team is adding little time savers here and there to make your work a bit easier.

Interesting, I wonder what will they add in the future

Julius Fedorovicius
In Google Tag Manager Tips
3 COMMENTS
Jan Ruthard
  • Dec 29 2021
  • Reply

Thank you for the explanation! How can i add a page view event/custom event that triggers only when a certain site is visited?

I'd like to fire a google ads conversion event whenever someone lands on the thank-you page, but cant seem to find/create the trigger.

Thanks for the great guide, really helped alrady!

    D
    • Jun 20 2022
    • Reply

    I also want to set this up. Did you find a solution this?

      Jan Ruthard
      • Jun 20 2022
      • Reply

      Yeah @D it's been a while but what I didnt understand at first was that the trigger needs to be created in the webcontainer and then send to the servercontainer. There it can then be used to trigger an event.

Leave a comment Cancel reply

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


 

Hi, I'm Julius Fedorovicius and I'm here to help you learn Google Tag Manager and Google Analytics. Join thousands of other digital marketers and digital analysts in this exciting journey. Read more
Analytics Mania
  • Google Tag Manager Courses
  • Google Tag Manager Recipes
  • Google Tag Manager Resources
  • Google Tag Manager Community
  • Login to courses
Follow Analytics Mania
  • Subscribe to newsletter
Recent Posts
  • Google Tag Gateway: What is it, and How to Configure it
  • Google Analytics 4 User ID for cross-device tracking: how to configure it
  • How to Track Clicks with Google Analytics 4 (2 Options)
Analytics Mania - Google Tag Manager and Google Analytics Blog | Privacy Policy
Manage Cookie Settings