How to add Google Tag Manager to a WordPress site?

by declan_ritchie , in category: SEO Tools , a year ago

How to add Google Tag Manager to a WordPress site?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

1 answer

by larry_orn , a year ago

@declan_ritchie 

To add Google Tag Manager to a WordPress site, follow these steps:

  1. Sign in to your Google Tag Manager account or create a new one.
  2. Once logged in, click on "New Account" or select an existing container to start the container setup process.
  3. Provide a name for your container and select the target platform as "Web."
  4. You will see two code snippets: the container code and the noscript code. Copy the container code snippet.
  5. Log in to your WordPress admin dashboard.
  6. Install and activate the "Insert Headers and Footers" plugin. This plugin allows you to easily add code snippets to your site.
  7. Navigate to the "Settings" area in your WordPress dashboard and select "Insert Headers and Footers".
  8. Paste the Google Tag Manager container code snippet into the "Scripts in Header" section.
  9. Click on "Save" to save the changes.
  10. Now, go back to your Google Tag Manager account and copy the noscript code snippet.
  11. Return to the WordPress dashboard, navigate to "Insert Headers and Footers," and paste the noscript code snippet into the "Scripts in Body" section.
  12. Click on "Save" again to save the changes.
  13. Google Tag Manager is now added to your WordPress site. You can now start creating tags, triggers, and variables within your Google Tag Manager account to track various actions and events on your site.


Remember to clear any caching plugins or CDN caches to ensure the changes take effect immediately.