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.
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.
- Holds the clicked element's id attribute
- Most precise of the link_* identifiers
- Empty when the link has no id
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
- Expecting link_id to be populated when links carry no id.
- Renaming element ids and breaking historical click comparisons.
- Confusing the HTML id with GA4's internal item or stream IDs.
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
- Link classes dimension
Link classes is the dimension that records the value of a clicked link's class attribute. GA4 enhanced measurement passes it as link_classes on the outbound click event. Because design systems assign consistent classes to button variants, this field lets you group clicks by component type — for example every 'btn-primary' — without rewriting every link. It is empty when the clicked element carries no class attribute.
- Link text dimension
Link text is the dimension holding the human-readable label a visitor clicked — the words inside the anchor element. In GA4 it is populated by the enhanced-measurement click event as the link_text parameter alongside link_url and link_domain. It is useful for telling apart several links that point to the same destination, but it is empty when the clickable element wraps an image or icon with no text node.
- The click event and outbound clicks
A click event records that a visitor activated a link or element. The most common analytics use is the outbound click — a click on a link leaving your domain — which a normal page_view can never capture because the destination is another site. This page covers what to record on a click, how outbound detection works, and which properties stay privacy-safe.
- CTA tracking
Identify exact clicked links first-party.
Sources and verification notes
- Google Analytics Help — [GA4] Enhanced measurement eventsDocuments the click event and link_id parameter.
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.