Back to top

Affiliate Link: Looking to Monetize With Ads?? We Personally Use:

Ezoic

Enable Google Analytics Outbound Event Tracking Through GTM

Featured Tiles
As an Amazon Associate we earn from qualifying purchases made on our website. If you make a purchase through links from this website, we may get a small share of the sale from Amazon and other similar affiliate programs. You can read our complete legal information for more details.

Like many people it is very nice to know which external links are the most popular on your site. This method through Google Tag Manager (GTM) is entirely free instead of paying for “advanced” accounts on plugins like Monster Insights.

What you Need:

  • Google Analytics Account Code – (UA-XXXXXXXXX-X)
  • Google Tag Manager Account – Here

Steps To Configure GTM

  1. Build an Account In GTM
  2. Build A Container in GTM
  3. Import JSON Tracking Script – Download – Right Click Save As
  4. Add Google Analytics Tracking ID Variable
  5. Publish To Live

Build An Account In Google Tag Manager (GTM)

Sign Into GTM with your Google Account – Click on Create Account

Add The Account and Container Details (Similar to screenshot)

Click Create

Agree With The Terms Of Service

You will get 2 Codes Once Completed, Install HFCM plugin (Search HFCM there is a single match)

In HFCM -> Add Snippet -> Name Google GTM Header Code -> Make sure set to run in Header -> Paste in the <head> code

In HFCM -> Add Snippet -> Name Google GTM Footer Code -> Make sure set to run in Footer -> Paste in the <body> code

Click OK to close out the code

Import JSON Container

Now you will need that JSON file you downloaded above and saved to your desktop or other location

Click on Admin -> Container -> Import

  • Select File -> JSON from above
  • Workspace -> Existing
  • Import Option -> Overwrite

Next You Will See A Confirmation (Click Confirm)

Adding Google Analytics Tag

  • Click Variables From Left Menu
  • Click [ NEW ]

In the top right where it has [ untitled ] paste this text

YOUR_GA_TRACKING_ID

This isnt your UA code, just paste exactly the bolded text

Click on Variable Type [ Select Constant ] (Towards bottom on right)

In [ Value ] paste your UA code from Google Analytics

Click Save

Click Submit

Name The File [ My External Tracking Code ]

Click [ Publish ]

You are done it should show this screen, then you can close out of GTM

Hopefully this helps you start to track external links to Amazon and left you see what links are the most utilized on your site.

About Josh Koop

Hey Everyone! I hope that the short article you read today has taken you from a place of frustration to a place of excited anticipation for your visitors! Please let me know of anything you need for Acabado that can help you achieve your goals!
Read More About Me...

My Posts | Website

Josh Koop

Hey Everyone! I hope that the short article you read today has taken you from a place of frustration to a place of excited anticipation for your visitors! Please let me know of anything you need for Acabado that can help you achieve your goals!
Read More About Me...

5 thoughts on “Enable Google Analytics Outbound Event Tracking Through GTM

  1. My Google Analytics doesn’t appear to be working. I have tried entering 9 digits after the UA and also 9 digits plus 1 digits. Neither configuration works. Any ideas? The Acabado theme Acabado Settings>SEO section just asks for the 9 digits. Please see the text below copied from the Google Analyics Code section of the Acabado SEO Settings page.

    “Just enter the Google Analytics code (ie. UA-XXXXXXXXX). The script will automatically be included.”

    1. Never mind, I think I figured it out. I needed to add the UA. Thank you. SharePostt.com

      One other thing I have noticed though is when I make changes to my site and update them in WordPress, the changes don’t show in my browser. Not sure why this is. I tried purging all caches in W3TC plugin.

      Although, to be more accurate, the changes take a few minutes to show up. I guess that’s okay. Although other themes have changes that are more instant. Thx.

      1. 🙂 Showing traffic should be real-time once the code takes effect, you can always tell Analytics to send a fake visitor and look to see it change to 1.

        Awesome job!

  2. Is there a way to cross-reference what type of link they are clicking? IE image or a text link? Or really to know which exact link it is that was clicked?

    1. Inside the events you can view the link text associated with the link itself. So as long as you keep that text aligned then you can see the link text. Then would think you would correlate that to exit pages to let you know where they left from.

Leave a Reply

Your email address will not be published. Required fields are marked *

Recent Content