In Google Tag Manager, a trigger decides when a tag fires. Tags say what to send ("a GA4 event called generate_lead"). Triggers say when ("when the contact form is submitted successfully on /contact").
Pick the wrong trigger and you get either missing data or inflated data. This guide covers every trigger type, when to use it, and the setups we see go wrong most often.
How triggers work, in one paragraph
GTM listens to a stream of events: some built in (gtm.js, gtm.dom, gtm.load, gtm.click…), others you push yourself with dataLayer.push({ event: '...' }). A trigger matches one event type plus optional conditions ("Page Path contains /checkout"). When both match, every tag attached to that trigger fires. Exception triggers (blocking triggers) do the opposite: if they match, the tag doesn't fire.
Page view triggers
GTM has five page-load triggers. They fire in this order on every page:
| Trigger | Fires when | Use it for |
|---|---|---|
| Consent Initialization | First, before anything else | Your consent management platform (CMP) and consent defaults only |
| Initialization | Right after consent initialization | Tags that must run before all others, e.g. the Google tag (GA4 config) |
Page View (gtm.js) |
As soon as GTM loads | Most page-level tags |
DOM Ready (gtm.dom) |
When the HTML is parsed | Tags that read page elements |
Window Loaded (gtm.load) |
When everything, images included, has loaded | Low-priority tags like heatmaps and surveys |
Rule of thumb: put consent defaults on Consent Initialization, the Google tag on Initialization, and everything else on Page View unless it needs the DOM. Pushing heavy marketing pixels to Window Loaded is a cheap performance win.
Is your GA4 & GTM setup collecting the right data?
Get a senior review of your tags, triggers, data layer and consent setup, with a prioritized fix list your developers can act on.
Click triggers
- All Elements: any click on any element. Use it for buttons, icons and divs acting as buttons.
- Just Links: clicks on
<a>elements only. It can wait for tags before the browser navigates (it holds navigation for up to 2 seconds by default) and check validation.
Click triggers rely on GTM's built-in click variables, which are off by default. Enable them under Variables → Configure: Click Element, Click Classes, Click ID, Click Target, Click URL, Click Text.
Example: track clicks on "Book a demo" buttons anywhere on the site.
- Trigger type: Click – All Elements
- Fires on: Some Clicks
- Condition:
Click TextequalsBook a demo
Fragile vs. robust: text and CSS classes change whenever someone edits the page. A data-track="book-demo" attribute on the element, matched with Click Element matches CSS selector [data-track="book-demo"], [data-track="book-demo"] *, survives redesigns. The second selector also catches clicks on icons inside the button.
Form submission trigger
It listens for the browser's native submit event. It works on classic HTML forms and often fails on:
- forms submitted with JavaScript/AJAX (most React, Vue and HubSpot-style embeds)
- forms inside iframes (Typeform, Calendly, many HubSpot embeds)
- forms that call
preventDefault()and handle submission themselves
Even when it fires, it fires on submit, not on success, so validation errors count as leads.
Better approach: ask developers to push an event once the server confirms success, then use a Custom Event trigger:
window.dataLayer.push({ event: 'generate_lead', form_id: 'contact_main' });
For third-party embeds, use the vendor's own callback or postMessage events and push to the data layer from there.
User engagement triggers
Scroll Depth: vertical or horizontal thresholds in percent or pixels. GA4's enhanced measurement already logs a scroll event at 90%, so only add this if you need 25/50/75 marks. Turn off enhanced-measurement scroll if you do, to avoid duplicates.
Element Visibility: fires when an element enters the viewport. Great for "promo banner seen" or "pricing table viewed". Settings that matter: - When to fire: Once per page for impressions, otherwise you'll count every scroll back up. - Minimum percent visible and minimum on-screen duration filter out flicks past the element. - Tick Observe DOM changes if the element loads late, e.g. a lazy-loaded section or single-page app content.
YouTube Video: start, complete, pause, seeking and progress percentages for embedded YouTube players. It requires the embed to allow the JS API. GA4 enhanced measurement covers basic video engagement already.
Other triggers
Custom Event: fires when a dataLayer.push includes a matching event value. This is the workhorse of any serious setup: every ecommerce event, lead, sign-up and app-state change should arrive this way. Event names are case-sensitive, and the field supports regex (tick Use regex matching) to catch several events with one trigger.
History Change: fires when the URL changes without a page reload (pushState, replaceState, hash changes). That's how single-page apps (React, Next.js, Vue) "change pages". GA4's enhanced measurement can already count these as page views ("Page changes based on browser history events"). If you also fire a page view on History Change, you'll double count.
Timer: fires every N milliseconds, up to a limit. It's sometimes used for "engaged after 30 seconds", but GA4 already measures engagement time, so it's rarely needed now.
JavaScript Error: fires on uncaught JS errors. Handy for spotting broken pages, but send errors to a monitoring tool rather than flooding GA4.
Trigger Group: fires once all of its member triggers have fired on the same page. Example: "user scrolled 50% and viewed the pricing table". Each member counts once, so a trigger group fires at most once per page load.
Fires on: All vs. Some
Every trigger has All [events] or Some [events] plus conditions. Build conditions from variables like:
Page Pathmatches RegEx^/(checkout|cart)Click URLcontainscalendly.comPage Hostnameequalswww.example.com(blocks staging domains from production data)
Use a hostname condition, or a lookup table that maps hostnames to GA4 measurement IDs, so test traffic never pollutes production reports.
Further reading: What is a data layer? Practical guide with GA4 ecommerce examples
The mistakes behind most broken triggers
- Forgetting built-in variables. Click triggers with no click variables enabled show "undefined" everywhere in Preview.
- Form trigger on AJAX forms. It looks fine in Preview on one form and misses the rest. Switch to data layer pushes.
- Double page views on SPAs. History Change trigger plus enhanced measurement's browser-history page views.
- Case mismatch in Custom Events.
Purchase≠purchase. GTM won't warn you. - Tags on Consent Initialization that shouldn't be there. Only the CMP and consent defaults belong on that trigger.
- Overlapping triggers on one tag. If a tag has two triggers that can both match the same action, it fires twice. Use one trigger with a regex, or an exception trigger.
Test every trigger before you publish
Use Preview mode: perform the action, then select the event in the left-hand timeline. Tags Fired and Tags Not Fired show the result, and clicking a tag shows which trigger conditions passed or failed. Then confirm the event reached GA4 in DebugView. Our DebugView and Preview troubleshooting guide walks through both.
If your container has grown into hundreds of tags and nobody's sure which triggers still matter, that's exactly what our GA4 & GTM audit untangles.