Install Google Tag Manager to Your WordPress Site

google tag manager
  • 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.

Create a Google Tag Manager Account & Generate your Tag

Install Google Tag Manager to Your WordPress Site 1
  • It should take you to the “Admin” section, where you can Click on “+” to add a new or create a new account
Install Google Tag Manager to Your WordPress Site 2
  • Then fill out your information in the “Add a New Account” section:
Install Google Tag Manager to Your WordPress Site 3
  • 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)
Install Google Tag Manager to Your WordPress Site 4
  • 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
Install Google Tag Manager to Your WordPress Site 5
Install Google Tag Manager to Your WordPress Site 6
Install Google Tag Manager to Your WordPress Site 7
  • You are now in your Google Tag Manager Dashboard Tag Manager, and the next step is to go the “Admin” tab section.
Install Google Tag Manager to Your WordPress Site 8
  • Then click “Install Google Tag Manager.
Install Google Tag Manager to Your WordPress Site 9
  • There you can see the code that you need to install on your website.
Install Google Tag Manager to Your WordPress Site 10

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)
Install Google Tag Manager to Your WordPress Site 11
  • 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”:
Install Google Tag Manager to Your WordPress Site 12

Go to “Appearance> Customize”:

Install Google Tag Manager to Your WordPress Site 13

Click on “Header/Footer scripts”:

Install Google Tag Manager to Your WordPress Site 14

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

Install Google Tag Manager to Your WordPress Site 15
  • 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”:
Install Google Tag Manager to Your WordPress Site 16
  • Paste the code in the Theme Editor just underneath the “<head>”

BEFORE

Install Google Tag Manager to Your WordPress Site 17

AFTER

Install Google Tag Manager to Your WordPress Site 18
  • Finally, click on “Update File” at the bottom of the page
Install Google Tag Manager to Your WordPress Site 19
  • Now you should see that “File edited successfully”
Install Google Tag Manager to Your WordPress Site 20

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
Install Google Tag Manager to Your WordPress Site 21
  • Click “Enable” it
Install Google Tag Manager to Your WordPress Site 22
  • 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.
Install Google Tag Manager to Your WordPress Site 23

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!

Leave a Reply

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