4 Ways to Track Link Clicks in Google Tag Manager

Tracking link clicks is an easy way to see how well your clients’ websites are performing.

What You Can Track with the “Just Links” Trigger

We typically use the “Just Links” trigger to track actions such as:

  • Button/Icon Clicks
  • PDF File Downloads
  • Email Address / Phone Number Clicks
  • Outbound Link Clicks (clicks to a different domain)

You can set these 4 tags up in under 10 minutes. Let’s get started.

If you still need tracking help after this, book a free call with us and we can look at your GTM workspace with you.

1. Tracking Button / Icon Link Clicks

  1. In your Workspace, Click New.
  2. Name your tag, and select Google Analytics: GA4 Event as the tag type.
  3. Enter your Measurement ID. This is found in your GA4 property in Admin → Data streams → Click on your existing stream.
    1. You may be prompted by Google to create a “Google Tag”. Go ahead and do that. It’s their new way of sending data to a GA4 property. 
  4. Name your event. We usually end link click events in “_link_clicks” to specify the event type.
4 ways to track links using google tag manager
  1. Click the “Triggering” box. Click the + button in the top right.
  2. Name your trigger. Click the “Trigger Configuration” box.
  3. Select Just Links”. 
4 ways to track links using google tag manager
  1. Select “Some Link Clicks” for the trigger condition. We only want this trigger to fire when a specific link is clicked on.
  2. Click the left dropdown box and select Choose Built-in Variable if you don’t see “Click URL”. That’s the variable we want to use for this trigger. 
4 ways to track links using google tag manager
  1. Select Click URL”. 
  2. Choose your logic for the middle box. We usually select “equals”, so the trigger only fires on that specific link. 
  3. IMPORTANT NOTE: When grabbing this link from your client’s website, DON’T just click the button/file/text/icon and copy the page URL you end up on.
    1. Instead, right click the button/file/text/icon, and select “Copy Link Address”. 
    2. Some links redirect you to a different page than the address of the one you clicked. 
    3.  You want to track the link address of the element you want to track clicks on, as that is what Google Tag Manager is going to pick up as the “Click URL”. 
  1. Add more conditions if necessary. You may only want to trigger this tag when an user clicks a button on a certain page.
    1. Add a “Page URL equals ____” trigger if this is the case. 
  1. Save your trigger and your tag. 

2. Tracking PDF File Downloads

  1. To track PDF file downloads, you need to specify that the “Click URL” contains .pdf.
  1. If you only want to track certain PDF downloads, copy the entire PDF link address by right-clicking on the PDF, as we did earlier. 

Those are 2 of 4 ways to track link clicks using Google Tag Manager. Let’s look at the other two, now.

3. Tracking Email Address and Phone Number Clicks

  1. You can also track clicks on email addresses that prompt an email pop-up window.
    1. To do so, specify that the “Click URL” contains “mailto:”. 
  1. You can also trigger this email when a specific email address is clicked on by adding the address after “mailto:”.
    1. You will see in GTM Preview mode that the Google Tag Manager “Click URL” variable picks email addresses as “mailto:youremail@gmail.com”. 
  2. To track phone number, specify that the “Click URL” contains “tel:”.
  1. This is also how Google Tag Manager recognizes clickable phone numbers on sites that allow users to call the number they click on.
  1. If you right-click the number and copy the link address, you’ll see it includes that “tel:” protocol. 
  2. BONUS: If you want to track ALL email address / phone number clicks using “mailto:” / “tel:”, but you still want to see how many times each one was clicked in your GA4 property, you can add a parameter to your tag.
    1. This parameter will send the “click text”, or the phone number, that the user clicked on to GA4.
    2. Go to your tag. Click the “Event Parameters” dropdown, and choose “Add parameter”. 
    3. Name your parameter. Click the + next to the value box on the right, then click “Built-ins”  in the top right, if you don’t see “Click Text”

  1. Select “Click Text” as your variable. This will pick up the full number that the user clicks on.
  1. Click Save. 
  2. Open your GA4 property up. You need to add this parameter into your property so it can link to this tag properly.
  3. Go to Admin. It’s the gear icon in the bottom left. 
  4. In the “Data Display” section, select “Custom definitions”. 
  5. Select “Create custom dimension”. 
  6. Register your parameter. If it’s been 24 hours since you tested/published your container, the event parameter will sometimes show up in the dropdown. We recommend manually entering the parameter right after making the tag so you don’t forget.
  1. Make sure you enter the same parameter name as what you called it in Google Tag Manager. Any spelling errors will result in the dimension not linking to your tag’s parameter. Just copy/paste to avoid any spelling mistakes.
  2. Once you publish your container and users start clicking that email address / phone number, you can navigate to the “Events” report in your GA4 property, and select the event that you attached a parameter to.
    1. You will see a chart with your parameter and the different addresses / numbers that were clicked, and their counts. 
    2. Here’s a screenshot for a client we tracked PDF downloads for, with the parameter being the PDF file’s name. 
  1. You can do this same thing for any link click, but it may involve using something other than “Click Text”. Play around with it.

4. Tracking Outbound Link Clicks

  1. This setup is pretty simple, if you want to track any link clicks that take your client’s users off their site.
  2. Specify that the “Click URL” does not contain “your client’s domain”. 
  1. This will capture all clicks that take users off your client’s domain and any subdomains. 
  2. NOTE: this will not track when an user exits out of your domain, opens a new tab, or does anything not directly related to a link click that takes them off-site.

Testing your Tags/Triggers

  1. You’ve almost completed your set up of 4 ways to track link clicks in Google Tag Manager.
  2. Our last step is to make sure all of these tags work.
  3. After making your new link click tags/triggers, it’s important to test them in Google Tag Manager’s Tag Assistant.
  4. After clicking a link in Preview mode, select the event in the left sidebar and see if your tag fired. 
  1. If your tag is under the “Tags not Fired” section, click into it.
    1. Look under the “Firing Triggers” section and see what went wrong. 
  1. This is usually where you can see the actual link address Google Tag Manager registered in the data layer, compared to the one you chose this tag to fire on.
  2. You can also navigate to the “Variables” tab and see all of the data that was collected when you tested that link click.
    1. This can help you see which Click URL you were actually supposed to use, or show you other variables you can choose if you want to fire the tag under different conditions.
      1. Examples of that are Page URL, page path, Referrer (page user was on before the page where they clicked the link”. 

Summary

These are 4 ways to track link clicks using Google Tag Manager.

Feel free to use these to get some insight into how users are interacting with the different links, call to actions, and potential exit points on your client’s site. 

If you still need tracking assistance, book a free consultation with us today.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top