Lesson 4 of 8
Variables, The Data
A variable is a reusable value you reference with {{double braces}}. Variables keep your setup dynamic: instead of hard-coding an order total, you point a tag at a variable that reads it at runtime.
Built-in variables
- Page values,
Page URL,Page Path,Page Hostname,Referrer. - Click values,
Click Text,Click URL,Click Classes,Click ID.
User-defined variables
- Data Layer Variable, read a value you pushed, e.g.
ecommerce.value. - Constant and Lookup / RegEx Table, map inputs to outputs.
- 1st-Party Cookie, URL, and Custom JavaScript for anything else.
You use variables in two places: inside tags (the values you send) and inside trigger conditions (e.g. fire only when {{Page Path}} contains /pricing).
Key takeaway
Variables are the "what data." Build one variable and reuse it across every tag and trigger that needs that value.