Safeguard
Compliance•

What can built-in click and form variables capture in Tag Manager?

Built-in variables such as Click Text, Form Text, Page URL and Referrer can pass sensitive values to tags. Know which ones to enable and how to check them.

Safeguard Security Team
3 min read

Built-in Tag Manager variables can read the text of what a visitor clicked, the text and ID of a form, the full page URL and the referrer. Any of these can contain personal or sensitive data. Enable only the variables a tag needs, and check what each tag sends.

What the documentation lists

Google's help page for built-in web variables describes groups of variables set by triggers. Examples from that page:

VariableWhat it holds
Click TextThe text of the clicked element
Click URLThe URL associated with the click
Click ID and Click ClassesThe id and class attributes of the clicked element
Form TextText associated with the form
Form ID and Form URLThe form's id and target URL
Page URLThe full URL of the current page
Page Path and Page HostnameParts of the URL
ReferrerThe full referrer URL
Error MessageThe message from a JavaScript error trigger

The Click Element and Form Element variables hold a reference to the DOM element itself, which is a reminder that these triggers observe the page, not a curated list of fields.

Where the risk comes from

A button can contain a name, an account number or a diagnosis term in its label. A link can contain a token in its URL. A form target can carry a query string. A referrer can carry the previous page's address and parameters. If a tag sends one of these values as an event parameter, the value goes to a third party, often on every click.

Google's Analytics policy page warns that PII is often sent inadvertently in URLs and titles. See personal data in URLs sent to analytics.

An audit in five steps

  1. In the container, open the variables list and note which built-in variables are enabled.
  2. For each enabled one, find the tags and triggers that use it.
  3. In preview mode, click through key flows and read the values shown for each variable.
  4. Look for names, emails, long IDs and free text in those values.
  5. Disable unused variables, narrow triggers to specific elements, and use a fixed label for events instead of Click Text where the label could vary.

Safer patterns

Use a constant event name such as signup_click rather than the visible text. Fire click triggers on a specific element ID, not on all clicks. For form events, send that the form was submitted, not what was typed. Keep sensitive pages out of tag firing altogether, which the pages that should not run marketing tags covers.

Review on every release

A newly added trigger can switch a variable on again. Make the variable check part of the release review.

Quick check

Is Click Text safe to send to analytics?

Only if the labels never vary with the user. Where they might, send a fixed event name instead.

Does disabling a variable remove past data?

No. It stops future use. Past data stays with the vendor, so ask the vendor about deletion.

Where Safeguard fits

Safeguard's compliance and evidence automation can help you keep dated records of reviews like this one, and its dependency scanning covers shipped code. Try the free scan.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.