Home » Digital Marketing Tutorials » How to Install Google Tag Manager on a WordPress Website

How to Install Google Tag Manager on a WordPress Website

In this tutorial, I’m going to cover how to install Google Tag Manager on a WordPress website.

What is Google Tag Manager and Why Should I Install It on My WordPress website?

Google Tag Manager was created to streamline the following tasks:

  • Adding various tracking scripts to a website (Google Analytics, re-marketing/retargeting pixels for Google Adwords, Facebook, LinkedIn etc.)
  • Updating and changing any software that is deployed on your website using JavaScript such as live chat applications.

In addition to streamlining the use of different code snippets on your website, Google Tag Manager also reduces the overall size and loading times of your site.

Because there is only one Google Tag Manager container to load in, all of the extra scripts don’t have to be downloaded and run over your website. This results in a small overall footprint and faster loading times for your website.

As you always want to ensure an ideal load time of 3 seconds or less on your website, having a small file size is a huge benefit.

What Do I Need to Install Google Tag Manager on my Site?

Some of the pre-requisites we recommend are:

Now that all of the pre-requisites are taken care of, let’s go ahead and get started installing Google Tag Manager on our WordPress site.

Google Tag Manager Account Creation

Add a New Google Tag Manager Account
Add a New Google Tag Manager Account
  1. Head over to Google Tag Manager, sign into your Google account and click “Create Account”.
  2. Choose an account name – like your company name.
  3. Choose your country.
  4. Name you container – use your website address for this.
  5. Under “Where to Use Container” choose “Web”.
  6. Click “Create”.
  7. Agree to ToS Agreement.

How to Install Google Tag Manager Code into Your WordPress Website

Google Tag Manager Javascript Code
Google Tag Manager Javascript Code
  1. Grab head code and copy.
  2. Go to your WordPress website and login to your dashboard.
  3. Find where your header and footer scripts are added – this is usually in Appearance => Customize => Theme Settings => Header/Footer Scripts
WordPress Header & Footer Scripts
WordPress Header & Footer Scripts
  1. Copy head code into “Header Scripts”.
  2. Copy body code into “Footer Scripts”.

Testing Our Google Tag Manager Install on Our WordPress Site

  1. Go back to Google Tag Manager.
  2. Click on the “Preview” button.
  3. Go back to your WordPress website.
  4. Refresh the page.
  5. The Tag Manager will appear at the bottom of the browser window.
  6. If it’s installed correctly you’ll see a GTM ID over on the bottom right corner.
  7. Click on the “Data Layer” tab and look for Window Loaded, Dom Ready, Page View events listed there.

Testing Using The Tag Assistant Extension in Google Chrome

Install Google Tag Assistant Chrome Extension
Install Google Tag Assistant Chrome Extension

We can also test our Google Tag Manager installation by installing the Tag Assistant extension in Google Chrome.

To install this extension:

  1. Open your Chrome web browser.
  2. Go to Window => Extensions.
  3. Click the hamburger menu icon on the top left to roll out the options menu.
  4. At the very bottom of this menu choose “Open Chrome Web Store”.
  5. Search for “Google Tag Manager
  6. Go to Tag Assistant (by Google) and click blue “Add to Chrome” button to install.
  7. Click Tag Assistant button on your website in your chrome extensions bar.
  8. Click “Enable” and refresh your page again.
  9. Google Tag Assistant will show Google Tag Manager in list if it’s installed correctly.

Final Steps to Install Your New Google Tag Manager Container

Publish Google Tag Manager Container
Publish Google Tag Manager Container
  1. Return to your container on your Google Tag Manager account.
  2. Click “Submit” blue button in right corner.
  3. Enter a Version Name
  4. Enter a Version Description
  5. Click blue “Publish” button in top right corner.

Congratulations! You’ve successfully created a Google Tag Manager account and installed it in your WordPress website.

In the next video we will look at how to install the Google Analytics Tag to our Google Tag Manager to track the activity on your website!

Please let me know if you have any questions or comments below, I’d be happy to answer them.

Thank you for watching and I’ll see you on the next one!

>