GA4 & GTM reference
Google Tag Manager reference
Every built-in variable and variable type, every trigger and the data layer event it listens for, the tags Google builds in, the consent settings that control them, and what Tag Manager 360 adds.
Written and reviewed by the GA4 Sensei team · Last checked against Google’s documentation 26 Nov 2026
- variables
- 69variables
- triggers
- 18triggers
- tags
- 88tags
- consent settings
- 15consent settings
Pages4
Page URL
{{Page URL}}Built-in
The full URL of the current page, including the query string.
Use Page Path in trigger conditions when the query string doesn't matter: it's less likely to break.
Google’s documentationDescription by GA4 Sensei
Page Hostname
{{Page Hostname}}AuditedBuilt-in
The hostname part of the current URL, such as www.example.com.
Handy for blocking tags on staging or test domains.
Checked in the GA4 Sensei auditStaging / Internal Traffic
Google’s documentationDescription by GA4 Sensei
Page Path
{{Page Path}}Built-in
The path part of the current URL, such as /products/shoes, without the domain or query string.
Google’s documentationDescription by GA4 Sensei
Referrer
{{Referrer}}Built-in
The full URL of the previous page, from the browser's referrer.
Google’s documentationDescription by GA4 Sensei
Utilities10
Event
{{Event}}Built-in
The name of the current data layer event, such as gtm.js, gtm.click or a custom event name.
Always on. Custom event triggers compare against this value.
Google’s documentationDescription by GA4 Sensei
Container ID
{{Container ID}}Built-in
The public ID of the container, such as GTM-XXXXXXX.
Google’s documentationDescription by GA4 Sensei
Container Version
{{Container Version}}Built-in
The version number of the published container, as text.
Sending it as an event parameter helps match data changes to container versions.
Google’s documentationDescription by GA4 Sensei
Environment Name
{{Environment Name}}Built-in
The name of the environment the container was loaded from, such as Live or a staging environment.
Google’s documentationDescription by GA4 Sensei
Debug Mode
{{Debug Mode}}Built-in
True when the container is running in Preview mode.
Google’s documentationDescription by GA4 Sensei
HTML ID
{{HTML ID}}Built-in
Lets a Custom HTML tag report whether it succeeded or failed. Used with tag sequencing.
Google’s documentationDescription by GA4 Sensei
Random Number
{{Random Number}}Built-in
A random number, often used for cache-busting or sampling.
Google’s documentationDescription by GA4 Sensei
Analytics Client ID
{{Analytics Client ID}}Built-in
The client ID from the default Google Analytics cookie.
Useful for passing the browser's client ID to server-side events, so they join the same GA4 user.
Google’s documentationDescription by GA4 Sensei
Analytics Session ID
{{Analytics Session ID}}Built-in
Session IDs from the Google Analytics session cookies on the page. With several GA4 cookies it returns them all in one string.
Google’s documentationDescription by GA4 Sensei
Analytics Session Number
{{Analytics Session Number}}Built-in
Session numbers from the Google Analytics session cookies on the page.
Google’s documentationDescription by GA4 Sensei
Clicks6
Click Element
{{Click Element}}Built-in
The element that was clicked, set by click triggers (reads gtm.element). Can be used with CSS selector conditions.
Google’s documentationDescription by GA4 Sensei
Click Classes
{{Click Classes}}AuditedBuilt-in
The class attribute of the clicked element (reads gtm.elementClasses).
Class names change with site redesigns, so triggers built on them break silently.
Checked in the GA4 Sensei auditRegex and Contains Logic Audit
Google’s documentationDescription by GA4 Sensei
Click ID
{{Click ID}}Built-in
The id attribute of the clicked element (reads gtm.elementId).
Google’s documentationDescription by GA4 Sensei
Click Target
{{Click Target}}Built-in
The target attribute of the clicked element, such as _blank (reads gtm.elementTarget).
Google’s documentationDescription by GA4 Sensei
Click URL
{{Click URL}}AuditedBuilt-in
The href of the clicked link (reads gtm.elementUrl).
mailto: and tel: links put email addresses and phone numbers in this value; don't send it to GA4 unchanged.
Checked in the GA4 Sensei auditPII Risk Scan
Google’s documentationDescription by GA4 Sensei
Click Text
{{Click Text}}Built-in
The visible text of the clicked element (reads gtm.elementText).
Text changes with translations and copy edits, so it's a fragile trigger condition.
Google’s documentationDescription by GA4 Sensei
Forms6
Form Element
{{Form Element}}Built-in
The form element, set by form triggers (reads gtm.element).
Google’s documentationDescription by GA4 Sensei
Form Classes
{{Form Classes}}Built-in
The class attribute of the form (reads gtm.elementClasses).
Google’s documentationDescription by GA4 Sensei
Form ID
{{Form ID}}Built-in
The id attribute of the form (reads gtm.elementId).
The most reliable way to tell forms apart in a Form Submission trigger, if your forms have IDs.
Google’s documentationDescription by GA4 Sensei
Form Target
{{Form Target}}Built-in
The target attribute of the form (reads gtm.elementTarget).
Google’s documentationDescription by GA4 Sensei
Form Text
{{Form Text}}AuditedBuilt-in
The text inside the form (reads gtm.elementText).
Can include whatever the visitor typed into visible fields: never send it to analytics.
Checked in the GA4 Sensei auditPII Risk Scan
Google’s documentationDescription by GA4 Sensei
Form URL
{{Form URL}}Built-in
The URL the form submits to, from its action attribute (reads gtm.elementUrl).
Google’s documentationDescription by GA4 Sensei
History5
History Source
{{History Source}}Built-in
What caused a history change, such as pushState, replaceState or popstate (reads gtm.historyChangeSource).
Google’s documentationDescription by GA4 Sensei
New History Fragment
{{New History Fragment}}Built-in
The # part of the URL after a history change (reads gtm.newUrlFragment).
Google’s documentationDescription by GA4 Sensei
New History State
{{New History State}}Built-in
The state object the page pushed to the browser history (reads gtm.newHistoryState).
Google’s documentationDescription by GA4 Sensei
Old History Fragment
{{Old History Fragment}}Built-in
The # part of the URL before the history change (reads gtm.oldUrlFragment).
Google’s documentationDescription by GA4 Sensei
Old History State
{{Old History State}}Built-in
The history state object before the change (reads gtm.oldHistoryState).
Google’s documentationDescription by GA4 Sensei
Errors3
Error Message
{{Error Message}}Built-in
The message of a JavaScript error caught by a JavaScript Error trigger (reads gtm.errorMessage).
Google’s documentationDescription by GA4 Sensei
Error URL
{{Error URL}}Built-in
The URL of the script where the JavaScript error happened (reads gtm.errorUrl).
Google’s documentationDescription by GA4 Sensei
Error Line
{{Error Line}}Built-in
The line number of the JavaScript error (reads gtm.errorLine).
Google’s documentationDescription by GA4 Sensei
Videos8
Video Current Time
{{Video Current Time}}Built-in
Where the YouTube video was, in seconds, when the event happened (reads gtm.videoCurrentTime).
Google’s documentationDescription by GA4 Sensei
Video Duration
{{Video Duration}}Built-in
The length of the YouTube video in seconds (reads gtm.videoDuration).
Google’s documentationDescription by GA4 Sensei
Video Percent
{{Video Percent}}Built-in
How far through the video the event happened, 0 to 100 (reads gtm.videoPercent).
Google’s documentationDescription by GA4 Sensei
Video Provider
{{Video Provider}}Built-in
The video provider. For the YouTube Video trigger this is YouTube (reads gtm.videoProvider).
Google’s documentationDescription by GA4 Sensei
Video Status
{{Video Status}}Built-in
The state of the video when the event happened, such as start, pause or progress (reads gtm.videoStatus).
Google’s documentationDescription by GA4 Sensei
Video Title
{{Video Title}}Built-in
The title of the YouTube video (reads gtm.videoTitle).
Google’s documentationDescription by GA4 Sensei
Video URL
{{Video URL}}Built-in
The URL of the YouTube video (reads gtm.videoUrl).
Google’s documentationDescription by GA4 Sensei
Video Visible
{{Video Visible}}Built-in
True if the video was visible on screen when the event happened (reads gtm.videoVisible).
Google’s documentationDescription by GA4 Sensei
Scrolling3
Scroll Depth Threshold
{{Scroll Depth Threshold}}Built-in
The scroll depth that fired the trigger: a percentage (0 to 100) or a number of pixels (reads gtm.scrollThreshold).
Google’s documentationDescription by GA4 Sensei
Scroll Depth Units
{{Scroll Depth Units}}Built-in
Whether the threshold is in percent or pixels (reads gtm.scrollUnits).
Google’s documentationDescription by GA4 Sensei
Scroll Direction
{{Scroll Direction}}Built-in
Whether the threshold was vertical or horizontal (reads gtm.scrollDirection).
Google’s documentationDescription by GA4 Sensei
Visibility2
Percent Visible
{{Percent Visible}}Built-in
How much of the element was visible, 0 to 100, when an Element Visibility trigger fired (reads gtm.visibleRatio).
Google’s documentationDescription by GA4 Sensei
On-Screen Duration
{{On-Screen Duration}}Built-in
How long, in milliseconds, the element had been visible when the trigger fired (reads gtm.visibleTime).
Google’s documentationDescription by GA4 Sensei
User-defined: Utilities10
Analytics Storage
User-defined
Returns the Google Analytics client ID, session ID or session number, optionally for one measurement ID.
The reliable way to read GA identifiers for server-side or Measurement Protocol events.
Google’s documentationDescription by GA4 Sensei
Constant
AuditedUser-defined
Returns a fixed text value you enter, such as a measurement ID used by many tags.
Use one constant instead of pasting the same ID into many tags.
Checked in the GA4 Sensei auditGovernance & Maintainability
Google’s documentationDescription by GA4 Sensei
Custom Event
User-defined
Returns the name of the custom event pushed to the data layer.
Google’s documentationDescription by GA4 Sensei
Environment Name
User-defined
Returns the name of the environment shown in Preview mode.
Google’s documentationDescription by GA4 Sensei
Google Tag: Configuration Settings
AuditedUser-defined
A set of configuration parameters, such as a site language, that several Google tags share when they load.
Keeps shared settings in one place. In optimized containers, many shared settings move to the container's Settings tab.
Checked in the GA4 Sensei auditConflicting Google Tag Settings
Google’s documentationDescription by GA4 Sensei
Google Tag: Event Settings
User-defined
A set of event parameters, such as a discount code, that you can add to many GA4 event tags at once.
Google’s documentationDescription by GA4 Sensei
Lookup Table
User-defined
Returns a value from a table that maps an input variable to outputs, such as page path to a conversion label.
Google suggests a RegEx Table instead of very long lookup tables.
Google’s documentationDescription by GA4 Sensei
Random Number
User-defined
Returns a random number.
Google’s documentationDescription by GA4 Sensei
RegEx Table
AuditedUser-defined
Like a lookup table, but matches the input against regular expressions, in order.
Order matters: the first matching row wins.
Checked in the GA4 Sensei auditRegex and Contains Logic Audit
Google’s documentationDescription by GA4 Sensei
User-Provided Data
AuditedUser-defined
Collects email, phone or address details a user has shared, for enhanced conversions and user-provided data collection.
Needs the right consent and a privacy policy that covers it.
Checked in the GA4 Sensei auditPII Risk Scan
Google’s documentationDescription by GA4 Sensei
User-defined: Page variables4
Custom JavaScript
AuditedUser-defined
Returns the result of an anonymous JavaScript function you write.
Keep them short and free of side effects: they can run many times per page.
Checked in the GA4 Sensei auditGovernance & Maintainability
Google’s documentationDescription by GA4 Sensei
Data Layer Variable
AuditedUser-defined
Returns a value pushed to the data layer, such as ecommerce.value. Version 2 reads dots as nested keys.
The most reliable way to get values into tags: agree on the data layer with your developers.
Checked in the GA4 Sensei auditGA4 Event CompletenessEcommerce Object Validity
Google’s documentationDescription by GA4 Sensei
JavaScript Variable
User-defined
Returns the value of a global JavaScript variable on the page.
Google’s documentationDescription by GA4 Sensei
User-defined: Page elements3
Auto-Event Variable
User-defined
Returns a detail of the element or history change behind the current event, such as an element attribute, its type, text, URL or the history change source.
Use Element Attribute to read data-* attributes your developers add to buttons and links.
Google’s documentationDescription by GA4 Sensei
DOM Element
User-defined
Returns the text or an attribute of an element, found by ID or CSS selector.
Breaks when the page layout changes; prefer a data layer value when you can.
Google’s documentationDescription by GA4 Sensei
Element Visibility
User-defined
Returns whether one element is visible (true or false) or how much of it is visible (percent).
Google’s documentationDescription by GA4 Sensei
User-defined: Container data3
Container ID
User-defined
Returns the container's public ID.
Google’s documentationDescription by GA4 Sensei
Container Version Number
User-defined
Returns the container version number.
Google’s documentationDescription by GA4 Sensei
Debug Mode
User-defined
Returns true in Preview mode.
Google’s documentationDescription by GA4 Sensei
Page view triggers5
Consent Initialization
gtm.init_consentAudited
Fires before every other trigger, for tags that set default consent or load the consent banner.
Only consent tags belong here: CMP tags and consent defaults.
Checked in the GA4 Sensei auditConsent Mode Alignment
Google’s documentationDescription by GA4 Sensei
Initialization
gtm.init
Fires before all other triggers except Consent Initialization, for tags that must run early.
Google’s documentationDescription by GA4 Sensei
Page View
gtm.jsAudited
Fires as soon as the page starts loading. The usual trigger for the Google tag.
A Google tag on Page View plus a hard-coded gtag.js on the page counts every page view twice.
Checked in the GA4 Sensei auditDuplicate AssetsHard-Coded gtag.js on the Page
Google’s documentationDescription by GA4 Sensei
DOM Ready
gtm.dom
Fires once the browser has built the page's HTML, so tags can read elements on the page.
Google’s documentationDescription by GA4 Sensei
Window Loaded
gtm.load
Fires after the whole page, including images and scripts, has loaded.
Visitors who leave before the page finishes loading aren't counted by tags on this trigger.
Google’s documentationDescription by GA4 Sensei
Click triggers2
Click – All Elements
gtm.clickAudited
Fires on clicks on any element, such as buttons and images.
Without conditions it fires on every click on the page; always add a filter.
Checked in the GA4 Sensei auditTriggers & Firing LogicMisfiring and Overlap Risk
Google’s documentationDescription by GA4 Sensei
Click – Just Links
gtm.linkClickAudited
Fires on clicks on links (a elements), with options to wait for tags before the page navigates and to check validation.
Checked in the GA4 Sensei auditTriggers & Firing Logic
Google’s documentationDescription by GA4 Sensei
User engagement4
Element Visibility
gtm.elementVisibility
Fires when an element you choose becomes visible on screen, once per page, once per element or every time.
Observing DOM changes on big pages can slow them down; target specific elements.
Google’s documentationDescription by GA4 Sensei
Form Submission
gtm.formSubmitAudited
Fires when a form is submitted, with optional waiting for tags and validation checks.
Many modern forms submit with JavaScript and never fire it; a data layer event after success is more reliable.
Checked in the GA4 Sensei auditTriggers & Firing Logic
Google’s documentationDescription by GA4 Sensei
Scroll Depth
gtm.scrollDepth
Fires when the visitor scrolls past depths you set, in percent or pixels, vertically or horizontally.
Turn off GA4's own scroll event if you track scroll depth here, so the two don't overlap.
Google’s documentationDescription by GA4 Sensei
YouTube Video
gtm.videoAudited
Fires on embedded YouTube video start, completion, pause, seeking, buffering and progress points you set.
GA4's enhanced measurement already tracks YouTube videos; using both counts them twice.
Checked in the GA4 Sensei auditDuplicate Assets
Google’s documentationDescription by GA4 Sensei
Other triggers7
Custom Event
Audited
Fires when a data layer push contains an event with a matching name. The name can be exact or a regular expression.
A regex such as .* matches every push, including GTM's own events.
Checked in the GA4 Sensei auditCatch-All Custom Event TriggersRegex and Contains Logic Audit
Google’s documentationDescription by GA4 Sensei
History Change
gtm.historyChange-v2Audited
Fires when the URL fragment changes or the site calls the browser history API, as single-page apps do. Older containers use gtm.historyChange.
Needed for page views on many single-page sites, unless GA4's history-based page views are on: using both doubles them.
Checked in the GA4 Sensei auditOne-and-Only-Once Check
Google’s documentationDescription by GA4 Sensei
JavaScript Error
Fires when an uncaught JavaScript error happens on the page, with the error message, URL and line in built-in variables.
Google’s documentationDescription by GA4 Sensei
Timer
gtm.timer
Fires at an interval you set, in milliseconds, optionally a limited number of times.
Timers that fire GA4 events inflate event counts; add a limit.
Google’s documentationDescription by GA4 Sensei
Trigger Group
gtm.triggerGroup
Fires once every trigger in the group has fired at least once. Adding the same trigger twice means it must fire twice.
Google’s documentationDescription by GA4 Sensei
Firing triggers and exceptions
Audited
A tag fires when any of its firing triggers matches, unless one of its exception (blocking) triggers matches the same event.
Exceptions only block events of the same type as the firing trigger.
Checked in the GA4 Sensei auditTriggers & Firing Logic
Google’s documentationDescription by GA4 Sensei
Tag sequencing
Settings that fire a setup tag before a tag, or a cleanup tag after it, on the same event.
Google’s documentationDescription by GA4 Sensei
Consent types4
ad_storage
AuditedConsent type
Allows storage, such as cookies, used for advertising.
When denied, Google tags don't write or read advertising cookies.
Checked in the GA4 Sensei auditConsent Mode Alignment
Google’s documentationDescription by GA4 Sensei
ad_user_data
AuditedConsent type
Allows sending user data to Google for advertising, including conversion measurement.
Needed with ad_personalization for personalised ads in the EEA.
Checked in the GA4 Sensei auditConsent Mode Alignment
Google’s documentationDescription by GA4 Sensei
ad_personalization
AuditedConsent type
Allows personalised advertising, such as remarketing.
When denied, remarketing lists don't receive these users.
Checked in the GA4 Sensei auditConsent Mode Alignment
Google’s documentationDescription by GA4 Sensei
analytics_storage
AuditedConsent type
Allows storage, such as cookies, used for analytics.
When denied, Google Analytics sends cookieless pings instead (with advanced consent mode).
Checked in the GA4 Sensei auditConsent Mode AlignmentCookie Before Interaction
Google’s documentationDescription by GA4 Sensei
Privacy storage types3
functionality_storage
Consent type
Allows storage that makes the site work, such as language settings.
Google tags don't use it; it's for your own tags' consent checks.
Google’s documentationDescription by GA4 Sensei
personalization_storage
Consent type
Allows storage for personalisation, such as video recommendations.
Google’s documentationDescription by GA4 Sensei
security_storage
Consent type
Allows storage for security, such as authentication and fraud prevention.
Google’s documentationDescription by GA4 Sensei
Commands and settings8
Consent default
gtag('consent', 'default', {...})AuditedSetting
Sets the consent state before any tag fires, usually denied until the visitor chooses. In GTM, set it on the Consent Initialization trigger or through your CMP's template.
If the default is set after tags fire, the first hits go out without any consent state.
Checked in the GA4 Sensei auditConsent Mode AlignmentCookie Before Interaction
Google’s documentationDescription by GA4 Sensei
Consent update
gtag('consent', 'update', {...})AuditedSetting
Updates the consent state when the visitor makes or changes a choice. CMPs send it from the banner.
A banner that never sends the update leaves Google tags denied for everyone who accepted.
Checked in the GA4 Sensei auditConsent Mode Alignment
Google’s documentationDescription by GA4 Sensei
region
Setting
Limits a consent default to certain countries or regions, so you can deny by default only where a banner is shown.
Google’s documentationDescription by GA4 Sensei
wait_for_update
Setting
How many milliseconds Google tags wait for a consent update before sending data, for banners that load asynchronously.
Google’s documentationDescription by GA4 Sensei
url_passthrough
AuditedSetting
When advertising cookies are denied, passes ad-click information through URL parameters between pages so conversions can still be measured.
Set it the same way on every Google tag and destination tag.
Checked in the GA4 Sensei auditConversion Linker
Google’s documentationDescription by GA4 Sensei
ads_data_redaction
Setting
When ad_storage is denied, also removes ad-click identifiers such as the gclid from Google Ads pings.
Google’s documentationDescription by GA4 Sensei
GTM consent APIs for templates
Setting
The sandboxed functions custom templates, such as CMP templates, use to set default and updated consent in GTM.
Google says templates should use these rather than gtag consent commands.
Google’s documentationDescription by GA4 Sensei
Consent overview and tag consent settings
AuditedSetting
Per-tag settings for which consent types a tag needs, and an overview listing every tag's consent setup.
Google tags read consent automatically; most third-party tags need an extra consent check.
Checked in the GA4 Sensei auditThird-Party Pixel ConsentConsent Mode Alignment
Google’s documentationDescription by GA4 Sensei
Tag Manager vs Tag Manager 3606
5 of 6 differ
| Feature | Tag Manager | Tag Manager 360 | Good to know |
|---|---|---|---|
| Workspaces per container | 3 (the default plus 2) | Unlimited | Every published or versioned workspace is removed; the default workspace comes back. |
| Zones | Not available | Available | Lets linked containers, such as an agency's, fire tags on parts of your site with only the tag types you allow. |
| Approval workflow | Not available | Available | Editors request approval; users with Approve or Publish access approve or reject. |
| Service level agreement | None | Covers container serving, interface availability and support | |
| Support | Help Center and community | Dedicated support specialists | |
| Container size indicator | Shown on the Versions page | Shown on the Versions page | Google advises optimising the container when the indicator is above 70%. |
Source: Workspaces · Zones · Publishing, versions, and approvals · About Google Tag Manager 360 · Manage container size and efficiency
About this reference
Descriptions are written by GA4 Sensei from the Tag Manager Help Center and Google’s consent mode developer guide, linked on every row. Data layer event names, such as gtm.linkClick, are the ones Google’s own gtm.js library uses. The list of built-in tag templates is synced from Google’s Supported tags page.
196 entries in all. For definitions of containers, workspaces, the data layer and other concepts, see the GA4 & GTM glossary. A plain-text version of this page is at /glossary/md/gtm.
Audit your GTM container in minutes
26 GTM checks, free for one GA4 property. No credit card.
