Setting Up Precise Heatmaps in Google Tag Manager

This guide walks you through setting up Google Tag Manager (GTM) to collect link click data for precise heatmaps.

1. Create Link Click Trigger

First, we'll create a trigger that captures all link interactions on your website:

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

2. Enable Required Variables

Next, enable the built-in variables that we'll need for precise tracking:

Configuring GTM variables

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

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

3. Create GA4 Event Tag

Now, set up a GA4 event tag to send the interaction 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 as "link_click"
  4. Add these Event Parameters:
    • link_classes: {{Click Classes}}
    • link_id: {{Click ID}}
    • link_url: {{Click URL}}
    • link_text: {{Click Text}}

4. Connect Tag and Trigger

Finally, connect your new tag to the link click trigger:

Connecting tag to trigger

5. Enable Precise Analytics

To complete the setup, email Roman:

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