Have you ever wondered how many people actually click on the social profiles in your footer? Or how many people click the outbound links you share in your blog posts? Setting up outbound link tracking only takes a few minutes to put in place. Yet, the data can help you better understand what users do on your site.
Step 1: Create Variable
First, we need to setup an auto-event variable that will pull in the URL of the clicked link.
Name: Click URL Hostname
Type: Auto-Event Variable
Variable Type: Element URL
Component Type: Host Name
Optionally, you can choose to have Tag Manager strip www from the hostname.
Step 2: Create Trigger
Next, you will need to create a trigger. The trigger will need to fire when a user clicks a link, but it is not an internal link.
Name: Click Does Not Contain Hostname
Enable When: URL matches RegEx .*
Fires On: URL hostname does not contain domain.com
You’ll want to change doman.com to whatever your domain is.
Step 3: Event Tag
Lastly, we will want to create an event tag that will send the information to Google Analytics. We will track the category as ‘External Link’ and the collect the specific URL they clicked and what page they were on. This is helpful if you have several links on a page or if the link appears on many pages.
Tag Type: Universal Analytics
Tracking ID: ID for GA account you want to send data to.
Track Type: Event
Category: External Link
Action: {{element url}} This will pull in the URL that was clicked
Label: {{url path}} This will tell you the page the user was on when the clicked the link.
Triggering: Outbound Link Click
Step 4: Test and Publish
Using Tag Manager’s preview mode test to make sure everything is working as expected. When you click on an external link you should see that tag move from not fired to fired. Additionally, in Google Analytics, you should see the events recorded. Once you are positive everything works publish the changes in Tag Manager.
That’s it! In a few simple steps, you can start tracking which external links you users are clicking. This data is helpful in determining how visitors use and navigate your site
Comments are closed.