TagSpy

click

Enhanced measurementweb

Automatically triggered each time a user clicks a link that leads away from the current domain Collected by default via enhanced measurement.

Platforms
web
When it fires
Collected automatically; no code needed.
Official docs

Parameters (5)

ParameterTypeRequiredDescriptionExample
link_classes--The HTML class attribute for an outbound link or file download. For example, if a user clicks a link '<a class='center' href='www.youtube.com';', this dimension returns 'center'.-
link_domain--The destination domain of an outbound link or file download. For example, if a user clicks a link '', this dimension returns 'youtube.com'.-
link_id--The HTML id attribute for an outbound link or file download. For example, if a user clicks a link '<a id='socialLinks' href='www.youtube.com'>', this dimension returns 'socialLinks'.-
link_url--The full URL for an outbound link or file download. For example, if a user clicks a link '<a href='https://www.youtube.com/results?search_query=analytics'>', this dimension returns 'https://www.youtube.com/results?search_query=analytics'.-
outbound--The text 'true' when a link leads to a website that's not a part of the property's domain.-

Example

gtag.js
gtag('event', 'click', {
  link_classes: '...',
  link_domain: '...',
  link_id: '...',
  link_url: '...',
});
GTM dataLayer
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
  event: 'click',
  link_classes: '...',
  link_domain: '...',
  link_id: '...',
  link_url: '...',
});

Also see