If you have never used Google Tag Manager you are in for one big surprise. By adding a small snippet of code to your WordPress installation, you can save yourself time and headaches by removing a whole bunch of unnecessary plugins from your site.
What is Google Tag Manager?
Google Tag Manager is a free tool that Google designed that allows you to insert and manage all sorts of code snippets into your website without having to tear apart and rewrite half your site.
Google made this tool in order to easily add all sorts of tracking codes to your site, but they did not limit it to Google products.
With Google Tag Manager, you can easily add tracking codes from Facebook, Google AdWords, Google Analytics, Mautic, and more.
The great thing is that you can easily manage all of your tags from one central location without ever having to touch your WordPress installation.
By adding Google Tag Manager you can also remove a lot of plugins that become unnecessary. This not only saves you time, it also removes possible conflicts and if you are paying for some of these, you can also save money.
OK, so how do I get started?
If you have a Google Analytics account, you will want to use the same account for Google Tag Manager so you can easily associate them.
Give your account a relevant name.
Next, you need to add a container, in this case, it will be your website. Give the container a name and select under “Where to use container” “Web”. Click Create.
Now that you have a functioning container let’s set up a simple tag. For this example, I will assume that you have a Google Analytics account already set up.
Go ahead and select “New Tag”.
Now give your tag a relevant name like “My Google Analytics” and click on the “Choose a tag type to begin setup…”
In the new pop-up select the first option “Google Analytics – Universal Analytics”
In the new screen make sure that under “Track Type” “Page View” is selected. Next select under “Google Analytics Settings” select “New Variable…”.
You should now have a screen where to put in Analytics ID. Put it in and save everything.
Now we need to add a trigger. A trigger is what makes this tag go and do its thing. In our case since we are tracking our website so we want the trigger to go off on all “Page View”.
Save everything and make sure to click submit on the upper right-hand corner for your tag to take effect. If you do not publish the container, the new tag will not work.
In your upper right-hand corner you should see your Tag Manager ID, click on it and the code that we need will pop up in a window. Leave this tab open in your browser, you will need to copy this code.
Now let’s add the code to WordPress
Open your WordPress install and add the following plugin: Insert Headers and Plugins
Let’s test this out!
Open up your Chrome browser and head over to the Chrome Web Store. Search for “Tag Assistant” (by Google) and add it to your browser.
Now go to your WordPress site, flush your cache if you have one installed, log out, and go to your website.
Open the Tag Assistant extension (you should have an icon for it in your browser) and click Enable.
Refresh your browser. If everything is installed correctly you should see your Google Analytics Tag in the popup window when you click on the extension.
What else can you do with Google Tag Manager?
For starters, you can now add in very easily other tracking codes like Facebook Pixel, in fact, you can add several Facebook tracking pixels to the same page.
You can also track outbound links, add Mautic tracking code, put in campaign specific tracking, the possibilities are endless, and all this can be done without opening your WordPress installation to write in custom code.
Google tag manager allows you add, remove or pause different tags without having to use third-party plugins that might break your WordPress installation due to lack of updates or incompatibility your theme.
So go and add this in today.