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
69 variables

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: Navigation2

HTTP Referrer

User-defined

Returns the referrer, or a part of it such as the hostname, as a variable you configure.

Google’s documentationDescription by GA4 Sensei

URL

User-defined

Returns a chosen part of a URL: full URL, protocol, hostname, port, path, file extension, query or fragment. By default it reads the current page URL.

A URL variable for one query parameter, such as utm_campaign, is cleaner than parsing it in Custom JavaScript.

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

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.