Skip to content

GTM Link Clicks: Check the URL and Nested Click Target

Test an icon, linked text and a separate button. Read Click URL, Click Text and Click Element in GTM Preview before writing the trigger.

A paper ticket with a dark arrow beside a blank label, pointed at by a purple pencil
Jack Lee
3 Min Read
Share
On This Page

A booking link contains an arrow and the words “Book a repair”. Your test records clicks on the words but misses clicks on the arrow. Check which click event and variable your trigger is using.

Select the trigger for a link or a button

Google Tag Manager’s Just Links click trigger applies to HTML links. All Elements can track clicks on links, buttons and other elements. Enable the relevant built-in variables and inspect the values on the event you want to use. Click Text and Click URL are populated by the selected GTM click event. Inspect the observed values rather than assuming they match the label printed on the page.

Start with the destination if you need to count clicks on a link to a specific booking page. For an in-page action without a link, choose the element or the relevant completion event. Our Tag Manager guide covers the tag, trigger and variable roles.

Inspect three clicks on a local page

SEOWithJack clicked an SVG arrow, a text span inside the same anchor, and a separate details button. Chrome's native DOM event recorded the clicked element and the containing anchor.

ClickText on the clicked elementContaining link destination
Arrow inside booking linkEmpty/repair-booking/
Words inside booking linkBook a repair/repair-booking/
Separate buttonSee workshop detailsNone

We tested native browser events only. The test did not load GTM. It illustrates the DOM distinction to confirm in your own container’s Preview.

Test the rule in Tag Manager Preview

  1. Connect Preview to an approved test page. Click the link’s text and icon separately. In Tag Assistant, select each link click event and read Click URL, Click Text and Click Element if enabled.
  2. For a destination rule, use the Click URL observed for those events. Start with the full destination observed in Preview. Test a second anchor with a similar label to make sure the rule identifies the intended one. If a single path legitimately appears with different query strings, account for that in your match and verify that unrelated links stay excluded.
  3. Click the nearby button as a negative check, then check the firing count for the icon and text actions separately. Confirm the intended tag fires once on each link click and stays inactive on the button. Use our Preview and publish guide for the release check.

Frequently asked questions

Use Just Links for an anchor. In Preview, read the actual Click URL and confirm the condition on the intended event.

Can a Just Links trigger match an ordinary button?

A plain button without an anchor is outside that trigger’s link scope. Use an element-based trigger or a dedicated event for the action.

What if two links have the same visible text?

Check their destinations in Preview. If they differ, use the URL to identify the intended navigation. If they match and you need to distinguish placements, add a clearly defined placement signal.

Share This Article