WebmasterID logoWebmasterID
Analytics dimensions

Link ID dimension

Link ID is the dimension that records the value of a clicked link's id attribute. GA4 enhanced measurement passes it as link_id on the click event. Because an HTML id is meant to be unique within a page, it is the most precise way to identify exactly which link was clicked — more reliable than text or class. It only has a value when the clicked element actually carries an id, which many links do not.

Verified against primary sources

What this means

The link ID dimension exposes link_id, the id attribute of the clicked anchor as captured by enhanced measurement's click event. Since ids are intended to be unique per page, this is the cleanest key for 'which exact link was clicked' when the markup provides one.

It complements link_text and link_classes, which can be shared across many links.

Why it is often empty

Most links in typical markup have no id attribute, so link_id is frequently blank. To make it useful you assign deliberate, stable ids to the links you want to measure — and avoid renaming them, since a changed id breaks historical comparisons.

Where you cannot add ids, lean on explicit events with a descriptive parameter instead.

How it appears in analytics and logs

A link ID value is the clicked element's id attribute. Blank link_id means the element had no id, so you must fall back to text, class, or URL to identify it.

Diagnostic use case

Use link ID to identify a specific clicked element unambiguously when you have assigned stable, unique id attributes to the links you care about.

What WebmasterID can help detect

WebmasterID can capture the clicked element's id as first-party event context, enabling precise click attribution without third-party scripts.

Common mistakes

Privacy and accuracy notes

Link ID records a markup identifier, not a person. WebmasterID treats element ids as first-party UI context, never as a visitor identifier.

Related pages

Sources and verification notes

Last reviewed 2026-06-24. Facts are checked against primary/official sources where available; uncertain specifics are marked “Data not yet verified” rather than guessed.