GTM & GA: Track all outbound links with one tag

We already did download tracking with one tag - now let's use the same principles to set up outbound link tracking.

Step 1: Enable default variables.

We'll use the same default variables that we used for downloads, so if you've already set that up, you're all set. If not, enable {{Click URL}} and {{Click Text}}.

Step 2: Set up the GA tag.

Let's think about how this should look in GA:

  • Event Category:outbound linksThis value can be hard-coded in - the other two are dynamically populated by variables.

  • Event Action: Similar to downloads, the destination URL of the outbound link{{Click URL}} contains this value - easy peasy.

  • Event Label: Exactly like with downloads, I like to put the text of whatever the user clicked here{{Click Text}} fits the bill for this one.

With everything set up, it looks like this:

outbound_tag.png

Step 3: Create and apply the Trigger.

We're going to go with the simplest setup for outbound links for now - we want to track:

  • ...every time the user clicks...

  • ...on a link...

  • ...that does not point to mydomain.com

This is it:

outbound_trigger_mydomain.png
 

In a later post, I'll get into some nuances there, but that should work in most cases. Obviously you'll replace "mydomain.com" with whatever your domain is.

Step 4: Preview & Publish.

Obviously.

Step 5: See data in GA!

Here, I'm looking at the Behavior > Events > Top Events report. I clicked into the "outbound links" category, and I'm viewing the Event Action:If you want to know where these clicks occurred, just add "Page" as a Secondary Dimension.

outbound_events.jpg
Previous
Previous

GTM & GA: 50 ways to build a trigger

Next
Next

New painting: Polygons (7&8)