WP Manifestindependent plugin directory
manifest / analytics / gtm-integration

GTM Integration

Extension WordPress pour intégrer Google Tag Manager

by Patrice Défago · github.com/patricedefago/gtm-integration · website

1stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/patricedefago/gtm-integration/archive/refs/heads/main.zip

Minimalist WordPress plugin to inject Google Tag Manager the right way (head + body) without touching your theme.

TL;DR
GTM Integration adds your Google Tag Manager container exactly where Google recommends – in <head> and right after <body> – using WordPress hooks, with no bloat, no dashboards and no theme hacking.

📘 Full tutorial (FR): Installer Google Tag Manager sur WordPress sans toucher au thème


📸 Screenshot

GTM Integration Settings

The simple settings page – just enter your GTM container ID and you're done.


✨ Features

  • ✅ Injects the GTM script into <head> using wp_head with high priority
  • ✅ Injects the noscript iframe right after <body> using wp_body_open()
  • ✅ Works with any modern WordPress theme (and includes a fallback for older ones)
  • ✅ No theme file editing (header.php, functions.php)
  • ✅ Ultra-lightweight: no extra dashboards, no tracking of its own, no bloat
  • ✅ Fully open source (GPL-2.0-or-later)

GTM Integration is designed for people who want a clean, reliable GTM container and prefer to manage all tag logic inside Google Tag Manager itself.


🤔 Why another GTM plugin?

There are already several plugins that can load Google Tag Manager in WordPress (Google Site Kit, GTM4WP, header/footer code managers…).
So why this one?

Compared to Google Site Kit

  • Site Kit is a full "Google suite" for WordPress (Search Console, Analytics/GA4, AdSense, Tag Manager, dashboards…).
  • GTM Integration focuses on one single responsibility: load GTM in the right place, with no dashboards and no extra services.

Use Site Kit if you want a Google dashboard inside WordPress.
Use GTM Integration if you only want a minimal, robust GTM container and prefer to keep GA4, Search Console etc. separate.

Compared to GTM4WP and other advanced plugins

  • Advanced plugins (like GTM4WP) are amazing for e-commerce, enhanced dataLayer, media tracking, etc.
  • But they also come with more options and complexity.

GTM Integration is intentionally minimal:

  • no pre-built dataLayer,
  • no WooCommerce integration,
  • fewer things to misconfigure.

It's ideal if you already know how to build your tracking in GTM and just need a clean entry point.

Compared to "Header/Footer code" plugins

Header/footer managers are great for pasting all sorts of scripts.
But for GTM specifically:

  • they sometimes only target <head> or footer,
  • they're not always aligned with the official GTM placement (head + body).

GTM Integration is opinionated:

  • script part → always in <head>
  • noscript part → always right after <body>

No extra choices, no risky placements.


🚀 Installation

From GitHub release (recommended)

  1. Go to the Releases page and download the latest gtm-integration-x.x.x.zip.
  2. In your WordPress admin, go to Plugins → Add New → Upload Plugin and upload the zip file.
  3. Activate GTM Integration.

Configure GTM

  1. In WordPress, open Settings → GTM Integration.
  2. Enter your Google Tag Manager container ID (for example: GTM-ABC1234).
  3. Save changes.

The plugin will:

  • inject the GTM script into <head>
  • inject the noscript iframe after <body>

…without you touching any theme file.


✅ Requirements

  • WordPress 5.0+
  • PHP 7.3+
  • A valid Google Tag Manager container (GTM-XXXXXXX)

🔍 How to verify GTM is working

  1. Open your GTM container and click Preview.
  2. Enter your site URL and start the preview.
  3. Visit your site in a new tab.
  4. The GTM debug panel should show your container and fired tags.

You can also use Tag Assistant (Chrome extension) to confirm that GTM is correctly loaded.


💡 Use cases

GTM Integration is especially useful if you:

  • maintain multiple client sites and don't want to hack each theme
  • are afraid to edit header.php or functions.php
  • want a minimalist tracking setup and manage everything in GTM
  • care about performance and want as few plugins/scripts as possible

🙌 Contributing & feedback

Issues and pull requests are welcome!

  • Report bugs or suggest improvements via Issues
  • Open a PR if you want to enhance the plugin (small, focused PRs are best)

If you use the plugin in production, I'd love to know where – it helps me understand real-world use cases.


🧾 License

This plugin is licensed under the GPL-2.0-or-later license.
See the LICENSE file for full details.


🇫🇷 Version française (résumé)

GTM Integration est une extension WordPress minimaliste qui sert à intégrer Google Tag Manager proprement dans votre site :

  • script GTM dans <head> via wp_head (priorité élevée)
  • bloc noscript juste après <body> via wp_body_open()
  • aucune modification du thème (header.php, functions.php), aucun tableau de bord, aucun "bloat".

Pourquoi ne pas utiliser simplement Site Kit ou un autre plugin ?

  • Google Site Kit = suite complète Google (Search Console, GA4, AdSense, GTM, rapports…).
    → Pratique, mais plus lourd, avec plusieurs scripts et écrans supplémentaires.

  • GTM Integration = une seule mission : charger le conteneur GTM au bon endroit, de façon propre et légère, et vous laisser gérer la logique directement dans l'interface GTM.

  • Plugins header/footer = très génériques.
    → GTM Integration est pensé spécifiquement pour GTM, avec un placement conforme aux recommandations de Google (head + body).

Installation rapide (FR)

  1. Téléchargez l'archive depuis la page Releases de GitHub.
  2. Dans WordPress : Extensions → Ajouter → Téléverser une extension, puis activez le plugin.
  3. Allez dans Réglages → GTM Integration, entrez votre ID de conteneur (ex : GTM-ABC1234), enregistrez.

Votre conteneur GTM est alors injecté proprement, sans toucher au thème, prêt pour GA4, Google Ads et vos tags personnalisés.

👉 Tutoriel détaillé (FR) : Installer Google Tag Manager sur WordPress sans toucher au thème