Google Tag Manager is a great tool to add and manage multiple pixels and tracking codes without needing to edit the code of a site.
You can install Google Tag Manager directly in your WordPress. The best part- you only have to install it once.
Ready to jump in?
What is Google Tag Manager?
Google Tag Manager is the ultimate tool for managing all of your tags without needing a developer.
A tag is a customized piece of code that is set up to run on a website or app. It sends specific information to a third-party system.
This system takes all the data and aggregates the information to provide you with accurate real-time analytics. These analytics are essential in building effective digital marketing strategies.
Important: This SOP works only for self-hosted WordPress sites, aka WordPress.org and not WordPress.com
A. You’ll need to log in to your Google account.
B. If this is your first time creating a Google Tag Manager Account, you’ll be prompted to set up one right away.
- You can just use your company/website name for both the account and container.
- Under “Where to Use Container,” select “Web”
C. Accept the terms and conditions.
D. You will see your Google Tag Manager code, but you won’t need it using this method.
E. Once, you are in your Workspace, make note of your Google Tag Manager ID.
F. Click on Submit > Publish > Continue to publish your Google Tag Manager container
Install and configure the Google Tag Manager WordPress plugin
- Log in to your WordPress site.
- In the WordPress sidebar, go to Plugins > Add New
- Enter “Google Tag Manager for WordPress” in the search box
- Install the Google Tag Manager for WordPress plugin (the image may vary)
- Activate the plugin
- In the WordPress sidebar, go to Settings > Google Tag Manager
- Paste your Google Tag Manager ID (the one you got from the Google Tag Manager dashboard) in the available field
- Select the “Custom (needs tweak in your template)” container code placement and click on “Save Changes.”
- Copy the php code provided by the plugin and click on “Save Changes”
- In the WordPress sidebar, go to Appearance > Editor
- Make sure that you are editing the Theme that you currently have installed in your site (you can go to Appearance > Themes to check the name of the theme you are using)
- Select the “Theme Header” template from the list on the right.
- This template is different depending on the theme that you have installed. However, you will always be able to find an opening <body> tag in the code.
- Enter the php code provided by the plugin right below the opening <body> tag
- Click on “Update File”
QA-ing Your Installation
- Open your website homepage using Chrome.
- Click on the Google Tag Assistant Chrome Extension
- Click on “Enable”
- Refresh the page and click on the Google Tag Assistant Chrome Extension again
- You should see a green tag for Google Tag Manager, indicating that the installation was successful.
Wrapping It Up
Keep in mind, this step-by-step guide only applies to WordPress sites. However, you don’t have to be in website management or analytics to use Google Tag Manager.
If you follow these directions you can properly install Google Tag Manager without any technical issues.
If you’re looking for more guidance on how to add Google Tag Manager to a WordPress Site, click here.