Analytics and Tracking

Built-in Variable

A ready-made variable in Google Tag Manager, such as Page Path or Click URL, that captures a common value without any custom setup.

Quick facts: Built-in Variable

Category
Analytics and Tracking
Level
Intermediate
Affects
Trigger accuracy, conversion tracking, event tracking reliability
Where to see it
Google Tag Manager Variables > Configure, GTM Preview mode, Tag Assistant
In this article4
  1. How built-in variables work
  2. Why it matters
  3. Common mistakes
  4. How to act on it

A built-in variable is a ready-made variable in Google Tag Manager that captures a common value, such as the current page path, the address of a clicked link or the ID of a submitted form, without any custom setup. You switch it on, and it becomes available to use in triggers and tags.

How built-in variables work

Tag Manager listens for events on the page and decides which tags to fire. Variables supply the details it needs to decide. Built-in variables are the ones Google has already written, grouped by what they read:

  • Pages Page URL, Page Hostname, Page Path and Referrer.
  • Utilities Event, Container ID, Environment Name and Random Number, among others.
  • Clicks Click Element, Click Classes, Click ID, Click Target, Click URL and Click Text.
  • Forms The equivalent set for forms, such as Form ID, Form Classes and Form Text.
  • History, Videos, Scrolling and Visibility Values for page changes without a reload, YouTube video progress, scroll depth and elements coming into view.

In a new web container, only the page variables and Event are switched on. The rest must be enabled under Variables, then Configure, before they appear in a trigger. That is the most common reason someone cannot find Click URL when setting up a click trigger.

When no built-in option holds the value you need, such as an order total or a type of enquiry, you create a user-defined variable instead, usually reading it from the data layer.

Why it matters

Built-in variables are what make tracking precise. A trigger that fires on all clicks is useless. A trigger that fires when Click URL starts with “tel:” records every tap on your phone number, which for a plumber in Bristol or a solicitor in Leeds may be the most valuable action on the site. A trigger on Page Path equals “/thank-you/” fires a conversion only on the confirmation page, not on every page view.

They also keep tracking cheap to maintain. Because they read values the browser already has, you do not need a developer to add code each time you want to measure something new, which matters for a small business without one on call.

Common mistakes

  • Building a trigger on a variable that has not been enabled, then wondering why the condition never matches.
  • Relying on Click Text or Click Classes for important tracking. Rewording a button or updating the theme changes them, and the tracking breaks without warning. Click URL or a stable element ID is more dependable.
  • Using Page URL where Page Path was meant, so the condition fails whenever a UTM tag or other query string is added to the address.
  • Trusting the built-in form submission trigger and Form variables on forms that submit without reloading the page. Many modern form plugins never fire the event Tag Manager listens for.
  • Enabling every variable just in case. It does little harm to the site, but it makes Preview mode harder to read when you are debugging.

How to act on it

Open your container, go to Variables, then Configure, and enable the click and form variables you expect to use. Then start Preview mode, visit your site and perform each action you care about: tap the phone number, click the email address, submit the enquiry form. For each event in the Tag Assistant panel, the Variables tab shows the value every built-in variable held at that moment, which tells you exactly which one to base the trigger on.

Keep a note of which variable each important trigger relies on, so a future site update can be checked against the list. Precise, durable triggers sit underneath the conversion tracking that paid campaigns optimise towards, which makes them part of the groundwork for performance marketing.

Do and do not

Do

  • Enable click and form variables before building click or form triggers
  • Check each variable's value in Preview mode before relying on it
  • Prefer Click URL or a stable element ID over Click Text

Do not

  • Use Page URL in a condition meant for Page Path
  • Assume the form submission trigger works with every form plugin
  • Let personal data in URLs flow into tags

Questions people ask about this

What is the difference between a built-in variable and a user-defined variable?

Built-in variables are written by Google for common values, and you can only switch them on or off. User-defined variables are ones you create, such as a data layer variable, a constant holding your GA4 measurement ID or a lookup table. Use a built-in variable whenever one already holds the value you need.

Why is my Click URL variable empty?

Usually the trigger listens to all elements and the visitor clicked an icon or a piece of text inside the link rather than the link itself, so the clicked element has no URL. Switching to a Just Links click trigger makes Tag Manager read the link's address instead. Also check that Click URL is enabled, and confirm the value in Preview mode.

Can built-in variables send personal data to GA4?

They pass on whatever is on the page. If your site puts an email address or name into a URL, for example on a thank-you page after a form, Page URL will carry it into GA4, which breaks Google's terms and creates a UK GDPR problem. Check the addresses your forms redirect to, and remove personal details before they reach any tag.

Related terms

Found this useful?

Share it, or ask an AI to summarise it

Back to the glossary

Knowing the term is the easy part

Applying it to your own site and budget is the work. Book a call and I will tell you what actually applies to you.