On this page
In plain English
Variables are used in two places. In triggers, they help decide whether a tag should fire ("only when Page Path contains /thank-you"). In tags, they fill in details ("send the order value from the data layer").
GTM comes with built-in variables for common values, and you can create user-defined variables for anything else: data layer values, cookies, lookup tables, constants and more.
In GTM you reference a variable by wrapping its name in double curly braces, for example {{Page Path}}.
Example
Instead of typing your GA4 Measurement ID into ten different tags, you store it once in a Constant variable called {{GA4 – Measurement ID}}. If it ever changes, you update one variable instead of ten tags.
Official documentation
- About variables (opens in a new tab) Tag Manager Help
- User-defined variable types for web (opens in a new tab) Tag Manager Help
Last reviewed