TRY OUR FULLY SEO-OPTIMIZED WORDPRESS THEME FOR AFFILIATE MARKETERS!

No need to hire SEO experts anymore to fix your site technical SEO issues

IMPROVE YOUR SITES RANKING TODAY

Install Google Tag Manager to Your WordPress Site

by Jay | Posted on December 6th, 2020
  • Execution Time: about 5 minutes
  • Prerequisites: This process only applies to WordPress sites.
  • Why this is important: Google Tag Manager makes it easier for marketers to implement tags or tracking pixels without having to rely on web developers to do it for them.
  • Where this is done: In your WordPress Dashboard and Google Tag Manager.
  • When this is done: After you install WordPress, but also after every theme change.
  • Who does this: The person responsible for managing your website.

Now let’s add some code to your WordPress website

Environment setup:

What is Google Tag Manager?

Google Tag Manager is a free tool that allows you to manage and deploy marketing tags (snippets of code or tracking pixels) on your website (or mobile app) without always having to edit the code of your website.


google tag manager

Create a Google Tag Manager Account & Generate your Tag

  • It should take you to the “Admin” section, where you can Click on “+” to add a new or create a new account
  • Then fill out your information in the “Add a New Account” section:
  • Add a name to your account (Eg: Company Name) and choose your country (1,2)
  • You can decide if You want to share your data with Google (click on “?” for more info)
  • In the “Container Setup” tab choose a name for your container (Eg: www.mysite.com) (3)
  • Next, choose the target platform – in case of Website it will be “WEB” (4)
  • Then click on “Create” (5)
  • Read & Accept “Google Tag Manager Terms of Service Agreement”  and click on “Yes
  • You are now in your Google Tag Manager Dashboard Tag Manager, and the next step is to go the “Admin” tab section.
  • Then click “Install Google Tag Manager.
  • There you can see the code that you need to install on your website.

Select and copy the first part of the code – NOTE Google mentions that you should paste this code as high in the <head> of the page as possible, this is very important as the higher the TAG is in the HTML code, the faster it will load on your website.

Adding Google Tag Manager to your WordPress website

  • Log in to your WordPress Admin Area:
    (Eg: yourblogdomain.com/wp-admin or yourblogdomain.com/wp-login.php)
  • After you log in, go to “Plugins > Add New.” and download a plugin called OrbitFox. We will be using several tools from this plugin, however, at this very moment, you want to enable the “Header Footer Scripts”:

Go to “Appearance> Customize”:

Click on “Header/Footer scripts”:

Add your Google Tag Manager code in here, and click “Publish”

  • You don’t want to add your code to the “Theme Editor” since some of the theme developer might push out an update of their theme and all of the scripts attached to the header.php might get lost. It is safer and easier to add a bunch of scripts using OrbitFox. However, here is how you can add your Google Tag Manager code using the “Theme Editor”:
  • Paste the code in the Theme Editor just underneath the “<head>”

BEFORE

AFTER

  • Finally, click on “Update File” at the bottom of the page
  • Now you should see that “File edited successfully”

Congratulations, you just finished installing Google Tag Manager on your WordPress site

Checking if you install Google Tag Manager correctly

  • Install Tag Assistant (by Google) Chrome Extension
  • After installation, click on the Tag Assistant icons on your Chrome Browser
  • Click “Enable” it
  • Now you should see all your working tags or if they encounter any problems. In the screenshot below, it’s in Yellow because our Google Tag Manager container is empty.

That is it! You’ve installed Google Tag Manager on your WordPress website.

You are now ready for adding more Tags & Tracking Pixels to your site and GTM will make it easier for you!

Jay

I've worked for WooRank, SEOptimer, and working on a cool SEO audit tool called SiteGuru.co. Now I have build Linkilo and SEO RANK SERP WordPress theme. I've been in the SEO industry for more than 5 years, learning from the ground up. I've worked on many startups, but also have my own affiliate sites.

TRY OUR FULLY SEO-OPTIMIZED WORDPRESS THEME FOR AFFILIATE MARKETERS!

No need to hire SEO experts anymore to fix your site technical SEO issues

IMPROVE YOUR SITES RANKING TODAY