How to Install and Setup Google Tag Manager in WordPress

Google Tag Manager is a powerful tool that allows website owners to easily manage and deploy various tracking codes and tags on their website without needing to edit the website’s code. In this step-by-step guide, we will walk you through the process of installing and setting up Google Tag Manager in WordPress. By the end of this tutorial, you will have a better understanding of how to use Google Tag Manager to track user interactions on your WordPress site, such as page views, form submissions, and more.

Step 1: Sign Up for Google Tag Manager

  1. Visit the Google Tag Manager Website: Start by visiting the Google Tag Manager website (https://tagmanager.google.com/).
  2. Sign in with Your Google Account: Click on the “Sign in” button and log in with your Google account. If you don’t have a Google account, you’ll need to create one.
  3. Create an Account: After logging in, click on the “Create Account” button and provide a name for your account. This can be your website’s name.
  4. Set Up Container: Once you’ve created your account, you’ll need to set up a container. A container is a place where you’ll manage all your tags. Click on “Web” to create a container for your WordPress website.
  5. Add Container Name: Give your container a name. It can be your website’s name or something descriptive.
  6. Choose Target Platform: Select “Web” as your target platform since we are setting up Google Tag Manager for a WordPress website.
  7. Click Create: Click the “Create” button to create your container.

Step 2: Get the Google Tag Manager Code

  1. Accept Terms: Google Tag Manager will display its Terms of Service. Read through them and accept if you agree.
  2. Copy the Code: After accepting the terms, you’ll be presented with two pieces of code: one for the container itself and another for the noscript code. Copy the container code.

Step 3: Add Google Tag Manager Code to Your WordPress Website

  1. Login to Your WordPress Admin Dashboard: Go to your WordPress admin dashboard by adding “/wp-admin” to your website’s URL and log in.
  2. Install a Plugin: To add the Google Tag Manager code to your website, you can use a plugin like “Insert Headers and Footers.” In the WordPress dashboard, go to “Plugins” > “Add New” and search for “Insert Headers and Footers.”
  3. Install and Activate the Plugin: Click “Install Now” on the plugin, and then click “Activate” once it’s installed.
  4. Access Plugin Settings: After activation, go to “Settings” > “Insert Headers and Footers.”
  5. Paste the Google Tag Manager Code: In the “Scripts in Header” section, paste the Google Tag Manager container code you copied earlier. This code will be added to all the pages of your WordPress site.
  6. Save Changes: Click the “Save” button to save your changes.

Step 4: Verify Google Tag Manager Installation

  1. Go Back to Google Tag Manager: Return to your Google Tag Manager account and click “Continue” to complete the installation.
  2. Check Installation: Google Tag Manager will provide a verification code. Make sure the code is successfully installed on your website. You can use the “Tag Assistant” Chrome extension to verify the installation.

Step 5: Add Tags in Google Tag Manager

  1. Access Your Google Tag Manager Container: In your Google Tag Manager account, click on your container’s name.
  2. Click on Tags: In the left sidebar, click on “Tags.”
  3. Create a New Tag: Click the “New” button to create a new tag.
  4. Choose a Tag Type: Select the type of tag you want to add. For example, you can choose “Google Analytics – Universal Analytics” to track pageviews.
  5. Configure Tag Settings: Configure the tag settings. For Google Analytics, you will need to enter your Google Analytics Tracking ID.
  6. Choose Trigger: Next, you’ll need to choose a trigger for your tag. A trigger determines when the tag should fire. You can choose a built-in trigger like “All Pages” to track all pageviews.
  7. Save Tag: Once you’ve configured your tag, click “Save.”

Step 6: Publish Your Container

  1. Review Changes: Before you publish your container, review all the changes you’ve made.
  2. Click “Submit: Click the “Submit” button to publish your container.

Step 7: Test Your Tags

  1. Preview Mode: Google Tag Manager offers a “Preview” mode, which allows you to test your tags before they go live.
  2. Click “Preview: Click the “Preview” button in Google Tag Manager to enter Preview mode.
  3. Visit Your Website: Open a new tab and visit your WordPress website. You should see the Google Tag Manager debug console at the bottom of the page.
  4. Test Interactions: Interact with your website as you normally would, and check if the tags are firing correctly in the Google Tag Manager debug console.
  5. Exit Preview Mode: Once you’ve tested your tags and are satisfied, exit Preview mode in Google Tag Manager.

Step 8: Publish Your Container (Again)

  1. After Testing: Once you’ve thoroughly tested your tags in Preview mode, return to Google Tag Manager.
  2. Click “Submit: Click the “Submit” button again to publish your container. This time, you are publishing it for real, and your tags will be live on your website.

Step 9: Monitor Your Tags

  1. Regularly Check Your Tags: It’s essential to regularly monitor your tags to ensure they are functioning correctly. Google Tag Manager provides reports and debugging tools to help you with this.
  2. Make Updates as Needed: If you need to make changes to your tags or add new ones, you can do so in Google Tag Manager and then republish your container.

Step 10: Troubleshooting and Advanced Configuration

  1. Debugging: If you encounter issues with your tags, you can use Google Tag Manager’s built-in debugging tools to diagnose and fix problems.
  2. Advanced Configuration: Google Tag Manager offers advanced features like variables, triggers, and custom HTML tags. Explore these options to enhance your tracking capabilities.

Conclusion:

Congratulations! You’ve successfully installed and set up Google Tag Manager in WordPress. You can now easily manage and deploy tracking codes and tags on your website without the need for complex code changes. This will allow you to gain valuable insights into user behavior and improve your website’s performance. Remember to regularly monitor and update your tags as needed to ensure accurate tracking and reporting. With Google Tag Manager, you have a powerful tool at your disposal to enhance the visibility and accessibility of your website to both users and search engines.

To Get Daily Health Newsletter

We don’t spam! Read our privacy policy for more info.

Download Mobile Apps
Follow us on Social Media
© 2012 - 2025; All rights reserved by authors. Powered by Mediarx International LTD, a subsidiary company of Rx Foundation.
RxHarun
Logo