Google Tag Manager (GTM) is an awesome tool that lets you to easily add tags to your website. With Tag Manager, you can deploy Google Analytics, add pixels, track events, and more. We’ll show you why you should use Tag Manager and how to set it up on a WordPress website.
Why you should use Google Tag Manager
If you’re using WordPress to power your website, Google Tag Manager can help you in a variety of ways. We think it’s a time-saving tool that lets us do a better job of managing digital marketing tasks. GTM can help you reduce the number of plugins you’re using, minimize code changes, and help you scale up digital marketing activities. We use it for many different tasks, including verifying Google Search Console, tracking link clicks, tracking paid campaign conversions, and event tracking. We could list others, but you get the gist.
How to set up Google Tag Manager on a WordPress website
There are a number of components that come together to make Google Tag Manager work. We’ll walk you through creating a Google Tag Manager account, installing GTM on your WordPress website, creating a tag, and publishing the container. You’ll want to make sure you have Google’s Tag Assistant extension, too. Let’s get started.
Create your Google Tag Manager account
- Open a new browser tab and go to https://tagmanager.google.com.
- Log in using your Gmail address. You’ll want to make sure you’re using the same Gmail address used to set up Google Analytics and Google Search Console.
- Fill out the Account Name. We recommend using the business name.
- Select your country of origin.
- Fill in the Container name. This is your domain name.
- Select Web.
- Select Create.
Install Google Tag Manager in WordPress
Once you create a Google Tag Manager account, you’ll be prompted to Install Google Tag Manager:
There are multiple approaches to getting the snippets on your WordPress website.
- Use your WordPress theme’s settings to add the code snippets to the <head> and <body> of your website, or
- Implement snippets using the popular and respected Insert Headers and Footers plugin, or
- Edit header.php directly to add the code snippets.
We’ll show how to add the Google Tag Manager code snippets to header.php:
- Log in to WordPress.
- In your theme files, access header.php.
- Add the code snippets to the <head> and <body> sections, respectively.
- Update the file.
- Go to your website URL.
- Enable Tag Assistant.
- Refresh your browser window and confirm Tag Manager has been installed on your website.
At this point, you’re all set. Google Tag Manager is on WordPress and you can start adding, testing, and deploying tags. Check out the next section if you’re looking for help on adding tags, or more specifically, looking to add Google Analytics to your website using the help of Google Tag Manager.
Create the Google Analytics tag in Google Tag Manager
Tags are code snippets which Google Tag Manager adds to your website for the purposes of tracking events and collecting additional information about visitors. You can create as many as you want.
We’ll walk you through how to add the Google Analytics tag:
- Make sure you’re logged into Google Tag Manager.
- Select New Tag on the Workspace tab:
- Deleted the text “Untitled tag” and give your tag a name. This might be “Google Analytics” or something similar.
Tip: If you think you’re going to add a lot of tags to your website, you may want to keep things organized by using Google Tag Manager naming strategies.
- Select the tag icon under the Tag Configuration section.
- Select Google Analytics tag from the list.
- Make sure the Track Type is set to Page View.
- Under Google Analytics Settings, select New Variable.
- Input your Tracking ID. To get your Tracking ID, go to Google Analytics and navigate to Admin > Property > Tracking Info > Tracking Code.
- Rename the variable to, “Google Analytics Settings”.
- Save the tag.
- Select the trigger icon under Triggering.
- Select the plus (+) symbol in the upper right corner.
- Select Page View > Page View under Choose trigger type.
- Name the trigger.
- Save the trigger.
- Select the trigger.
- Select the Preview button to turn on preview mode.
- Open a new browser window and go to your website.
- Make sure Google Analytics tag is listed under the Tags Fired On This Page section of preview panel, located at the bottom of the browser window.
- Open another browser window and go to your Google Analytics account.
- Go to the Overview under the Realtime section.
- Make sure you can see at least one Pageview. This means you set up the Google Analytics tag correctly, and that traffic is being recorded.
- Go back to Google Tag Manager and select Leave Preview Mode.
- Select the Submit button.
- Enter the Version Name and Version Description.
- Select Publish.
Google Tag Manager can save you time, money, and can help you be more efficient with your digital marketing efforts. Setting up this tool on your WordPress site takes some work, but it also comes with a huge payoff. As you expand your digital marketing activities, think about how Google Tag Manager can help you measure your efforts. If you liked this post, check our blog for more tips. Happy tagging!