How to track outbound links in Google Analytics & GA4

Last Updated: December 31, 2022

In this article, I will show you how to track outbound links (also known as outbound clicks or external links) via GA4 and GA3 (Universal Analytics).

Through the GA4 outbound links tracking feature, you can track clicks on external links in your GA4 property without any additional code or tagging.

External links (also known as ‘Outbound links‘) are links to other websites from your website.

An external link is a URL that, when clicked, takes a user from one web page to another web page, and both the source and destination web pages are hosted on different websites/domains.

For example, a link to your Linkedin profile from your ‘about us’ page is an external link.

Note: Outbound links tracking is also known as exit tracking.

Once you have enabled Enhanced Measurement Tracking in your GA4 property, whenever a user clicks on an external link on your website, GA4 fires an event called ‘click‘.

click event ga4

This event is captured along with the ‘link url‘.

The ‘Link URL’ is a GA4 dimension that reports the external link clicked by a user.

link url dimension ga4

Note: The external Links configured for cross-domain tracking will not trigger outbound click events.

If you are an affiliate, you would like to know how much traffic you are sending out to other websites.

You would like to know which external links are clicked by your website users.

If your website links out to your social media profiles, you would like to know which social media profiles are visited by your website users:

follow optimizesmart 2

Let us suppose you own two websites linking out to each other.

You would like to know how many users navigated between the two websites.

You can get answers to all these questions by implementing outbound links tracking.

Your website or landing pages need to have one or more external links for the outbound links tracking to work.

GA4 (Google Analytics 4) automatically tracks outbound links once the enhanced measurement tracking is enabled. However, finding the outbound links data is a bit tricky.

GA3 (Universal Analytics) does not automatically track outbound links. You would need to use Google Tag Manager to set up outbound links tracking.

Follow the steps below:

Step-1: Navigate to your GA4 Property. 

Step-2: Click on the ‘Admin’ link in the left-hand side reporting menu:

ga4 admin

Step-3: Click on ‘Data Streams’ under the ‘Property’ column:

data streams ga4

Step-4: Click on the web data stream for which you want to set up outbound links tracking in GA4:

select web datastream ga4

Step-5: Make sure that the ‘Enhanced Measurement’ setting is enabled:

enhanced measurement ga4

Step-6: Click on the gear button under ‘Enhanced measurement’ to access the settings menu:

settings enhanced measurement ga4

Step-7: Click on the toggle button next to ‘Outbound Clicks‘ and then click on the ‘Save‘ button:

outbound clicks ga4

There are two ways you can see the data related to outbound clicks in GA4:

  1. Through the ‘Events’report
  2. By creating an exploration report.

How to find outbound clicks data in GA4 through the ‘Events’ report

Follow the steps below:

Step-1: Once you have enabled the outbound clicks tracking in your GA4 property, wait for at least 24 hrs to gather outbound clicks data in your reports.

Step-2: Navigate to Reports > Engagement > Events

events report in ga4

Step-3: Type ‘click‘ in the search box and then press the enter key:

click event ga4 2

Step-4: Click on the event name ‘click’:

click on click

You should now see the detailed report for the event ‘click’:

detailed report event click

How to find outbound clicks data in GA4 by creating an exploration report

Follow the steps below:

Step-1: Click on the ‘Explore’ link from the left-hand side navigation bar in your GA4 property:

explore ga4

Step-2: Click on the ‘Blank’ exploration report template:

click on blank exploration report ga4

Step-3: Name your report ‘Outbound Links Tracking’:

outbound links tracking ga4

Step-4: Set the date range to the last 30 days:

date range last 30 days

Step-5: Click on the + button next to ‘DIMENSIONS‘:

add dimensions

You will now see a screen like the one below:

select dimensions ga4

Step-6: Search for the ‘Event Name’ dimension and then click on the checkbox next to it:

event name dimension

Step-7: Search for the ‘Link URL’ dimension and then click on the checkbox next to it:

link url dimension

Step-8: Click on the ‘Import’ button to import all the selected dimensions to the report:

import dimensions ga4

You should now see all the imported dimensions listed under the DIMENSIONS section:

imported dimensions ga4

Step-9: Click on the + button next to METRICS:

add metrics ga4

Step-10: Search for the ‘Event Count’ metric and then click on the checkbox next to it:

event count metrics ga4

Step-11: Click on the ‘Import’ button to import the selected metric to the report:

import metrics ga4

You should now see the imported metric listed under the METRICS section:

imported metrics ga4

Step-12: Double-click on the dimension ‘Link URL’ so that it is automatically added to the ‘ROWS’ section:

double click dimension ga4

Note: When you double-click the dimensions, you won’t see any change to the canvas on the right. But the dimension has been added to the canvas. When you start adding metrics to the canvas, you will see the dimension(s) added to the canvas.

Step-13: Double-click on the ‘Event Count’ metric so that it is automatically added to the blank canvas on the right:

double click metric ga4

Step-14: Scroll all the way down under the ‘Tab Settings’ column until you see the section called ‘FILTERS’:

filters ga4

Step-15: Click on ‘Drop or select dimension or metric’:

drop or select dimension or metric ga4

Step-16: Click on the ‘Event Name’ dimension from the drop-down menu:

select event name dimension

Step-17: Click on the ‘Select match type’ drop-down menu:

select match type

Step-18: Click on ‘exactly matches’:

exactly matches

Step-19: Click on the ‘enter expression’ text box:

enter expression for ga4 filter

Step-20: Type ‘click’ in the text box and then click on the first search result ‘click‘:

click

Step-21: Click on the ‘Apply’ button to apply your filter to the canvas on the right:

apply filter ga4

Step-22: Click on ‘Drop or select dimension or metric’:

drop or select dimension or metric

Step-23: Click on the ‘Link URL’ dimension from the drop-down menu:

select link url

Step-24: Select match type to ‘begins with‘, enter ‘http‘ as the filter expression and then click on the ‘Apply‘ button:

second filter ga4

You should now see a screen like the one below:

outbound links tracking report ga4

That’s how you can see the outbound clicks data via the exploration report. 

If you use Google Tag Manager for your analytics implementation, setting up outbound link tracking is very easy.

This method is the most recommended since you do not need to write any code for every outbound link. 

Imagine you have more than ten outbound links on your website.

If you are not using Google Tag Manager, you will need to add code for every link using the ‘onclick’ function and additional analytics script. 

To track outbound links using Google Tag Manager, you must carry out the activities below.

  1. Create an auto event variable
  2. Create a trigger
  3. Create a tag
  4. Debugging and validation

Creating an auto event variable

The first thing to do is to create an auto event variable which is nothing but a variable that captures information about the link click and returns true if it is an external link (outbound), else it returns false if it is an internal link.

Follow the below steps to create an auto event variable.

Step-1: Navigate to your GTM container and click on ‘Variables’.

Variables tab

Step-2: Now scroll down and click on ‘New’ under ‘Use-Defined Variables’.

user defined variable

Step-3: A new window will pop up like below. Give it a proper name and click on ‘Variable Configuration’.

variable name

Step-4: Click on ‘Auto-Event Variable’ from the variable configuration list.

auto event variable

Step-5: Now click on the drop-down under ‘Variable type’ and select ‘Element URL’

element URL

Step-6: Now click on the drop-down under ‘Component type’ and select ‘Is Outbound’.

component type

Step-7: You need to provide the list of ‘Affiliated Domains’.

Affiliated domains here refer to the list of your internal domains.

If you want to add other domains as internal, you can add them here as a comma-separated list.

The variable will return true if the URL does not match the current page’s domain or the list provided in affiliated domains. 

Note: The auto event variable by default considers subdomains as external, so if you want to add your subdomains as internal, you need to specify it in the ‘Affiliated domains’ list (for example, blog.example.com).

affiliated domains

Step-8: Now click on ‘Save’.

save variable

Now the next step will be to create a trigger.

Creating a trigger

Follow the below steps to create a trigger for tracking outbound links

Step-1: Click on the ‘Triggers’ menu.

triggers menu

Step-2: Click on the ‘New’ button.

new trigger button

Step-3: Give your trigger a valid name and click on ‘Trigger Configuration’.

trigger name

Step-4: Select the ‘Just Links’ trigger type.

trigger type

Step-5: A new configuration window will appear like below. Select the radio button ‘Some Link Clicks’

trigger configuration some link clicks

Step-6: Now select the auto event variable we created earlier from the first drop-down under the condition.

select aauto event variable

Step-7: Select the ‘equals’ operator in the second drop-down and type ‘true’ in the input box provided.

triigger equals true

Step-8: Your final trigger will look like the below. Click on ‘Save’

save trigger

Now, let’s move to creating a tag for tracking outbound links.

Creating a tag

Follow the below steps to create a tag for tracking outbound links.

Step-1: Click on ‘Tags’ in the left-hand side menu.

tags

Step-2: Click on ‘New’.

new tag

Step-3: Give a proper name to your tag and click on ‘Tag Configuration’.

tag name

Step-4: An overlay will appear on the right-hand side with a list of tag templates. Select ‘Google Analytics: Universal Analytics’. 

select google universal analytics

Step-5: Click on the ‘Track Type’ drop-down and select ‘Event’.

track type event

Step-6: Now under ‘Event Category’ type ‘Outbound Link Click’.

event category

Step-7: Now click on the plus (+) button next to ‘Action’. 

event action plus button click

Step-8: Select the ‘Click Text’ variable as an event action. This will provide us with details about what text was clicked when the user was leaving the website.

click
click text applied

Step-9: Now click the plus (+) button next to ‘Label’ and select the ‘Click URL’ variable. 

click url

Step-10: Now select the Google Analytics settings variable.

settings variable

Step-11: Click on the ‘Triggering’ option below the tag configuration.

add trigger

Step-12: Now select the trigger that we created earlier.

select trigger


Step-13: Click on ‘Save’.

save 1

Congratulations!

You have successfully set up outbound link tracking. Now it’s time to check the implementation.

Debugging and Validation 

Follow the below steps to debug and validate the implementation.

Step-1: Click on the ‘Preview’ button (on the top right-hand side) in Google Tag Manager.

preview

Step-2: A new window will open with Google preview mode. Add the URL of your website where external links are present and click on ‘Start’.

add url and click on start


Step-3: Another new window will open with the specified URL.

Now click on any of the external links and navigate back to the preview window of Google Tag Manager. You should see the outbound link click tag has fired. 

As an example, I have created an external link to Facebook, and we will test that here.

tag fired

You can click on the tag to see more details. 

Tag Details

track outbound links in Google Analytics

Firing Triggers

firing triggers


Step-4: Now click on any of the internal links and validate if the outbound link tag fires. 

While creating the auto event variable, it should not fire on any of the internal links or the list of domains that we provided in the ‘Affiliated domains’.

internal link click not fired


You can further check the firing trigger to validate.

As you can see in the below image, the auto event variable is not true (since it’s the internal link click); hence, the tag did not fire. 

auto event false

So this is how you can debug and validate the outbound link tracking events.

You can further log in to Google Analytics and check it in ‘Real-time’ reports as well.

real time

Once you have published your container, you will start recording the outbound link click events.

You can check it under Behavior > Events > Top Events.

events reports in GA

#1 Google Analytics 4 Intro

  1. What is GA4 (Google Analytics 4) – The Apps + Web Property?
  2. Key Benefits of Using Google Analytics 4 (GA4)
  3. Setup GA4 – Upgrade to GA4 – Implementation Guide
  4. Google Analytics 4 (GA4) vs Universal Analytics – What is the Difference?
  5. GA4 vs GA4 360 – Pricing, Limits, Billing and More
  6. Google Analytics 4 Training & Tutorial with FREE GA4 ebook

#2 Google Analytics 4 Property

  1. Google Analytics Account Hierarchy (Structure Explained)
  2. Understanding Google Analytics Measurement ID (GA4)
  3. Google Signals GA4 – See Demographics (Gender, Age) in Google Analytics 4
  4. Using the GA4 (Google Analytics 4) Test Property
  5. Google Analytics 4 Sub Properties Tutorial
  6. Roll up Property in Google Analytics 4 (GA4) – Tutorial

#3 Google Analytics 4 Integrations

  1. How to connect GA4 (Google Analytics 4) with Google Data Studio
  2. How to link GA4 (Google Analytics 4) with Google Ads
  3. How to link Google Search Console to Google Analytics 4 (GA4)
  4. How to Install Google Analytics 4 on Shopify
  5. GA4 Firebase Integration – Correctly Add App Data Streams to GA4 Property

#4 Google Analytics 4 Events

  1. GA4 (Google Analytics 4) Event Tracking Setup Tutorial
  2. Understanding Event Parameters in Google Analytics 4 (GA4)
  3. Recommended Events in Google Analytics 4 (GA4)
  4. Enhanced Measurement Events in Google Analytics 4 (GA4)
  5. Automatically Collected Events in Google Analytics 4 (GA4)
  6. How to Set Up GA4 Custom Events via Google Tag Manager
  7. Events Report in Google Analytics 4 (GA4)
  8. How to Rename Events in Google Analytics 4 (GA4)
  9. How to Use Google Analytics 4 Event Builder
  10. GA4 Form Interactions Tracking – Enhanced measurement

#5 Google Analytics 4 Conversions

  1. Google Analytics 4 Conversion Tracking Guide – GA4 Goals
  2. How to Import Conversions from GA4 Property to Your Google Ads account
  3. GA4 Conversion Rate – How to find it and use it

#6 Google Analytics 4 Dimensions

  1. GA4 (Google Analytics 4) Dimensions Tutorial
  2. GA4 (Google Analytics 4) Custom Dimensions Tutorial
  3. GA4 User Properties (User Scoped Custom Dimensions) – Tutorial
  4. Event Scoped Custom Dimensions in GA4 – Tutorial

#7 Google Analytics 4 Metrics

  1. GA4 (Google Analytics 4) Metrics Tutorial with Free Google Analytics 4 Ebook
  2. GA4 (Google Analytics 4) Custom Metrics Tutorial
  3. What are Predictive Metrics in Google Analytics 4 (GA4)

#8 Google Analytics 4 Ecommerce

  1. GA4 (Google Analytics 4) Ecommerce Tracking via GTM – Tutorial

#9 Google Analytics 4 Specialized Tracking

  1. GA4 (Google Analytics 4) Enhanced Measurement Tracking Tutorial
  2. Cross Domain Tracking in GA4 (Google Analytics 4) Setup Guide
  3. GA4 Site Search – Tracking Site Search in Google Analytics 4
  4. GA4 (Google Analytics 4) Scroll Tracking Tutorial
  5. Self-referral Google Analytics 4 – Referral exclusion GA4
  6. GA4 (Google Analytics 4) Data Import Tutorial
  7. Google Analytics 4 Content Grouping – Create Content Groups in GA4
  8. How to Track Single Page Apps in Google Analytics 4 (GA4)
  9. utm_source, utm_medium, utm_campaign Parameters – GA4 (Google Analytics 4)
  10. GA4 Form Tracking via Google Tag Manager

#10 Google Analytics 4 filters

  1. GA4 filters – Understanding Data Filters in Google Analytics 4
  2. How to Create and Test Filters in Google Analytics 4 (GA4)?
  3. Exclude Internal Traffic in GA4 (Google Analytics 4) via IP Filter

#11 Google Analytics 4 Explorations

  1. Free Form Report in GA4 (Google Analytics 4) – Exploration Report
  2. How to Use the User Lifetime Report in Google Analytics 4 (GA4)
  3. How to Use Path Exploration Report in GA4 (Google Analytics 4) – Path Analysis
  4. How to Use Segment Overlap Report in Google Analytics 4 (GA4)
  5. How to Use the Funnel Exploration Report in GA4 (Google Analytics 4) – Funnel Analysis
  6. Cohort Exploration Report in Google Analytics 4 (GA4)
  7. How to Create Landing Pages Report in GA4 (Google Analytics 4)
  8. How to Create Google Ads report in GA4 (Google Analytics 4)
  9. How to Segment GA4 Data by Data Stream
  10. Organic Search Traffic Analysis in GA4 – Complete Guide
  11. Google Analytics 4 (GA4) Outbound Links Tracking
  12. How to Track Email Campaigns and Traffic in GA4 

#12 Google Analytics 4 Advanced

  1. Understanding Google Analytics 4 Sessions
  2. GA4 (Google Analytics 4) Measurement Protocol Tutorial
  3. How to Build Comparisons (Advanced Segments) in Google Analytics 4 (GA4)
  4. Understanding Automated Insights in Google Analytics 4 (GA4)
  5. Understanding Channel Groupings in Google Analytics 4 (GA4)
  6. Understanding Data Sampling in Google Analytics 4 (GA4)
  7. Google Analytics 4 Regex (Regular Expressions) Tutorial

#13 Google Analytics 4 Reports

  1. How to Create Custom Insights in Google Analytics 4 (GA4)
  2. How to Use Debug View Report in Google Analytics 4 (GA4)

#14 Google Analytics 4 Attribution

  1. Guide to Attribution Models in GA4 (Google Analytics 4)
  2. How to Change Attribution Models in GA4 (Google Analytics 4)?
  3. GA4 (Google Analytics 4) Conversion Paths Report in Attribution
  4. GA4 (Google Analytics 4) Model Comparison Report in Attribution
  5. Advertising Snapshot in GA4 (Google Analytics 4) Attribution
  6. GA4 Attribution Modelling Tutorial

#15 Google Analytics 4 Audiences

  1. GA4 Audiences – Creating Custom Audience in Google Analytics 4
  2. How to Create a Remarketing Audience in Google Analytics 4 (GA4)
  3. Understanding Audience Triggers in Google Analytics 4 (GA4)
  4. Google Analytics 4 (GA4) Predictive Audiences – Tutorial

#16 Google Analytics 4 BigQuery

  1. GA4 BigQuery – Connect Google Analytics 4 with BigQuery
  2. BigQuery GA4 Schema – Send Custom GA4 Data to BigQuery
  3. How to Backfill GA4 Data in BigQuery
  4. How to Connect and Export Data from GA4 to BigQuery

What is an outbound link?

An outbound link is also called an external link. It is a link from your website domain to a different website domain. For example, if your website domain is ‘abc.com’, then all the links that do not contain the ‘abc’ domain will be considered outbound links.

Why is tracking outbound links in Google Analytics important?

While browsing the website, a user may come across multiple outbound links, and he might click on them and leave the website. Tracking the outbound link clicks is very important to know the user behaviour and how they leave the website. 

Perhaps they might be clicking on external links like your own social media pages or other domains that you own.

How to track outbound links using Google Tag Manager?

To track outbound links using Google Tag Manager, you need to follow the below steps:

1. Create an auto-event variable in Google Tag Manager with ‘Variable type’ as ‘Element URL’, ‘Component type’ as ‘Is Outbound’ and a list of ‘Affiliated domains (domains you own)’. 

2. Create a trigger with ‘trigger type’ as ‘Clicks-Just Links’, and in condition, add the ‘Auto-Event Variable’ equals to ‘true’.

3. Create a tag with ‘tag type’ as ‘Google Analytics: Universal Analytics’, ‘track type’ as ‘Event’, then add ‘Event Category’ as ‘Outbound Link Click’, ‘Event Action’ as ‘Click Text’ variable, and finally ‘Event label’ as ‘Click URL’ variable.

4. Save the tag and click on the preview to debug and validate,

5. Once verified, you can publish the container.

Register for the FREE TRAINING...

"How to use Digital Analytics to generate floods of new Sales and Customers without spending years figuring everything out on your own."



Here’s what we’re going to cover in this training…

#1 Why digital analytics is the key to online business success.

​#2 The number 1 reason why most marketers are not able to scale their advertising and maximize sales.

#3 Why Google and Facebook ads don’t work for most businesses & how to make them work.

#4 ​Why you won’t get any competitive advantage in the marketplace just by knowing Google Analytics.

#5 The number 1 reason why conversion optimization is not working for your business.

#6 How to advertise on any marketing platform for FREE with an unlimited budget.

​#7 How to learn and master digital analytics and conversion optimization in record time.



   

My best selling books on Digital Analytics and Conversion Optimization

Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.

Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.

Attribution Modelling in Google Analytics and BeyondSECOND EDITION OUT NOW!
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.

Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.

About the Author

Himanshu Sharma

  • Founder, OptimizeSmart.com
  • Over 15 years of experience in digital analytics and marketing
  • Author of four best-selling books on digital analytics and conversion optimization
  • Nominated for Digital Analytics Association Awards for Excellence
  • Runs one of the most popular blogs in the world on digital analytics
  • Consultant to countless small and big businesses over the decade

Learn and Master Google Analytics 4 (GA4) - 126 pages ebook

X
error: Alert: Content is protected !!