Last Updated on4 min read
Are you looking to install Google Tag Manager in WordPress?
If you want to integrate various analytics and marketing services on your WordPress site, then Google Tag Manager is a great tool you can use. It allows you to add and update various tracking codes on your website easily.
In this article, we’ll show you how to install Google Tag Manager in WordPress in the right way.
What Is Google Tag Manager
Google Tag Manager is a free tag management tool by Google, which allows you to deploy and update different code snippets called ‘tags’ on your website.
With Google Tag Manager, you can easily add and manage all these codes from a single interface, without having to edit your website’s code.
There’re built-in tag templates for popular services like Google Analytics and DoubleClick. You can also add custom tags to your website.
Google Tag Manager is a smart tool that enables anyone, including beginners, to implement tracking scripts on their websites quickly.
With that said, let’s go ahead and see how to set up Google Tag Manager in WordPress in the proper way.
Step 1: Create Your Google Tag Manager Account
Next, you need to sign in with your Google account. Once done, you can see the Google Tag Manager’s Create Account page. Click on the ‘Create Account’ button to get started.
On the next screen, you can add a new account. Enter your account name and choose a country in the Account Setup box. You can use your company name as your account name.
Next, you need to set up your container. A container is the collection of tags, triggers, and all configurations installed on a website.
You can enter your website name as your container name. Choose ‘Web’ under Where to use container option, and then click on the Create button.
Now you’ll need to accept Google Tag Manager Terms of Service Agreement to proceed. Check the box next to ‘I accept the Data Processing Terms as required by GDPR.’ at the bottom, and then also click the ‘Yes’ button on the top right corner.
Upon accepting the terms of service, you’ll see a new popup window appear on screen with code snippets to install Google Tag Manager on your website.
There’re two code snippets to be added to header (inside <head > tag) and in the <body > section on your website.
Step 2: Adding Google Tag Manager Code to WordPress
Login to your WordPress dashboard and then install Insert Header and Footers plugin. Upon activation, go to Settings » Insert Headers and Footers page.
Now you can see two boxes for adding header and footer code. Go back to your Google Tag Manager account and copy the code in the first box. Paste the code into ‘Scripts in Header’ box.
Similarly, copy the other code from your Tag Manager account and insert that into the ‘Scripts in Footer’ box.
After that, don’t forget to save your changes.
That’s it! You’ve successfully installed Google Tag Manager in your WordPress site. Now you can use your Google Tag Manager dashboard to install any tracking code to your WordPress website.
Step 3: Add and Publish Tags in Your Tag Manager
Once you’ve installed Google Tag Manager on your website, you’re ready to add code snippets (tags) provided by different tracking tools on your site.
Click on the ‘New Tag’ icon, and follow the steps to create your first tag.
Now, you can add different tags in your Google Tag Manager container by following the same process and integrate your WordPress site with various marketing and tracking tools.