Select Page

Adding new tracking scripts and pixels to WordPress can be annoying:

  • Copy script
  • Open your theme file
  • Paste code
  • Hope something doesn’t break

Plus, it can be time consuming to debug different scripts and hard to keep track of all the 3rd party scripts you’ve installed.

Thankfully there’s a solution: Google Tag Manager.

And in this guide I’m going to walk you through how to add Google Tag Manager to your WordPress site in under 5 minutes.

Step-by-step guide to install Google Tag Manager on WordPress

1. Log into WordPress

2. Go to Plugins/Add New

3. Search for “tag manager”

4. Install the “Google Tag Manager for WordPress” by Thomas Geiger

Install Google Tag Manager Plugin Log into WordPress Go to Plugins/Add New Search for tag manager Install the Google Tag Manager for WordPress by Thomas Geiger Activat plugin

5. Activate plugin

6. Navigate to Settings/Google Tag Manager from inside your WordPress admin panel

Setup Tag Manager Plugin Click to Settings/Google Tag Manager

7. Open a new tab and head over to https://tagmanager.google.com/

Copy your Tag Manager container id Your id begins with GTM-

8. Copy your Tag Manager container id.¬†Your id begins with “GTM-”

9. Paste your GTM id in to the “Google Tag Manager ID” field inside the “General” tab of the Tag Manager plugin you installed.

Add GTM id into plugin Paste your GTM id in to the Google Tag Manager ID field inside the General tab of the Tag Manager plugin you installed. Select Custom from the container code placement options list Click Save Changes

10. Select “Custom” from the “container code placement” options list

11. Click “Save Changes”

12. Copy the code you see at the bottom of the “Container code placement” section

Copy code Copy the code you see at the bottom of the Container code placement section Click on Appearance/Theme Editor

13. Click on Appearance/Theme Editor

14. Paste code into header.php

Paste code into header.php Find the header.php file from the list of Theme Files on the right-hand side of the page.</p> <p>Scroll down untill you see the opening body tag <body Paste the code you copied in the preview step below the body tag and click Update File

15. Find the header.php file from the list of “Theme Files” on the right-hand side of the page.

16. Scroll down untill you see the opening body tag <body>

17. Paste the code you copied in the preview step below the body tag and click “Update File”

18. Install Tag Asssistant browser extension-

This chrome extension will help you to make sure Tag Manager is installed correctly.

  • Head over to Google and search for “Tag Assistant chrome extension”
  • Click “Add to Chrome”

Install Tag Asssistant This chrome extension will help you to make sure Tag Manager is installed correctly. Search for Tag Assistant chrome extension Click Add to Chrome

 

Optional: Pin the “Tag Assistant” extension to your browser

Pin the Tag Assitant extension to your browser

 

Once installed you’ll be able to see the Tag Assistant extension in your browser.

Click Done

 

Copy your Google Analytics “Tracking ID”

19. Open your Google Analytics account

22. Click on the Property you want to work with

23. Click “Property Settings”

24. Copy your “Tracking ID”

Copy your Tracking ID Open your Google Analytics account Click on the Property you want to work with Click Property Settings Copy your Tracking ID

 

Add new tag in Google Tag Manager

25. Click “Add a new tag” in Google Tag Manager to track your Google Analytics Pageviews

Click on Add a new tag

 

26. Click on “Google Analytics: Universal Analytics”

Click on Google Analytics: Universal Analytics

 

27. Click on “New Variable”

Click on New Variable

 

28. Paste your Google Analytics ID

Paste your Google Analytics ID This ID was copied from your Google Analytics property and begins with UA-

This ID was copied from your Google Analytics property and begins with “UA-”

29. Click on “Triggering” to create a new trigger

Click on Triggering to create a new trigger

 

30. Select “All Pages”

Select All Pages

 

31. Click Save

Click Save

 

32. Click “Submit”

Click Submit

 

33. Add a version name

Add a version name It's good practice to make notes to every change you make to your GA container so that you keep track of what changes were made, why and in case something stops working you can use this to retrace your steps. Then click Publish Next head over to your website click the Tag Assistant chrome extension Click Enable Refresh the page and you will see your Google Tag Manager container in the Tag Assistant along with information about the status each Google tag added to your container.

It’s good practice to make notes to every change you make to your GA container so that you keep track of what changes were made, why and in case something stops working you can use this to retrace your steps.

34. Then click “Publish”

Google Tag Manager is now installed

You should be all done now with the basic installation of Google Tag Manager on your WordPress site. To make sure, open your website in a new tab, click on the “Tag Assistant” chrome extension,¬†Click “Enable”. Then, refresh the page and you will see your Google Tag Manager container in the Tag Assistant along with information about the status each Google tag added to your container.

If you see all green icons in there you are good to go. If not, feel free to leave me a message here and I’ll help you find a solution.

 

More SEO Tips