Install Google Tag Manager

How to Install Google Tag Manager on WordPress & Shopify

9 min read

Google Tag Manager is one of the most important tools in a marketer’s toolset – and often one of the most overlooked.

One of the best things about Google Tag Manager is that even though it does come with quite the learning curve, it is accessible for most non-technical marketers out there. In other words, even if you’re not code-savvy or are even uncomfortable around code, you can use most of its features – with a little light-reading, that is.

In this post, we’ll teach you how to install Google Tag Manager on your WordPress or Shopify website, in just under 10 minutes.

Let’s get to it.

How to Install Google Tag Manager

Create Your Account & Container

To use Google Tag Manager you’ll need to create an account, and a container.

Each business should create an account and a different container for each domain that belongs to that business.

We’ll dive deeper into what accounts and containers are in our next post.

To do so, head on over to https://tagmanager.google.com and click on the blue “start for free” button, on the top-right corner.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b99a4d59-1604-4d8a-9a30-7c4c2458f427/gtm_create_account.png

The on-screen instructions should be easy to follow, and shouldn’t take more than a minute to fill in.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/1592438e-a07a-4aba-8a1c-d77893f4bbc9/gtm_create_container.png
  1. Add a name to the account.
  2. Choose your country from the drop-down menu.
  3. Add a name to the container you’re about to create.
  4. Select a target platform. Most likely, that will be Web.
  5. Click on “Create”.

We recommend that you name your account after your business, and the container after the domain URL, as in the image above.

Find Your Container Code

Once you’ve created your account and container, you will now need to find and access the container code.

Don’t worry if this sounds a little too technical – it’s a lot simpler than it looks.

To access the container code, click on the “GTM-XXXXX” button as in the image below. You can also access the code in the admin section, under “Install Google Tag Manager”.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/4bba976a-d732-46cf-aaa6-358e6fa34a05/gtm_container_code.png

You can now access two different sections of code that need to be added to your website, before you can start using Google Tag Manager.

In this post, we’ll detail a few different methods on how to add this code to your website on WordpPress, and Shopify.

Even you’re not a developer, if you follow these steps, you’ll be able to add the code in under 10 minutes.

Install Google Tag Manager on WordPress

There are two different methods to install Google Tag Manager on your WordPress website.

The first (and recommended) method is to add the container code directly into the theme editor. To do so, head over to the “Appearance” menu, and then click on “Editor”.

Proceed with caution: make sure to back-up your website, and make changes only to the child-theme.

Once you’ve accessed the theme’s editor, click on the “Theme Header” section in the menu to the right.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/5fc72635-0e41-4e93-837e-3cd180df06aa/theme_editor_header1.png

Paste the first section of the code immediately under the <head> tag, as demonstrated in the image below.

Once that’s done, scroll down until the closing </head> tag and, right under the opening <body> tag, paste the second section of code, and hit the “Update File” button.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/2c3645d7-94a7-41d6-a930-d0123cb2ff18/bodygtm.png

You’re all set!

WordPress Plugin

The alternative method of installation is to use a WordPress plugin.

This is a much faster alternative than the former but comes with a few downsides – which is why we recommend the former alternative.

To name a few

  • Additional add-ons can result in lower website speeds.
  • Less control on the code placed on your website.

There are a lot of alternatives as to which plugin you can use, but we can recommend Google Tag Manager for WordPress by Thomas Geiger.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/d44e07dc-62d6-42aa-9cae-95f5e1f422c6/gtm4wp_e.jpg

To install the plugin, you just need to access the plugin’s settings, and paste the container ID into the correct field.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/bbf6a561-8ab5-40a7-84b3-c174d8733335/gtm4wp_plugin_e.jpg

Click on “Save Changes”, and voila!

Installing on Shopify

To install Google Tag Manager on Shopify, we’ll need to edit the theme’s code so we can add the cotnainer’s code.

You can do so easily by following the instructions below.

Under the “Online Store” menu, click on “Themes” and then on the “Edit Code” button, under the “Actions” tab.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/19d4277b-b4a0-4a9e-bddf-aef7d4f9c055/shopify_editor_instructions.png

Once in the editor panel, find the theme.liquid file from the left sidebar.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a31ae3b8-4a9f-43c8-9d6b-7161683d51af/shopify_liquid.png

Take the second section of the container code from Google Tag Manager, and paste it right under the <body> tag, as in the image below. Click on “Save”.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/6b495819-4e14-4a03-a323-98d61d9227f5/shopify_body_gtm.png

Once you’ve completed the steps, head over to the “Preferences” menu, under “Online Store”, in the left sidebar menu.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/3be4a6a9-9a36-4894-b092-a44e372be41f/shopify_analytics.png

Paste the first section of the container code in the Google Analytics section.

You’re all set!

If you’re using Google Analytics, we recommend you add the code in this section too – and not on Google Tag Manager.

Publishing Your Container

Once you’ve completed the steps above, and before you can validate if your installation was successful, you’ll need to publish the container.

To do so, access your Google Tag Manager dashboard and, in the top-right corner, click on the “Submit” button.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/4b0fd6f4-169e-49a0-9a8b-2af7e168ba2b/submit_gtm.png

Validate Your Installation

Now once all that’s out of the way, how can you make sure the installation was successful?

There are two alternatives to do this.

The Preview Mode

The preview mode is one of Google Tag Manager’s most resourceful features.

Once you’re in Google Tag Manager’s dashboard, to the left of the “Submit” button, there’s an additional “Preview” button.

If you click this button, you’ll access Google Tag Manager’s Preview Mode.

Once you’ve refreshed your website, a panel will appear on the lower part of your screen – which means you have successfully installed Google Tag Manager.

Google Tag Assistant

Google Tag Assistant is a browser extension and it’s very simple to use.

You just need to install the extension and, once it’s activated, click on the icon and hit the enable button below – that gets the Tag Assistant running.

Refresh the page, click on the Tag Assistant’s icon again, and you will see Google Tag Manager appear on the dashboard, next to an icon of a tag.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/cdcc25d7-8f02-4a90-a483-7a38e6a39661/Untitled.png

If the icon next to the tag is green, you’ve successfully installed GTM on your website.

If it’s red, well… you get it.

What’s Next?

Now that you’ve installed Google Tag Manager, it’s time to start reaping the full benefits of this incredible tool.

To do that, you’ll need to understand the basics of Google Tag Manager. For that reason, we’ve written a few posts on the topic.

If you’re interested in learning more, we recommend you read our Google Tag Manager Tutorial.

As you get more advanced, you’ll start digging into variables and the data layer, and that’s where you can unlock some of the amazing features this tool provides.


Did you have any trouble with the installation process?

Let us know in the comments below, or feel free to reach out to us on our contact page – we’re glad to help out.

Make sure you subscribe to our newsletter to receive more content similar to this post on your email. We would be thrilled to keep in touch!

Show CommentsClose Comments

Leave a comment