For those of you who aren’t familiar with Google Tag Manager, it’s the bee’s knees, the cool side of the pillow, the greatest thing since sliced bread. Google Tag Manager, or GTM is an essential tool for WordPress users looking to implement technical search engine optimization (SEO), implement tracking or analytics pixels, and install marketing tools to their website.
In other words, GTM allows anyone to make significant changes to their website without having a four-year degree in computer programming. But before you can start harnessing the power of GTM, first you need to install it to your WordPress website. Here are the basic steps–click in for more detail.
1. Create a Google Tag Manager account
2. Install the Insert Headers and Footers WordPress plugin
3. Copy your GTM code snippets and paste into the header and footer
1. Create a Google Tag Manager Account
First you need to create a tag manager account for your website.
2. Install the Headers and Footers WordPress Plugin
After you’ve signed in and created your account with your website details, a box will pop up with your GTM implementation code. Keep this tab open and ready to go because you’ll need to copy and paste this code.
If you don’t see the pop up with your GTM code, you can click on your GTM container ID at the top of your account to access the implementation code.
Now, the easiest way to install this code to your website is with a WordPress plugin called Insert Headers and Footers. This is a very useful plugin created by a great resource on all things WordPress called WP Beginner.
Now that you have access to your code, install the Insert Headers and Footers plugin.
3. Copy and Paste GTM Code Into the Header and Footer
Once installed, navigate to settings > insert headers and footers. Access the tab with your GTM code, and paste the first section into the first text box of the plugin labeled, Scripts in Header.
Next, copy the second GTM snippet and paste it into the lower section of the plugin labeled, Scripts in Footer.
And just like that, GTM has been installed to your WordPress site!
4. Create a Google Analytics Tag
Now that we have Google Tag Manager installed to your WordPress website, lets set up your Google analytics tracking.
Tag Manager comes with prefixed tag solutions ready for deployment, so all you need is your corresponding ID for that system or tool.
In the left sidebar navigation of your GTM container go to Tags and create a new tag. Name your tag something appropriate like, “Your Website’s Google Analytics Tag,” and click into the Tag Configuration box.
From here, choose the Universal Analytics tag and click the Google Analytics Settings dropdown to input your UA tracking ID. You can locate your UA ID through your Google Analytics Account.
Next, create a new variable and input your Google Analytics ID. Name this variable ‘GAID’ and leave the cookie domain as auto. Then save your variable.
After that, we’ll define the triggering for our tag. Because we want to track all pages of our website, we’ll set our analytics tag to be present on every page. Define your triggering as All Pages and save your tag.
5. Confirm and Publish Your Tag
Note that once you’ve finished creating and saving your tag, GTM will not deploy the code until you publish the tag.
GTM has a preview mode where you can verify the tag is working properly before final deployment.
Click Preview in the upper left hand corner of your container and navigate to your website in a new tab. You may have to refresh the page in order for the preview mode to activate.
After you’ve confirmed that the tag is working correctly through the preview and debug option in GTM, go ahead and publish/submit your tag.
Your Google Analytics is now set up through Google Tag Manager and will now start collecting your website’s traffic data.