Google Tag Manager Triggers Explained

A tag in Tag Manager does nothing until a trigger tells it to fire. This guide covers each trigger type Google offers for web containers, the order page view triggers fire in, the options on click, form and visibility triggers, and how filters, exceptions and trigger groups narrow when a tag runs.

This guide is built from Google's Tag Manager Help pages: about triggers, firing triggers and trigger exceptions, best practices for trigger configuration, regex and CSS selector operators and the page for each trigger type, all linked below. What tags, triggers and variables are, and how containers and publishing work, is in our Google Tag Manager basics guide. How to push events and values from your site is in our GTM data layer guide.

How a trigger decides when to fire

Google describes a trigger as something that "listens to your web page or mobile app for certain types of events like form submissions, button clicks, or page views." When the event happens and the trigger's conditions are met, its tags fire, and "every tag must have at least one trigger in order to fire." You can create a trigger from the Triggers section or straight from a tag's Triggering box.

A new trigger fires on every event of its type. To narrow it, choose "Some ..." under "This trigger fires on" (Some Clicks, Some Forms, Some Events) and add filters. Each filter has three parts:

  • Variable: an existing variable, a built-in variable you switch on, or a new one. Click URL, Page Path and Form ID are common choices.
  • Operator: such as equals, contains, less than or matches RegEx.
  • Value: the text Tag Manager compares with the variable when the event happens.

Google's example is a page view trigger with the filter Page URL contains /products/, which fires on every product page when that path appears in their URLs. Two operators need more care. With matches RegEx, Google notes that /pro/ matches "products", "promotions", "professionals" and "processes", so a pattern can catch more than you meant. With matches CSS selector on the Click Element variable, #promo .purchase matches a click on any element with the class purchase inside the element with the ID promo.

The trigger types at a glance

Google lists these trigger types for web containers. The last column shows the built-in variables each one fills when it fires; switch these on in Variables before you use them in filters or tags.

TriggerFires whenValues it gives you
Page view (five kinds)A page loads, at one of five stagesPage URL, Page Path and other page variables
Click: All Elements or Just LinksAny element, or only an <a> link, is clickedClick Element, Classes, ID, Target, URL, Text
Form submissionA form is sentForm Element, Classes, ID, Target, URL, Text
Element visibilityA chosen element comes into viewPercent Visible, On-Screen Duration
Scroll depthThe visitor scrolls past set pointsScroll Depth Threshold, Units, Direction
YouTube videoAn embedded YouTube video starts, pauses, progresses or endsVideo variables, once switched on
Custom eventA named event is pushed to the data layerWhatever you push with it
History changeThe URL fragment changes or the site uses pushStateOld and new URL fragment and history state
JavaScript errorAn uncaught JavaScript error occursError Message, Error URL, Error Line
TimerA set interval passesThe event name, gtm.timer by default
Trigger groupAll selected triggers have fired at least onceNone of its own

Google's built-in variables for web page lists every variable and the data layer key behind it. For example, Click URL reads gtm.elementUrl, which click triggers set. Built-in and user-defined variables are covered in our GTM variables guide.

Page view triggers and their order

There are five page view triggers, and Google gives them a fixed order of precedence:

  1. Consent Initialization: for tags that "set or update the user consent state," such as a consent management platform tag. Every web container includes a Consent Initialization - All Pages trigger. Google says it "is not used for tags that should fire early on a site."
  2. Initialization: fires "before all other triggers except Consent Initialization triggers." Use it for tags that need to run before everything else. Each container includes an Initialization - All Pages trigger.
  3. Page View: fires "immediately when the web browser begins to load a page." Google suggests it when you only need data from page impressions.
  4. DOM Ready: fires once the browser has built the page's HTML and the DOM can be read. Tags whose variables read from the page itself should use this so the values are there.
  5. Window Loaded: fires after the page has fully loaded, "including any embedded resources such as images and scripts."

Google's trigger best practices repeat the consent rule: use Consent Initialization for consent functions only and Initialization for everything else that must fire early. Our basics guide covers consent settings in Tag Manager.

Click and form submission triggers

The click trigger has two types. All Elements tracks clicks on "links, images, buttons, etc." Just Links only tracks clicks on <a> elements, and adds two options:

  • Wait for Tags: waits until the tags have fired or the timeout you set has passed.
  • Check Validation: only fires "when the link click is considered a valid action." Left unticked, it fires whenever a link is clicked.

The form submission trigger has the same two options. With Wait for Tags off, Google warns that "slow tags may not fire before the form submit causes the next page to load." With Check Validation on, the trigger fires only if the form is sent successfully; with it off, it fires "whenever a user attempts to submit the form."

Google is cautious about these two triggers. Its best practices say form and link triggers "can break if another JavaScript event interrupts the process", often because another script returns false first. It recommends testing them in preview mode and limiting them to pages you have tested, with a filter such as Page Path equals /my/tested/form/page. Both trigger pages also recommend filters for performance.

Google says the most common use of the custom event trigger is a form whose default behaviour has been altered, for example when "the submit browser event has been overridden." The site pushes an event such as dataLayer.push({'event': 'button1-click'}) when the action happens, and a Custom Event trigger with that name fires the tag. How to write those pushes is in our data layer guide.

Element visibility and scroll depth

The element visibility trigger fires when an element "becomes visible in the web browser's viewport", whether from a page load, a scroll, a tab coming to the front or a script moving the element. You pick elements by ID (one element) or CSS selector (one or more), then choose how often it fires:

  • Once per page: the first time any matched element is visible.
  • Once per element: the first time each matched element is visible.
  • Every time an element appears on-screen.

By default an element must be at least 50% on screen. You can change that percentage, set a minimum on-screen time (it adds up across the page view: 5,000 ms in view, out, then 5,000 ms again counts as 10,000 ms), and tick Observe DOM changes for elements added after load, such as a thank-you message that replaces a form. Google warns that with a minimum duration or DOM observation, "page performance may be affected" when many elements match, so keep selectors tight or use an ID.

The scroll depth trigger fires at vertical or horizontal points, set in percent or pixels. With 10, 50, 90 as percentages, a visitor who scrolls 90% of the way fires the tag three times. Each point fires once per page, and a point already visible when the page loads fires without any scrolling. The trigger is enabled on Window Load by default because it measures the page once loaded. For infinite-scroll pages or pages that vary a lot in length, Google suggests element visibility instead.

Custom event, timer, history change, YouTube and errors

  • Custom event: matches an event name pushed to the data layer, for interactions "that aren't handled by standard methods." You can tick "use regex matching", but Google warns that .* fires on all events, "including events that Google Tag Manager and Google tag emit automatically."
  • Timer: fires every interval you set in milliseconds, up to an optional limit. Leave the limit blank and it fires until the visitor leaves. Google asks you to add an enabling condition so the listener only runs where needed.
  • History change: fires when the URL fragment changes or the site uses the HTML5 pushState API. Google says this is useful for virtual pageviews in single-page apps; see our JavaScript SEO guide for why such sites behave differently.
  • YouTube video: captures start, complete, pause, seeking and buffering, and progress at percentages or seconds. Progress points fire only the first time they are reached, so a skip past a point doesn't fire it. An advanced option adds the YouTube iFrame API to all videos, which "causes the video to reload if it plays when Tag Manager loads."
  • JavaScript error: fires on uncaught exceptions and "will not report errors that occur before Tag Manager loads."

Several triggers, exceptions and trigger groups

A tag can have more than one trigger, and it fires when "any one of its triggers" matches. Google's example: a tag with an all-pages trigger and a one-page trigger "will always fire on all pages."

To leave pages or cases out, add a trigger exception (a "blocking trigger") in the Exceptions part of the tag's Triggering box. With an all-pages trigger and the exception Page URL equals thankyou.html, the tag "will never fire" on that page. If a tag runs inside a tag sequence, Google notes that it "ignores its own triggers and instead fires as part of the sequence"; Google's tag sequencing page explains setup and cleanup tags.

To require several things before a tag fires, use a trigger group. Google says it "will only fire after all of the selected triggers have fired at least once." Add the same trigger twice and it must fire twice. One use (our example): fire a tag only after a visitor has both scrolled to a pricing table and clicked a contact link.

Testing triggers before you publish

Google's preview and debug mode opens your site connected to Tag Assistant, which shows "which tags fired and in which order" and "what triggered (or did not trigger)" each one. Only you, or people you share the preview with, see the debug view. Our basics guide covers preview, publishing and versions, and our GA4 DebugView guide covers the Analytics side.

How we set up triggers

This is our own practice, not Google's guidance:

  • For lead forms, we prefer a custom event pushed on real success, or a thank-you page view, over the generic form trigger. It only counts sent forms, which matters for conversion tracking.
  • We name triggers by type and condition, such as "Click - Link - tel:", so the list stays readable.
  • Every click and form trigger gets a filter. We avoid "All Elements - All Clicks" except in preview while finding the right variable.
  • Before adding scroll or video triggers, we check what GA4 enhanced measurement already collects, so the same action isn't counted twice.

Frequently asked questions

What is a trigger in Google Tag Manager?

A trigger listens for events on your site, such as page views, clicks or form submissions, and tells a tag to fire when its conditions are met. Every tag needs at least one trigger to fire.

What is the difference between Initialization and Consent Initialization?

Consent Initialization fires first and is only for tags that set or update consent, such as a consent management platform tag. Initialization fires next and is for other tags that need to fire before the rest.

Why does my form submission trigger not fire?

Google says form and link triggers can break if another script on the page interrupts the event, for example by returning false first. Test in preview mode, and if the form's submit behaviour has been replaced, push a custom event to the data layer when the form is sent and use a Custom Event trigger.

What does a trigger exception do?

A trigger exception, also called a blocking trigger, stops a tag from firing under set conditions even when a firing trigger matches, for example all pages except thankyou.html.

Does a tag with two triggers need both to fire?

No. A tag fires when any one of its triggers matches. To require several events before a tag fires, use a trigger group, which fires only after every selected trigger has fired at least once.

For more on measurement, see our guides to Google Tag Manager basics, the GTM data layer, server-side tagging and GA4 key events.