A GTM trigger is the rule that tells Google Tag Manager when a tag should fire β the “if this, then that” condition matched against user actions, page states, or data layer events. Without a trigger, a tag never executes; with the wrong trigger, you collect noise. This guide covers the trigger trinity (tag, trigger, variable), the eight built-in trigger types, conditions and filters, custom event triggers via dataLayer push, trigger groups, GA4 event patterns, and how to debug everything in Preview mode.
What Is a GTM Trigger?
In Google Tag Manager, a trigger is a listener that watches the page for a specific signal and tells one or more tags to fire when that signal arrives. Every trigger has a type (Page View, Click, Custom Event, etc.) that decides what kind of signal it listens for, and an optional set of filters that narrow the match β fire on click, but only when the element has class cta-button, only on /pricing, only for visitors from paid traffic.
Triggers exist because tags should not run on every page or every interaction. A GA4 ecommerce tag firing on a contact page is wasted bandwidth; a Facebook Pixel firing twice per GA4 event doubles your reported conversions. The trigger is the gatekeeper that keeps your tracking surgical.
Trigger vs Tag vs Variable β The GTM Trinity
Tag Manager has exactly three primitives. Confusing them is the most common cause of broken tracking, so anchor the model before anything else:
| Primitive | Question it answers | Example |
|---|---|---|
| Tag | What to send and where? | GA4 Event tag with name cta_click sending to your GA4 property |
| Trigger | When should it fire? | Click β All Elements, where Click Classes contains cta-button |
| Variable | What value to read at runtime? | {{Click Text}}, {{Page Path}}, a custom dataLayer variable |
The flow is one-directional. The trigger evaluates first; if it matches, the tag runs; the tag reads variables to fill in dynamic values like the clicked element’s text or the current URL. Triggers cannot read tag output, and tags cannot run without a trigger. The whole system lives inside a GTM container that you publish to your site as a single snippet.
The 8 Built-In Trigger Types in GTM
GTM ships with eight categories of trigger. Pick the one whose listener matches your signal β using a Click trigger when a Custom Event would be cleaner is a recipe for broken tracking after the next site refactor.
| Type | When it fires | Common use case |
|---|---|---|
| Page View | As soon as the GTM container loads on a page | GA4 base tag, marketing pixels, conversion linkers |
| DOM Ready | When the HTML document is fully parsed | Tags that read DOM content (titles, meta, hidden fields) |
| Window Loaded | When all images, scripts, and resources finish loading | Heatmaps, session replay, performance trackers |
| Click β All Elements | On any click anywhere on the page | CTA tracking, button clicks, generic interaction signals |
| Click β Just Links | On clicks on anchor tags only | Outbound link tracking, navigation events |
| Form Submission | On native form submit events | Lead capture, signup forms (non-AJAX) |
| Scroll Depth | At percentage or pixel thresholds | Content engagement, article completion rates |
| Element Visibility | When a target element enters the viewport | Banner impressions, in-view CTA exposure |
| YouTube Video | On embedded YouTube play, pause, progress, complete | Video engagement metrics |
| Custom Event | On dataLayer.push with matching event name |
Ecommerce, AJAX forms, app interactions, anything from code |
| History Change | On pushState or hash change in single-page apps |
SPA route changes (React, Vue, Angular) |
| JavaScript Error | When an uncaught JS exception bubbles up | Error monitoring, debug analytics |
| Timer | At fixed intervals after page load | Engaged-time signals, dwell-time gates |
| Trigger Group | When all child triggers fire in any order | Multi-step user journeys (see below) |
Two practical notes from setting these up across dozens of sites. First, the Page View family β Page View, DOM Ready, Window Loaded β is a sequence, not three options. Each fires later than the previous one, and choosing between them depends on whether your tag needs DOM access or just an early signal. Second, native Form Submission triggers fail on most modern AJAX forms because the page never actually submits β see the Custom Event section below for the fix.
Trigger Filters and Conditions
Every trigger supports filters to narrow when it fires. The pattern is consistent: pick a built-in or user-defined variable, pick an operator (equals, contains, matches RegEx, starts with, greater than), and supply a value. Stack as many conditions as you need β they AND together within a trigger.
Common condition variables:
- Page Path β match the current URL pathname (
/pricing,/blog/.*) - Page Hostname β useful in multi-environment containers (staging vs production)
- Click Classes / Click ID / Click Element β narrow click triggers to specific UI
- Click URL β for outbound link rules
- Form ID / Form Classes β narrow form triggers to specific forms
- Referrer β fire only on traffic from a specific source
- Custom variables β anything from your dataLayer or a custom JS variable
The mistake to avoid: leaving a Click trigger as All Clicks β no filter. That fires every click everywhere on the site, blowing up your event count and producing useless reports. Always filter by class, ID, or URL pattern unless you genuinely want every click captured.
Creating a Custom Event Trigger (dataLayer push)
The Custom Event trigger is the most powerful tool in GTM because it bridges code-level signals with the tag manager. Anything your application can push to the data layer can fire a tag β orders, AJAX form submissions, in-app interactions, A/B test exposures, anything. The pattern has three steps:
Step 1. Push the event from your application code immediately after the user action:
window.dataLayer = window.dataLayer || [];
dataLayer.push({
event: 'demo_request',
form_id: 'sidebar-cta',
plan: 'pro',
value: 0
});
The reserved key here is event β that string is what the trigger listens for. Everything else is custom payload available to your tags as variables.
Step 2. In GTM, create a Custom Event trigger:
- Triggers β New β Trigger Configuration β Custom Event
- Event name:
demo_request(must match the string from your push exactly) - This trigger fires on: All Custom Events (or filter further by a variable)
Step 3. Create a Data Layer Variable for each payload field you want to read (form_id, plan, value) under Variables β User-Defined β Data Layer Variable. Then in your GA4 Event tag, map them as event parameters and attach the Custom Event trigger you just made.
This is also how you fix the AJAX form problem. Your form submit handler pushes { event: 'form_submit', form_id: '...' } after the API succeeds, and a Custom Event trigger fires the GA4 tag β no fragile reliance on the native form submit event that AJAX bypasses.
Trigger Groups β When to Combine
A Trigger Group is a meta-trigger that fires once all its child triggers have fired in any order during the same page session. It’s the GTM answer to “fire this tag only after the user has both scrolled past 50% AND clicked the video play button” β neither signal alone is enough.
Practical use cases:
- Engaged user definition. Combine
Scroll > 50%andTime on page > 30sinto one trigger that flags genuine engagement. - Multi-step funnel checkpoints. Fire a B2B “qualified visitor” tag only after pricing page view AND demo button click.
- De-duplication of identical signals. When a single user action emits both a click event and a form submit, group them so the tag fires once.
The constraint: child triggers must all fire within the same page session. Once you navigate, the group resets. For multi-page journeys, persist state in user properties or a session cookie and read it through a custom variable.
Common Trigger Patterns for GA4 Events
Most GA4 implementations end up using the same handful of trigger patterns. The right pairing depends on whether the signal exists in markup, in URL state, or only in code.
| GA4 event | Signal source | Trigger to use |
|---|---|---|
page_view |
Page loads (handled automatically by GA4 Configuration tag) | Page View β All Pages |
cta_click |
Visible button or link click | Click β All Elements + Click Classes filter |
file_download |
Click on PDF/ZIP/DOC link | Click β Just Links + Click URL matches RegEx \.(pdf|zip|docx?)$ |
outbound_click |
Click on external link | Click β Just Links + Click Hostname does not contain your domain |
form_submit (AJAX) |
Application code after API success | Custom Event matching form_submit |
scroll_depth (custom thresholds) |
Scroll past 25/50/75/100% | Scroll Depth with thresholds (Enhanced Measurement only fires at 90%) |
video_start |
Video play on embedded YouTube | YouTube Video β Start |
purchase |
Order confirmation page | Custom Event matching purchase with full ecommerce payload |
banner_impression |
Hero banner enters viewport | Element Visibility with min percent visible |
Two patterns deserve special mention. For ecommerce, the GA4 events like add_to_cart and purchase should always come from a dataLayer push fired by your platform β never from a click trigger guessing at button text, because button text is the most refactor-prone signal on the entire site. For SPA tracking, replace Page View with History Change and have your router push a route_change custom event that includes the new path; that way the GA4 page_view fires reliably across React/Vue/Angular navigation.
Debugging Triggers in GTM Preview Mode
Preview mode is the only sane way to test triggers. Click Preview in the GTM workspace, enter the URL you want to debug, and a Tag Assistant window opens alongside your site. Every interaction adds an entry to the left timeline; click the entry, then check the Tags Fired and Tags Not Fired panels to see which triggers matched.
The trigger debug workflow:
- Reproduce the action on the previewed page β click the button, scroll, submit the form.
- Click the matching event in the left timeline (e.g.,
Click,Custom Event: form_submit). - Check Tags Not Fired β Tag Assistant explains why each trigger condition failed (wrong class, missing variable, etc.).
- Inspect Variables β verify
{{Click Classes}}, dataLayer variables, and any custom JS variables resolved to the values you expected. - Inspect Data Layer β confirm your application’s
dataLayer.pusharrived with the correct payload structure.
For deeper testing of the events landing in GA4, switch to DebugView in the Analytics admin, where you’ll see events arriving in real time. For server-to-server events that bypass GTM entirely β payment redirects, offline conversions β see the Measurement Protocol reference. Google’s official Preview and Debug documentation covers the full Tag Assistant interface.
Frequently Asked Questions
What is a trigger in GTM?
A trigger in Google Tag Manager is the rule that tells a tag when to fire. Every trigger has a type (Page View, Click, Custom Event, etc.) that defines the signal it listens for and optional filters that narrow the match. Without a trigger, a tag never fires.
What are the types of triggers in GTM?
GTM ships with eight built-in trigger categories: Page View (and DOM Ready, Window Loaded), Click (All Elements, Just Links), Form Submission, Scroll Depth, Element Visibility, YouTube Video, Custom Event, History Change, JavaScript Error, and Timer. Trigger Groups combine multiple triggers into one meta-trigger.
What is the difference between a trigger and a tag in GTM?
A tag is what GTM sends β a GA4 event, a Facebook pixel, a Google Ads conversion. A trigger is when it sends β the rule (click on this button, page on this URL, dataLayer event with this name) that activates the tag. Tags do nothing on their own; they require at least one trigger to fire.
How do I create a custom trigger in GTM?
Triggers β New β Trigger Configuration β choose Custom Event for dataLayer-driven events, or any built-in type for markup-driven events. Set the event name (must match your dataLayer.push event string exactly), add optional filters by variable, and attach the trigger to one or more tags. Test in Preview mode before publishing.
How does a Custom Event trigger work?
A Custom Event trigger listens for a string in the data layer’s reserved event key. When your application code runs dataLayer.push({event: 'demo_request', ...}), GTM scans active triggers, finds any Custom Event whose name matches demo_request, and fires the tags attached to it. Other dataLayer keys become available as Data Layer Variables.
Why is my GTM trigger not firing?
Most common causes: condition typo (Page Path equals /pricing won’t match /pricing/), wrong Click variable (Click Classes vs Click Element), AJAX form bypassing the native submit event, the trigger evaluating before the DOM element exists, or the GTM container not loaded yet. Open Preview mode and check Tags Not Fired β it explains exactly which condition failed.
What is a trigger group in GTM?
A Trigger Group is a meta-trigger that fires only after all its child triggers have fired in any order during the same page session. Use it for compound conditions like “scrolled past 50% AND clicked play button” to flag engaged users or qualified funnel checkpoints.
Related Terms
- Tag management β the system triggers operate within
- Data layer β source of Custom Event triggers and dynamic variables
- GA4 events β what tags send when triggers fire
- GTM container β the unit you publish to your site that holds all tags, triggers, and variables
- Custom events β dataLayer-pushed events that drive Custom Event triggers
- DebugView β GA4 real-time debug stream for events fired by tags
- Measurement Protocol β server-to-server alternative when triggers can’t reach the signal