WebmasterID logoWebmasterID
Analytics dimensions

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.

Verified against primary sources

What this means

When enhanced measurement fires an outbound click event, it includes link_classes — the raw class attribute of the anchor. The link classes dimension exposes that string so you can filter or group clicks by the CSS classes your design system applies.

This is a lightweight way to analyse clicks by component without instrumenting each button individually.

How to use it well

Because link_classes is a space-separated list, exact-match filters can miss links that carry extra classes; use 'contains' filters for a single token like 'btn-primary'. Consistency depends entirely on your markup — if class names drift across pages, the grouping fragments.

Keep class naming stable, or fall back to explicit events when you need a reliable component label.

How it appears in analytics and logs

A link classes value is the clicked element's class string. Blank link_classes means the link had no class attribute, so styling was inline or inherited.

Diagnostic use case

Use link classes to roll up outbound clicks by design-system component, such as all primary buttons, when your markup applies consistent CSS classes.

What WebmasterID can help detect

WebmasterID can record the clicked element's class as event context, so component-level click analysis works without third-party tracking.

Common mistakes

Privacy and accuracy notes

Link classes records markup metadata, not a person. WebmasterID treats class attributes as first-party UI context, never as an 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.