Google Tag Manager (GTM) offers flexible triggers to fire tags based on specific user actions. Whether it's a pageview, form submission, link click, or in-page navigation, these triggers help you track key interactions on your website. Each trigger type serves different purposes and can be tailored to fit specific conditions. Below are the step-by-step guides to set up the following GTM triggers most commonly used by MNTN customers.
On Page View
Fires a tag when a specific page (or all pages) loads. Use this to track page visits on all pages or to track conversion events when a user lands on an important page, like a "thank you" page after completing a purchase.
Steps:
In GTM, go to Triggers and click New
Name your trigger
Select Trigger Configuration, and choose Page View.
Choose Some Page Views.
Set Conditions:
Example: Page URL contains /thank_you (for tracking visits to a thank-you page).
Save the trigger
Assign it to the MNTN Conversion tag in Tags under the Triggering section
Test using Preview Mode
Publish
On Link Click or Button Click
Tracks when users click specific links or buttons. This is useful for monitoring engagement with outbound links, call-to-action buttons, or important site interactions like "Submit," "Buy Now," or "Website."
Steps:
In GTM, go to Triggers and click New
Name your trigger
Choose Trigger Type: Select Click - All Elements or Click - Just Links (if it’s specifically a link)
Under This trigger fires on, select Some Clicks
Set your OR conditions to track clicks based on various attributes:
Example: Click ID equals "submit-button" or Click Text equals "Submit" or Click Class contains "btn-primary".
Save the trigger
Assign it to the MNTN Conversion tag in Tags under the Triggering section
Test using Preview Mode
Publish.
On Form Submit
There are two common cases for form submission, which are handled slightly differently. The first is when submitting the form takes the user to a separate confirmation or thank you page. The second is when the form submission leaves the user on the same page, but with a message shown, such as a confirmation or thank you pop up.
User sent to new page
Fires a tag when a user is redirected to the thank-you page.
Steps:
In GTM, go to Triggers and click New
Name your trigger
Select Form Submission.
Choose Some Forms, and set conditions like: Page URL contains "thank-you".
Save the trigger
Assign it to the MNTN Conversion tag in Tags under the Triggering section
Test using Preview Mode
Publish
User stays on the same page
Fires a tag when a specific element (e.g., thank-you message) becomes visible on the page.
Steps:
In GTM, go to Triggers and click New
Name your trigger
Select Element Visibility.
Set CSS Selector (e.g., #thank-you-message) and add Page URL (e.g. contains "thank-you")
Save the trigger
Assign it to the MNTN Conversion tag in Tags under the Triggering section
Test using Preview Mode
Publish.
On Anchor Link Click (History Change)
Tracks URL fragment changes (i.e., clicks on anchor links that don’t load a new page but scroll to a section on the same page). Use this for tracking in-page navigation, such as when users click links that scroll to different sections of a page.
Steps:
In GTM, go to Triggers and click New
Name your trigger
Select Trigger Configuration, and choose History Change
Under This trigger fires on, choose Some History Changes.
Set your OR conditions by clicking the "+" to add multiple conditions:
Example: New History Fragment contains "section" or New History Fragment contains "about" or Page URL contains "#anchor-link"
Save the trigger
Assign it to the MNTN Conversion tag in Tags under the Triggering section
Test using Preview Mode
Publish
Related Articles: