Knowing how to track outbound clicks in Google Analytics 4 isn’t going to win you a promotion, but it will certainly aid in making you a better product manager. Suffer along with us as we set up Google Analytics 4 to track outbound clicks on this very website. If you want a deeper dive, consider reading “What is GA4?” to get some better context for this article.
How To Track Outbound Clicks in Google Analytics 4: Setting Things Up
What Does Outbound Click track?
Clicks damn it! Clicks! Oh so you want to know a little bit more than that.
When a user clicks on a link that takes them away from a domain, that is considered an outbound click.
As Google Analytics 4 tracks everything as Events, you can provide more context to these events by making use of parameters, which in the case of an Outbound click event, include the following automatically tracked parameters
- link_classes – This captures the HMTL (CSS) class name of the link that was clicked
- link_domain – This captures the domain name of the outbound click
- link_id – This captures the CSS id of the link
- link_url – This captures the URL of the outbound link
- outbound (boolean) – This is set to “true” to indicate that the link was outbound
When you install Google Analytics 4 on a website, you will need to wait for up to 24 hours to start seeing data in non-real-time reports.
Enable Enhanced Measurement
When you set up your account, make sure you enable “Enhanced Measurement, as seen in the image below.
Finding Click Events
So next up in the adventure we call knowing how to track outbound clicks in Google Analytics 4 is finding the reports.
Using the image below as a guide, you can find the event counts by going to Reports (fuchsia box) > Engagement (red box) > Events (green box). Then in event list, look for the “click” event (purple box).
What the fuck? Where is the data? I thought all this stuff was supposed to be automatic?
So, surprise surprise, there is actually a bit of configuration work to do if you want to find out what outbound links were clicked.
How To Track Outbound Clicks in Google Analytics 4: Configuring Custom Dimensions
Even though GA4 is automatically tracking the URLs that were clicked, they are not available in the reports unless you do additional configuration. You must tell GA4 that you want to start seeing Link URLs in the reports.
Do this by clicking the following items in the interface as seen in the image below: Configure (Red box) > Custom Definitions (Orange box) > Create Custom Dimensions (Blue box).
In the form above you need to fill out the form as follows
Dimension Name: This is what shows up in your reports.
Description: Optional but fill it out anyways to add additional context.
Scope: Make sure event is selected.
Event Parameter: Select “link_url” from the drop down. Please note that this event parameter does process past data, only new data from the moment you created the custom dimension
Click Tracking In Real Time
You can view some click tracking data in real time. From the Real Time Overview view, scroll down and locate the “Event Count” section. In the image below we’ve outlined “Events” in blue and the “click” event is in red.