Set up precise heatmaps with Google Tag Manager

Precise heatmaps track every link click on your site, not just the ones GA4 records by default. This page shows you how to set that up in Google Tag Manager (GTM). You need GTM installed on your site and a GA4 Measurement ID.

Start with a trigger that captures every link interaction on your site.

Creating link click trigger in GTM
  • Go to the Triggers section
  • Click New to create a trigger
  • Choose Just Links as the trigger type
  • Configure it to fire on All Link Clicks

Enable the required variables

Enable the built-in variables that the tag needs.

Configuring GTM variables

In the Variables section, under Configure, enable these Click variables:

  • Click Classes
  • Click ID
  • Click URL
  • Click Text

Create the GA4 event tag

Set up a GA4 event tag to send the click data.

Creating GA4 event tag
  1. Create a new tag of type Google Analytics: GA4 Event
  2. Enter your Measurement ID
  3. Set Event Name to link_click
  4. Add these Event Parameters:
    • link_classes: {{Click Classes}}
    • link_id: {{Click ID}}
    • link_url: {{Click URL}}
    • link_text: {{Click Text}}

Connect the tag and trigger

Connect the new tag to the link-click trigger.

Connecting tag to trigger

Enable precise analytics

To finish, email Roman:

  1. Send an email to roman@pageanalytics.io
  2. Include this information:
    • Your email address, if different from the sender
    • Your website URL
  3. Ask to activate precise Page Analytics tracking