700,000+
December 15, 2025
September 23, 2013
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/
(beta)
Push data about users’ current weather conditions into the dataLayer. This can be used to generate weather-related
audience/remarketing lists on ad platforms and allows for user segmentation in your web analytics solutions:
Weather data is queried from Open Weather Map. Depending on your websites traffic, additional fees may apply:
http://openweathermap.org/price
An (free) API key from OpenWeatherMap is required for this feature to work.
ipstack.com is used to determine the site visitor’s location. A (free) API key from IPStack.com is required for this feature to work:
https://ipstack.com/product
(experimental)
Track users’ interaction with any embedded media:
DataLayer events can be chosen to fire upon media player load, media is being played, paused/stopped and optionally when
the user reaches 10, 20, 30, …, 90, 100% of the media duration.
Tracking is supported for embedded media using the built-in oEmbed feature of WordPress as well as most other media plugins
and copy/pasted codes. Players injected into the website after page load are not currently supported.
Fire tags based on how the visitor scrolls from the top to the bottom of a page.
An example would be to separate “readers” (who spend a specified amount of time on a page) from “scrollers”
(who only scroll through within seconds). You can use these events to fire Analytics tags and/or remarketing/conversion tags
(for micro conversions).
Scroll tracking is based on the solution originally created by
Original script:
http://cutroni.com/blog/2012/02/21/advanced-content-tracking-with-google-analytics-part-1/
To increase website security, you have the option to white- and blacklist tags/triggers/variables.
You can prevent specific tags from firing or the use of certain variable types regardless of your GTM setup.
If the Google account associated with your GTM account is being hacked, an attacker could easily
execute malware on your website without accessing its code on your hosting server. By blacklisting custom HTML tags
and/or custom JavaScript variables you can secure the Tag Manager container.
Google Tag Manager for WordPress integrates with several popular plugins. More integration to come!
If you are using a server side container
you can enter your custom domain name and custom path to load gtm.js from your there.
You can set which user roles needs to be excluded from tracking when a user with that role visits the frontend. This will completely disable the container code for that user.
duracelltomi-google-tag-manager-for-wordpress to the /wp-content/plugins/ directoryTutorials for various Google Tag Manager settings and implementation are available on the plugin’s website:
https://gtm4wp.com/setup-gtm4wp-features
PayPal and some other 3rd party payment gateways do not redirect users back to your website upon successful transaction by default.
It offers the route back for your customer but it can happen that users close the browser before arriving at your thankyou page
(aka. order received page). This means that neither Google Analytics tags or any other tags have the chance to fire.
Enable auto-return in your payment gateway settings. This will instruct them to show a quick info page after payment
and redirect the user back to your site. This will improve the accuracy and frequency of tracked transactions.
If you are using a 3rd party plugin that alters the default order received page in a way that does not utilize the integration hooks
of WooCommerce then this can happen. Either stop using this 3rd party plugin or ask them to better mimic the behavior of the
default order received page by supporting the woocommerce is_order_received_page and the woocommerce_thankyou actions and filters.
Although Google recommends to blacklist tags and variables using classes, people struggle to know
which tags/variables gets affected. Therefore I opted for individual tags and variables rather than classes
on the blacklist tabs.
Regarding variables; ensure they are not part of any critical tags as blacklisting such variables will render said tags useless.
Google Tag Manager supports basic scroll depth tracking based on percentage or pixels natively. This plugin adds
additional scroll tracking events, more focused on capturing the users’ intent and/or engagement.
There are five dataLayer events you can use in your rule definitions:
timeToScroll dataLayer variable stores duration since the article loaded (in seconds)timeToScroll dataLayer variable updatedtimeToScroll dataLayer variable updatedreaderType dataLayer variableExample use cases: using these events as triggers, you can fire Google Universal Analytics and/or Google Ads remarketing/conversion tags
to report micro conversions and/or to serve ads only to visitors who spend more time reading your content.
!!! WARNING !!!
Significant change in WooCommerce integration!
Check your template whether it supports must have hook: woocommerce_thankyou
THE BIG CLEANUP RELEASE!
Lots of deprecated features removed.
The code of WooCommerce integration was cleaned and restructured, if you have any custom code that relies on GTM4WP internal data structure,
please update the plugin on a test version of your website before updating your live site!
WARNING!
Universal Analytics / GA3 ecommerce events deprecated!
Please update your GTM setup so that it does not rely on any of the following GTM4WP events and the old ecommerce data layer:
* gtm4wp.productClickEEC
* gtm4wp.addProductToCartEEC
* gtm4wp.removeFromCartEEC
* gtm4wp.checkoutOptionEEC
* gtm4wp.checkoutStepEEC
* gtm4wp.changeDetailViewEEC
* gtm4wp.orderCompletedEEC
Instead of the above events, you can use the new GA4 ecommerce events (add_to_cart, purchase, etc.)
In the Universal Analytics GTM tag now you have an option to use the GA4 ecommerce data in the data layer.
If you are on GA360 and still collecting ecommerce data, you need to update your GTM setup to use that option firing on the GA4 ecommerce events.
| Version | Download | Type |
|---|---|---|
| 1.22.3 | Download | Stable |
| 1.22.2 | Download | Stable |
| 1.22.1 | Download | Stable |
| 1.22 | Download | Stable |
| 1.21.1 | Download | Stable |
| 1.21 | Download | Stable |
| 1.20.3 | Download | Stable |
| 1.20.2 | Download | Stable |
| 1.20.1 | Download | Stable |
| 1.20 | Download | Stable |
| 1.19.1 | Download | Stable |
| 1.19 | Download | Stable |
| 1.18.1 | Download | Stable |
| 1.18 | Download | Stable |
| 1.16.2 | Download | Stable |
| 1.16.1 | Download | Stable |
| 1.16 | Download | Stable |
| 1.15.2 | Download | Stable |
| 1.15.1 | Download | Stable |
| 1.15 | Download | Stable |
| 1.14.2 | Download | Stable |
| 1.14.1 | Download | Stable |
| 1.14 | Download | Stable |
| 1.13.1 | Download | Stable |
| 1.13 | Download | Stable |
| 1.12.3 | Download | Stable |
| 1.12.2 | Download | Stable |
| 1.12.1 | Download | Stable |
| 1.12 | Download | Stable |
| 1.11.6 | Download | Stable |
| 1.11.5 | Download | Stable |
| 1.11.4 | Download | Stable |
| 1.11.3 | Download | Stable |
| 1.11.2 | Download | Stable |
| 1.11.1 | Download | Stable |
| 1.11 | Download | Stable |
| 1.10.1 | Download | Stable |
| 1.10 | Download | Stable |
| 1.9.2 | Download | Stable |
| 1.9.1 | Download | Stable |
| 1.9 | Download | Stable |
| 1.8.1 | Download | Stable |
| 1.8 | Download | Stable |
| 1.7.2 | Download | Stable |
| 1.7.1 | Download | Stable |
| 1.7 | Download | Stable |
| 1.6.1 | Download | Stable |
| 1.6 | Download | Stable |
| 1.5.1 | Download | Stable |
| 1.5 | Download | Stable |
| 1.4 | Download | Stable |
| 1.3.2 | Download | Stable |
| 1.3.1 | Download | Stable |
| 1.3 | Download | Stable |
| 1.2 | Download | Stable |
| 1.1.1 | Download | Stable |
| 1.1 | Download | Stable |
| 1.0 | Download | Stable |
| 0.9.1 | Download | Stable |
| 0.9 | Download | Stable |
| 0.8.2 | Download | Stable |
| 0.8.1 | Download | Stable |
| 0.8 | Download | Stable |
| 0.7.1 | Download | Stable |
| 0.7 | Download | Stable |
| 0.6 | Download | Stable |
| 0.5.1 | Download | Stable |
| 0.5 | Download | Stable |
| 0.4 | Download | Stable |
| 0.3 | Download | Stable |
| 0.2 | Download | Stable |
| 0.1 | Download | Stable |
| Development | Download | Trunk |