Triggers
Triggers define the conditions under which tags are executed. While tags specify what action to perform (e.g., send an event, update a profile, execute HTML code), triggers specify when that action should run.
Every tag must have at least one trigger assigned. Without a trigger, a tag will never fire. By combining different trigger types and filters, you can build both simple rules (e.g., fire on all pages) and complex logic (e.g., fire only if a user visits the checkout page, scrolls 50%, and clicks the "Buy" button).
Trigger Lifecycle
Trigger Listeners – Tag Manager continuously monitors events such as page loads, user interactions, or variable changes.
Evaluation – When the specified event occurs, the system checks if the trigger’s conditions and filters are satisfied.
Execution – If all conditions match, the trigger fires, and the attached tags are executed.
Step 1: Open the Triggers Tab
From your Workspace, select Triggers in the left-hand menu.
You will see a list of existing triggers with the following details:
Name – the trigger’s unique identifier.
Type – what event activates it.
Attached Tags – tags that will run when the trigger fires.
Last Edited – when the trigger was last modified.
Actions – edit, view, or delete options.

Step 2: Create a New Trigger
Click Create Trigger.
Enter a Name for your trigger (choose something descriptive, like Checkout Button Click).
Select a Type from the dropdown menu. You can choose from options such as:
Page View / DOM Ready / Window Loaded – fires on page load events.
Click / Link Click – fires when users click elements or links.
Scroll Depth – fires at a set scroll percentage.
Element Visibility – fires when an element becomes visible.
Custom Event – fires on developer-defined events.
Timer, API Call, Exit Intent, and many more.

Trigger Types
Page Load Triggers
Page View: Fires as soon as the page starts loading.
Window Loaded: Fires only after the entire page and its resources (images, CSS, scripts) have fully loaded.
DOM Ready: Fires when the HTML document structure is fully loaded (but before images and other resources).
Use Cases:
Fire analytics events when any page is viewed.
Trigger marketing pixels after full page load to ensure reliability.
Run DOM-dependent scripts when the HTML is ready.
User Interaction Triggers
Click: Fires whenever a user clicks on an element.
Link Click: Fires specifically for link clicks (
<a>
tags).Scroll Depth: Fires when a user scrolls down a certain percentage (e.g., 25%, 50%, 100%).
Element Visibility: Fires when a specific element appears in the viewport.
Exit Intent: Fires when the system detects that the user is about to leave the page (e.g., mouse moving toward the browser’s close button).
Use Cases:
Track CTA button clicks.
Log engagement when users scroll through long-form content.
Trigger a widget when a banner comes into view.
Show an exit survey if the user is about to leave without purchasing.
Event-Based Triggers
Custom Event: Fires when a developer-defined event is pushed into the data layer.
History Change: Fires when the browser history changes (e.g., in Single Page Applications).
Navigation: Fires when the user navigates to a new page or section.
Mutation: Fires when a DOM element changes (attribute, content, or child nodes).
Crash: Fires when a JavaScript error occurs.
Console Log: Fires based on captured console messages.
API Call: Fires when a specified network/API request is detected.
Use Cases:
Capture SPA navigation without reloading the page.
Track form validation errors (via console logs).
Fire conversion tags when specific API calls (e.g., purchase confirmation) are made.
Time-Based Triggers
Timer: Fires repeatedly at defined intervals (e.g., every 10 seconds).
Trigger Group: Fires when multiple triggers occur together (all conditions must be satisfied).
Use Cases:
Track how long users stay on a page.
Fire an event only if a combination of conditions are met (e.g., scroll depth + click).
Step 3: Add Filters / Variables (Optional)
Filters allow you to define conditions for when the trigger should activate.
Click Add New Filter.
Choose a Variable (e.g., Page URL, Click Text, Element ID).
Select an Operator (equals, contains, starts with, matches regex, etc.).
Enter a Value (e.g.,
/checkout
,Subscribe Button
).Combine multiple filters with AND / OR logic for advanced rules.
Examples:
Fire only if Page URL contains
/checkout
.Fire only if Click Text equals "Subscribe" AND Page Path starts with
/blog
.Fire if User Role variable equals "Premium" OR Page Path equals
/thank-you
.

Step 4: Save and Attach the Trigger to a Tag
Click Save to create the trigger.
Go to the Tags section.
Edit or create a tag, and under the Trigger step, select the trigger you just created.
Save the tag.
Last updated
Was this helpful?