Where to add Google Analytics Tag Manager code?

So I have my Google Analytics account connected through the Dashboard, but apparently that only tracks incoming traffic and I can’t track outgoing links unless I add some code for their Tag Manager.

So where exactly would I want to add this code so I can start to track a handful of important links?

Google Tag Manager says:

Add the tag directly to your site

If you have added the Analytics tag directly to your site, you can copy and paste the script below into your own pages to set up Event measurement for outbound links. You should add this script in your page header, but not within the basic Analytics tag.

If you copy and paste this script exactly as it appears here, your outbound clicks will appear in your Analytics Events reports with a Category of “outbound” and an Action of “click”. (In the snippet, these are shown in bold .) You can use these values, or change them and define your own values.

You’ll also need to add (or modify) the onclick attribute to your links. Use this example as a model for your own links:

Check out example.com

So what file do I want to modify to globally track the links I’ll specify within that piece of code?

I should only have to add this to one place to track them globally right?

Here’s the example that code hotlinked:

<a href="http://www.example.com" onclick="captureOutboundLink('http://www.example.com'); return false;">Check out example.com</a>

I was going off of this tag page:

https://support.google.com/analytics/answer/1136920?hl=en

But then it mentions something about a Global site tag on this page:

https://support.google.com/analytics/answer/1008080#GA

Hi John,

Thanks for reaching out.

Regretfully, implementing 3rd party like Google Tag Manager to your website is outside the scope of our theme support. You may seek 3rd party developers to help you with your problems or you can avail One where we can answer questions outside of the features of our theme.

Hope that helps and thank you for understanding.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.