WPThumbs
Themes Plugins By purpose By industry Best-of lists Fix it guides
Free Plugin by Thomas Geiger v1.22.5

GTM4WP

Advanced tag management for WordPress with Google Tag Manager

GTM4WP

The facts

Rating
4.5★ from 154
Active installs
700k+
Price
Free
Last updated
4 Aug 2026
Added
Sep 2013
Requires WP
3.4.0
Tested up to
WP 7.0.4
Requires PHP
7.4
Downloads
14,939,352

Our analysis

AI-assisted

GTM4WP is a WordPress plugin that facilitates the integration of Google Tag Manager (GTM) into your WordPress site. It allows you to manage and deploy analytics and marketing tags without needing to add code snippets manually. The plugin supports multiple GTM containers and helps push page meta data and user information into the data layer for enhanced tracking.

This plugin is suitable for developers and site administrators who want to implement GTM efficiently. It requires PHP 7.4 and is compatible with various themes, ensuring that the GTM container code is placed correctly on your site.

Best for: This plugin suits developers and site administrators looking to integrate Google Tag Manager into their WordPress sites.

What it does well

  • Free to use from the WordPress.org directory
  • Supports multiple GTM containers
  • Automatically places GTM container code snippets
  • Compatible with popular themes like Genesis and Elementor
  • Provides detailed user and browser data

Where it falls short

  • Requires PHP 7.4
  • Limited information on additional features

Verdict

GTM4WP is a practical tool for managing GTM on WordPress, especially for those familiar with analytics and tracking. Its straightforward setup makes it a useful addition for relevant users.

From the developer

Thomas Geiger's own description of GTM4WP, lightly tidied.

Google Tag Manager (GTM) is Google’s free tool for everyone to manage and deploy analytics and marketing tags as well as other code snippets
using an intuitive web UI. To learn more about this tool, visit the official website.

This plugin places the GTM container code snippets onto your WordPress website so that you do not need to add it manually.
Multiple containers are also supported!

The plugin complements your GTM setup by pushing page meta data and user information into the so called data layer.
Google’s official help pages includes more details about the data layer.

PHP 7.4 is required to use this plugin.

GTM container code placement

The original GTM container code is divided into two parts:

The first part is a javascript code snippet that is added to the <head> section of every page of the website.
This part is critical to enable all features of GTM, and this plugin helps to place this part
correctly on your site.

The second part is an iframe snippet that acts as a failsafe/fallback should users’ JavaScript be disabled.
Google recommends – for best performance – to place this code snippet directly after the opening <body> tag on each page.

Albeit not ideal, it will work when placed lower in the code. This plugin provides a code placement option for the second code snippet.

If your WordPress theme is compatible with the additions of WordPress 5.2 then this plugin will place this second code to the right place.
Users of the Genisis theme, GeneratePress theme, Elementor, Oxygen Builder and Beaver Builder Theme will also have this placed correctly.
To utilize this, set the compatibility mode in plugin options to off.

All other users can place this second code snippet using a custom PHP code (“Manually coded” option) or select the so called “Footer” option to
add the code lower in the code (it is not the recommended way but will work)

Basic data included

  • post/page titles
  • post/page dates
  • post/page category names
  • post/page tag names
  • post/page author ID and name
  • post/page ID
  • post types
  • post format
  • post count on the current page + in the current category/tag/taxonomy
  • custom terms associated with any post type
  • logged in status
  • logged in user role
  • logged in user ID (to track cross device behaviour in Google Analytics)
  • logged in user email address (both unhashed and SHA256 hased values to be used with tracking)
  • logger in user creation date
  • site search data
  • site name and id (for WordPress multisite instances)
  • IP address of the visitor (please use the explicit consent of the visitor to utilize this)

Browser / OS / Device data

  • browser data (name, version, engine)
  • OS data (name, version)
  • device data (type, manufacturer, model)

Data is provided using the WhichBrowser library: http://whichbrowser.net/

Read the full description on the official page →

Tagged as

Alternatives

Other plugins for developer tooling.

WPCode

WPCode

93

Easily add code snippets in WordPress. Insert header &amp; footer scripts, add PHP code snippets with conditio...

Free 3M+ installs 4.9★ (1,873)
Header Footer Code Manager

Easily add tracking code snippets, conversion pixels, or other scripts required by third party services for an...

Free 600k+ installs 4.9★ (309)
Admin and Site Enhancements

Duplicate post, post order, image resize, email via SMTP, admin menu editor, custom css / code, disable gutenb...

Free 200k+ installs 5★ (421)
Shortcoder

Create custom &quot;Shortcodes&quot; easily for HTML, JavaScript, CSS code snippets and use the shortcodes wit...

Free 100k+ installs 4.9★ (227)
Insert PHP Code Snippet

Add PHP code to your pages and posts easily using shortcodes.

Free 90k+ installs 4.9★ (705)
Code Snippets

An easy, clean, and simple way to enhance your site with code snippets.

Free 1M+ installs 4.7★ (509)