WPCode
93Easily add code snippets in WordPress. Insert header & footer scripts, add PHP code snippets with conditio...
Advanced tag management for WordPress with Google Tag Manager
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
Where it falls short
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.
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.
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)
Data is provided using the WhichBrowser library: http://whichbrowser.net/
Other plugins for developer tooling.
Easily add code snippets in WordPress. Insert header & footer scripts, add PHP code snippets with conditio...
Easily add tracking code snippets, conversion pixels, or other scripts required by third party services for an...
Duplicate post, post order, image resize, email via SMTP, admin menu editor, custom css / code, disable gutenb...
Create custom "Shortcodes" easily for HTML, JavaScript, CSS code snippets and use the shortcodes wit...
Add PHP code to your pages and posts easily using shortcodes.
An easy, clean, and simple way to enhance your site with code snippets.