How to Easily Install Google Tag Manager in WordPress

Google Tag Manager (GTM) 2025 is a free tool that allows you to manage tracking codes, such as Google Analytics, Facebook Pixel, and other scripts, without editing your website’s code. Here’s how to install it easily on WordPress. Step 1: Create a Google Tag Manager Account Go to Google Tag Manager and sign in with […]

Google Tag Manager (GTM) 2025 is a free tool that allows you to manage tracking codes, such as Google Analytics, Facebook Pixel, and other scripts, without editing your website’s code. Here’s how to install it easily on WordPress.

Step 1: Create a Google Tag Manager Account

  1. Go to Google Tag Manager and sign in with your Google account.
  2. Click Create Account and fill in the details:
    • Account Name (e.g., Your Business Name)
    • Country (Select your country)
    • Container Name (Your website URL)
    • Target Platform: Choose Web
  3. Click Create and accept the terms.

Step 2: Get Your Google Tag Manager Code

  1. After creating the container, you’ll see two code snippets:
    • First code (Place inside <head> section)
    • Second code (Place after the opening <body> tag)
  2. Copy these codes, as you’ll need them to install GTM on WordPress.

Step 3: Install Google Tag Manager in WordPress

Method 1: Using a Plugin (Recommended for Beginners)

  1. Install a GTM Plugin:
    • Go to WordPress Dashboard → Plugins → Add New.
    • Search for “Google Tag Manager for WordPress” by Thomas Geiger.
    • Click Install Now, then Activate.
  2. Add GTM ID:
    • Go to Settings → Google Tag Manager.
    • Enter your GTM Container ID (format: GTM-XXXXXX).
    • Save changes, and the plugin will insert the GTM code automatically.

Advantages: No coding required, safe and beginner-friendly.


Method 2: Manually Adding Google Tag Manager Code

  1. Copy the first GTM code and add it inside your theme’s header:
    • Go to Appearance → Theme Editor.
    • Open the header.php file.
    • Paste the code before the closing <head> tag.
  2. Copy the second GTM code and add it inside the body:
    • Open the footer.php file.
    • Paste the code right after the opening <body> tag.
  3. Click “Update File” to save changes.

Advantages: No need for plugins, direct control.
Disadvantages: Risk of losing code when updating your theme.


Step 4: Verify Google Tag Manager is Working

  1. Go back to Google Tag Manager and click Preview.
  2. Enter your website URL and click Connect.
  3. If GTM is working, you’ll see a message “Tags Fired”.

Final Thoughts

Google Tag Manager makes it easy to add tracking scripts to WordPress without modifying code repeatedly. If you’re new to GTM, using a plugin is the easiest way. For advanced users, manual installation offers more control.

Would you like help with setting up Google Analytics or Facebook Pixel inside GTM? 🚀