how to track internal links ga4

GA4 Link Click Tracking: How to Set Up in 2022

Google Analytics 4 will track external link clicks by default. But for a comprehensive picture that includes internal link clicks, we can bring in the help of Google Tag Manager (GTM). This guide will review the process to set everything up to do that. For those who want to take the next step, there’s also a link to a tutorial to set up a GA4 link click tracking report so you can easily see all of your link click data in one place.

This is a blog about tracking link clicks within your website, or from your website and going to an external location. If you are interested in tracking links from other places TO your website (like your Google business listing, email campaigns, paid media, and others) you need UTM parameters. If that sounds like you, here is video overview of understanding UTMs in Google Analytics, and here is a written guide to UTM parameters for Google business listings. Assuming you’re in the right place for link click tracking, read on below.

Link Click Tracking Guide Summary

  • Link click tracking allows you to see which links are being clicked on your website. You can track both link clicks within your site (internal links) and links off of your site (external links).
  • The process for setting up link click tracking is different for Google Analytics 4 (GA4) compared to how it had been in Universal Analytics (UA). This guide is focused on GA4 link click tracking, but there is also a video tutorial at the bottom for anyone interested in UA.
  • For Google Analytics 4, external link clicks are one of the “enhanced measurement events” that GA4 can track for you automatically. You will see this GA4 click event named as click in your engagement reports. However, you will need to set up event tracking in Google Tag Manager to track internal link clicks. This requires the use of a tag and a trigger. Part of this process involves configuring your event parameters for your tag to set the data that will flow into your linked GA4 property.
  • For GA4, you also need to register the event parameters for your internal link click event as custom dimensions so you can see the parameter data in your reports. This is a completely new step compared to Universal Analytics. This guide will show you how to do that, but it’s worth considering watching this explainer of custom dimensions so you know what’s going on.

Ready to go? Let’s do it. The video review of GA4 link tracking is below. Or if you prefer a text version, please keep on reading to review the 7 steps.

Still here? That’s great. We’ll review GA4 link click tracking first. If you’re only focused on UA, click here to skip down to bottom of the blog. But remember, UA is going away beginning in July 2023 so it’s time to start getting more acclimate to GA4. There’s usually a new GA4 training video each week on the Root and Branch YouTube channel, so you can subscribe if you want to check that out.

The Link Click Tracking Ingredients You Will Need

Before we get started, let’s make sure we have all the elements necessary. We’ll need Google Analytics and Google Tag Manager. If you are dual tagging with both GA4 and UA, you’ll need both UA and GA4 property codes deployed on your site. If you’re using only one property type or the other, obviously follow the instructions for the correct property type.

Google Analytics

We’ll be working with the GA4 property type first and will then show the steps for the Universal Analytics (UA) property type. Remember, GA4 will track your external links without the additional help of Google Tag Manager (GTM) using the enhanced measurement click event. However, you’ll need GTM  to track internal link clicks. For UA, you’ll need to set up event tracking with GTM for both UA and GA4. And the link click tracking data is easier to see in UA than GA4. That’s one of many reasons, UA still makes a lot of sense if you’re considering GA4 vs. UA (reminder: use both).

google analytics png

For video guides to setting up UA or GA4 with Google Tag Manager, you can check the links below:

Video: Set up UA with GTM in 3 Steps

Video: Set up GA4 with GTM in 5 Minutes

Google Tag Manager

Like many of the more useful tracking options in Google Analytics, we need Google Tag Manager for Google Analytics link tracking. In other words, it won’t work if you aren’t using GTM in conjunction with GA4 and / or UA. If you aren’t currently using Tag Manager, you can head over here and learn how to deploy GTM on your WordPress site.

google tag manager png

If you’ve got those two ingredients, we’re ready to cook up a meal of delicious link click tracking.

Link Click Tracking With Google Analytics 4 (GA4): 7 Steps

Let’s walk through the the 7 steps to track those sweet GA4 clicks.

Remember: Google Analytics 4 can track outbound link clicks by default as “enhanced measurement events”. This will  happen by default unless you’ve turned it off (you can check by reviewing your Data Stream in the admin section of GA4). However, it does NOT track internal link clicks. For internal link click tracking with GA4 we need to bring in the help of Google Tag Manager (GTM) and pair it up with our Google Analytics 4 property.

We’ll start with Google Tag Manager, so head over there first.

1.) In Google Tag Manager, create our trigger to isolate internal link clicks on our domain

Once you’re logged in at tagmanager.google.com hit “Triggers” from the left-hand navigation menu. Then hit the blue “New” button on the right sight of the screen. Give your trigger a name that you’ll remember. Perhaps Internal Link Click Trigger will work just fine.

Configure a trigger with the trigger type of “Click – Just Links”. You can see the trigger to fire on only some clicks. Set a condition so that the trigger will only fire on link clicks that include your domain name. You can see how I’ve set that up below.

ga4 link click trigger

2.) In GTM, you’ll need to configure your built-in click variables

If you haven’t previously configured your built in variables, hit “Variables” in the left-hand navigation of Tag Manager. You will see it immediately below Triggers. Hit the blue “Configure” button at the top right of the screen next to Built-In Variables.

This includes the {{Click URL}} variable that we’ll need to use in our link click tracking event parameters. I’d also recommend configuring {{Click Text}} if you want to track the relative click frequency of different anchor text link variants. And if you wan to configure all of them as I’ve done below, that is fine as well.

It only takes a second to configure by making sure the checkbox is turned on, so go wild.

configure built in click variables

3.) In GTM create your GA4 internal link click tag.

Select “Tags” in the left-hand navigation of GTM. You’ll see this immediately above “Triggers”. Now, hit the blue “New” button on the right side of the screen. Click into Tag Configuration and select “Google Analytics: GA4 Event” as your tag type. Give your tag a name. How about GA4 – Internal Link Clicks if you’re not feeling creative. Note: this tag name will only be for organizing your GTM container. It’s not the same as the event name that will actually show up in your GA4 reports. The event name I’ve used below is internal_link_click. This is the name that will show up in my GA4 reports when this tag fires.

ga4 link click tag

As you can see above, you can include two event parameters to help you analyze your link click data. Those parameters are link_url with a value of {{Click URL}} and link_text with a value of {{Click Text}}. Remember those built-in variables you configured in step ? This is where they come in handy. In two steps, you will need to register these two parameters in GA4 as custom dimensions in order to be able to see the resulting data in either GA4 reports or Google Data Studio.

4.) Pair your new GA4 internal link click tag with your internal link click trigger

GTM sends data into Google Analytics when a tag is triggered. The data that we’re sending is included in our GA4 link click tag that we just built. But if we don’t pair it up with the right trigger then we won’t get any data. So select your Internal Link Click trigger as the firing trigger for the tag. You can see what this looks like below.

ga4 link click tag paired with trigger

5.) After testing to confirm all is working properly, publish your GTM container.

Testing is always a good idea. You can hit the “Preview” button in the top right of the screen to enter preview and debug mode in GTM. Once you confirm it’s working, you can publish your container by hitting the blue  “Submit” button that is immediately to the right of the “Preview” button.

Congrats! You’ll now get the link click data in Google Analytics. However, if you don’t complete the next step, you’ll only be able to see this data in your Debug view. In other words, complete the next step so you don’t waste all your work.

6.) In GA4 register your two new event parameters as Custom Dimensions

We’re done with our work in GTM so now we’re going to head over to Google Analytics. So log in to your GA4 property that is associated with your GTM container.

Now, go to the “Configure” menu in the left-hand navigation. Then select Custom Definitions as you can see below. Then, hit the blue “Create custom dimensions” button to create two new event-scoped custom dimensions. These custom dimensions will allow you to see the link_url and link_text event parameter data that you created in Step 2. If you don’t register them as custom dimensions, you won’t be able to see them in your GA4 reports.

When creating your custom dimensions, you must complete the event parameter field exactly as you wrote your Parameter name in your GA4 tag creation. For the “Dimension name”, enter whatever you’d like to see in your reports. This is how that dimension will show up.

You can see the two new dimensions I created for Link Click Text and Link Click URL in the red box below.

register link click tracking parameters as custom dimensions in ga4

7.) Optional: Create a report in Google Data Studio that will show ALL of your GA4 link clicks.

This will combine the internal link click data that you’ve just set up with the external link click data that is tracked automatically by GA4 enhanced measurement.

If you’d like to make a copy of the report, you can find a link to do that in the description of the video linked below.

Link Click Tracking With Universal Analytics (UA)

Looking for some additional help with UA? That’s great. Here is an overview of the major steps.

What You Need to Do in Google Tag Manager and Universal Analytics

Here we go!

  1. In Google Tag Manager, create your user defined variable for your Google Analytics property. This ties your GTM container code to your UA property so the data goes to the right place.
  2. Configure your built in variables. This includes the {{Click URL}} variable that we’ll need to use in our link click tracking event parameters. Fun fact: the curly brackets are always indicative of variables in GTM. When you use a variable (as opposed to a static value) in your tags, different data will flow into Google Analytics depending on the specific action that takes place. This is perfect for tracking link clicks since we’ll want a different value to pass based on the specific link that was clicked.
  3. Create your link click trigger in Google Tag Manager. To track all link clicks, set the trigger to fire on all pages on all link clicks.
  4. Create your link click tag in Google Tag Manager. It’s important to understand the event parameters of Category, Action, and Label. Associate your tag with your link click trigger so it will fire properly.
  5. After testing to confirm all is working properly, publish your Google Tag Manager container and you’ll now get the link click data in Google Analytics. Within your Event reporting in Universal Analytics (within the Behavior reporting section), you will see your Category, Action, and Label event data for your link clicks.

You can also watch this video which goes through each step so you can follow along.

Pretty great, right? You can see an example of this data below. What’s shown below are the most popular links that were recently clicked from the Root and Branch blog page. You can see that 3 of the top 5 blog topics were related to SEO. [Update as of September 2022: these top links are ALL about GA4 now. Sorry SEO.]

link click tracking in google analytics reporting

Now, you should be good to go!

Beyond Link Click Tracking in Google Analytics

There’s always a lot to learn and a lot to do with Google Analytics. If you’re hungry for more, consider checking out this page of GA4 questions and answers. It’s getting some regular updates these days! Or, if you’re into SEO, how about these 8 trends for SEO in 2022.

And if you’re interested in more digital marketing tips and tricks like this, head on over to YouTube and check out the Root and Branch channel. And feel free to ask questions because it helps me learn. I do my best to respond to all questions and comments over there. You can learn more about Root and Branch or connect with me (Hi, I’m Zack) over on LinkedIn.

click to yt

Final Thoughts

If you have questions or suggestions or your own tips to share, feel free to drop them in the comments below. Thanks and have fun out there!

13 replies
    • Zack_Duncan
      Zack_Duncan says:

      Hi there Ryan, thanks for reading and thanks for the question. Much of what is outlined in this link click tracking guide should apply to button click tracking in GA4. But to get you the most satisfactory answer, I’ll make you this offer:

      I could check out your site. I could then make a tutorial video designed to track what you want to track.

      If you’re interested, just connect with me (https://www.linkedin.com/in/zackduncan) and then send me a message with the specific site you want to track and what specific button click you want to track. You’d also need to give me temporary access to Google Tag Manager. I wouldn’t need publish access so I can’t actually set anything live without your approval. I’ll check it out and if I can confirm that I can do it (which I think I can). The only “cost” would be that you’d need to be willing to have your site serve as an example in a future tutorial blog and / or video.

      Up to you!

      Have a good one.

      Zack

      Reply
  1. Keesjan
    Keesjan says:

    Thanks for the tutorial. Would it not be better to use the external link -build in- parameters and use the build in paramater ‘outbound’ = false? Google recommends to first use recommended events and only if not possible to use your own? Or to I overlook something?

    Reply
    • Zack_Duncan
      Zack_Duncan says:

      Hi Keesjan, thanks for the thoughtful question. I have a 2-part response:

      Part 1: For me, having a separate event for internal clicks vs. external clicks makes my GA4 reports (in Explorations) easier to build and more useful than they would be otherwise. But, that leads to part 2 below…

      Part 2: Full disclosure, I have not tried setting it up the way that you have suggested. If you’ve done this and had good luck with it, please feel to share! I am always up for learning new things, and continue to need to that!

      Thanks!
      Zack

      Reply
    • Zack_Duncan
      Zack_Duncan says:

      Hello! The embedded video for GA4 internal link click tracking should do this for you. You just need to set an event parameter for ‘link_text’ when you create the event in GA4. You’ll also need to register that event parameter as a custom dimension in GA4 after you’re done, so you can see that data in your reports.

      Watch this tutorial first (GA4 event creation): https://youtu.be/sF_KPPhzF-Y

      Watch this video second (registering custom dimensions): https://youtu.be/Gcn_I-xHnvU

      Best of luck to you!

      Reply

Trackbacks & Pingbacks

  1. […] How to set up link click tracking in GA4 (vs. UA) […]

  2. […] were anything like me, you likely set up some GA4 event tags in Google Tag Manager. Maybe it was internal link click tracking or page timer tracking or even a completed form submission. For each event, you set some specific […]

  3. […] for more on Google Analytics, check out this guide on implementing link click tracking and this comparison on GA4 compared to […]

  4. […] by platform comparison of creating event tracking, consider coming back and reviewing this guide to Google Analytics link click tracking in UA vs. GA4 once you have a strong grasp of the basics and setup […]

  5. […] here, have fun exploring and practicing. If you haven’t done it already, consider setting up Google Analytics link click tracking to get deeper insight into your data. And if you have questions or suggestions or your own tips to […]

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published.