Hands-on module
Triggers: what makes a tag fire
The rules that decide when a tag runs: clicks, links, scroll, timers, visibility and page paths.
Triggers are the rules that decide when a tag runs. This module is a tour of every built-in trigger GTM ships with, from clicks and links to scrolling, timers, element visibility and a handful of engagement signals, so you can fire a tag in response to almost anything a visitor does.
Most of these need no dataLayer at all: GTM listens to the page directly. You'll start with the click and Just-Links triggers, scope them with built-in variables and CSS selectors, then work through page-path rules, exceptions, scroll depth, timers and the engagement triggers (copy, print, tab visibility, exit intent).
What you'll learn
- Fire tags on a specific button (Click ID, Click Text, CSS selector) and on every link
- Restrict a tag to one path, and block it on another with an exception
- Catch scrolling, time on the page, and when an element comes into view
- Track outbound links, downloads, tel:/mailto: clicks, copies, prints and exit intent
Lessons
- 1→
Click & Link Tracking
Buttons and links with assorted attributes. Practice click and link triggers, no dataLayer hints.
- 2→
Click Text Triggers
Fire on a button by its visible text using the Click Text variable.
- 3→
CSS-Selector Clicks
Scope a click trigger with “matches CSS selector”.
- 4→
Page-Path Triggers
Fire a tag only on a specific path using a Page Path condition.
- 5→
Trigger Exceptions
Fire on every page except one by adding a blocking trigger.
- 6→
Element Visibility
Fire a tag when an element scrolls into view, using GTM's visibility trigger.
- 7→
Scroll Depth Tracking
Scroll the page and fire tags at 25 / 50 / 75 / 100% with the Scroll Depth trigger.
- 8→
Engagement Timer
Fire a tag after a visitor stays on the page, using GTM's Timer trigger.
- 9→
Outbound Links & Downloads
External links and file downloads, match them with Click URL conditions.
- 10→
Phone & Email Links
Track tel: and mailto: clicks with Click URL conditions.
- 11→
Copy-To-Clipboard
Fire a tag when a visitor copies text, capturing the selection.
- 12→
Print Tracking
Detect when someone prints the page with the beforeprint event.
- 13→
Tab Visibility
Track when a visitor switches away and returns using the Page Visibility API.
- 14→
Exit Intent
Catch the mouse leaving toward the top of the window and fire an exit event.
- 15→
Triggers: Recap And Verify
Recap every trigger, then check your whole container in one pass.