top of page
Writer's pictureSotirios Seridis

How to Install Google Tag Manager in WordPress

If it's the first time you dabbled in WordPress and you're wondering how to start tracking your web activities, then you're at the right place. This simple, step-by-step guide (with tutorials) will show you how to install Google Tag Manager in WordPress. Let's get started straight away!







How to Install Google Tag Manager in WordPress


Step 1: Create a Google Tag Manager and Container


1. Navigate to tagmanager.google.com and click Create Account

2. Account setup: insert name and country

3. Container setup: insert container name and select location of installation (i.e. website, Android/iOS application, etc)

4. Click Create and agree to the Terms and Conditions

You'll land on a screen with instructions about GTM installation codes, in which you have to copy and paste the codes into the <head> and after the opening <body> tag. In case you accidentally close the instruction panel, you can navigate to Admin > Install Google Tag Manager to find the codes.


Step 2: Navigate to your WP website's dashboard


Step 3: Install and activate the WP Code Plugin


1. Click on Plugins and click on Add New

2. Search the plugin titled "WP Code" and click Install Now. You can use other similar plugins but this is the one that we recommend as it is the smoothest and easiest plugin to help you install the GTM.

3. Click on Activate


Step 4: Navigate to Code Snippets and select Header & Footer


Step 5: Copy and paste the GTM tracking codes to the Header and Body


Step 6: Save changes


Step 7: Verify if you have installed the GTM correctly


1. Navigate to the Chrome store and install the Tag Assistant Legacy (Google)

2. Visit your website and activate the Tag Assistant

3. Enable the Tag Assistant

4. Refresh the website and reactivate the Tag Assistant. All the Google Tags on your website will be displayed and you should be able to see the GTM with the unique identification number that you used to install on your WordPress website.





Frequently Asked Questions on Installing Google Tag Manager in WordPress



What is Google Tag Manager, and why should I use it with WordPress?


Google Tag Manager (GTM) is a tag management system that allows you to easily manage and deploy marketing and analytics tags on your website without having to modify the code directly. Using GTM with WordPress simplifies the process of adding and managing tags, such as Google Analytics, Facebook Pixel, and conversion tracking codes, making it easier to implement and update tracking and marketing tags.



Can I use multiple Google Tag Manager containers on my WordPress site?


It's generally recommended to use only one GTM container per website to avoid conflicts and data discrepancies. If you have multiple domains or subdomains, you can use the same GTM container across them.



How can I troubleshoot Google Tag Manager issues on my WordPress site?


If the GTM container code is not appearing, do the following:

  • Verify that the GTM code is correctly placed in the <head> and <body> sections of your theme’s header.php file or via the plugin settings.

  • Ensure that the GTM container ID you've entered in your WordPress GTM plugin or manually in the theme files is correct and matches the container ID in your GTM account.

  • View the source code of your WordPress pages and look for the GTM code snippets. Ensure that the code is present and properly placed (in the and sections).

  • Clear your website’s cache and browser cache to ensure you’re viewing the latest changes.

  • Ensure there are no other plugins or code snippets that might be interfering with the GTM container.

  • Temporarily disable other plugins to rule out conflicts that might be preventing the GTM code from loading.

  • Look for errors in the browser console that may indicate issues with tag execution.

  • Use GTM’s Preview mode to see if the GTM code is active and working.



How do I remove Google Tag Manager from my WordPress site?


Here are the steps to remove Google Tag Manager (GTM) from your WordPress site:

  1. If Added Manually:

  2. In the WordPress dashboard, go to Appearance > Theme Editor.

  3. Locate the header.php and footer.php (or body.php) files.

  4. Remove the GTM code snippets from these files.

  5. Save the changes to your theme.

  6. If Using a Plugin:

  7. In your WordPress admin dashboard, go to Plugins > Installed Plugins.

  8. Find the "Google Tag Manager for WordPress" plugin (or any other GTM plugin you're using).

  9. Click "Deactivate" and then "Delete" to remove the plugin completely.


After removing the GTM code, clear your WordPress site's cache to ensure the changes take effect. Then, check your website's source code (Ctrl+U or Cmd+U) to ensure the GTM code snippets have been removed. Use the Google Tag Assistant browser extension to confirm that GTM is no longer detected on your site.




Comments


Commenting has been turned off.
bottom of page