Plugin Directory

DuracellTomi's Google Tag Manager for WordPress

The first Google Tag Manager plugin for WordPress with business goals in mind.


  • Fixed: PHP errors in frontend.php and admin.php


  • Added: track embedded YouTube/Vimeo/Soundcloud videos (experimental)
  • Added: new checkbox - use product SKU for AdWords Dynamic Remarketing variables instead of product ID (experimental)
  • Added: place your container code after the opening body tag without modifying your theme files (thx Yaniv Friedensohn)
  • Added: automatic codeless container code injection for Genesis framework users
  • Fixed: Possible PHP error with custom payment gateway (QuickPay) on the checkout page (thx Damiel for findig this)


The plugin itself is now declared as stable. This means that it should work with most WordPress instances. From now on each version will include features labeled as:

  • Beta: the feature has been proven to work for several users but it can still have some bugs
  • Experimental: new feature that needs proper testing with more users
  • Deprecated: this feature will be removed in a future version

If you see any issue with beta or experimental functions just disable the checkbox. Using this error messages should disappear. Please report all bugs found in my plugin using the contact form on my website.

  • Fixed: wrong GTM container code when renaming default dataLayer variable name (thx Vassilis Papavassiliou)
  • Fixed: Enhanced Ecommerce product click data was "undefined" in some cases (thx Sergio Alen)
  • Fixed: wrong user role detection while adding visitorType to the dataLayer (thx Philippe Vachon-Rivard)
  • Changed: only add visitorId to the dataLayer if there is a logged in user
  • Added: feature labels so that you can see beta, experimental and deprecated features
  • Deprecated: outbound click, email click and download click events. You should use GTM trigger events instead


  • Fixed: PHP error message: missing get_shipping function using WooCommerce 2.3.x


  • Added: visitorId dataLayer variable with the ID of the currently logged in user to track userID in Google Analytics
  • Added: WordPress filter hook so that other templates and plugins can get access to the GTM container code before outputting it
  • Fixed: 'variation incorrect' issue by Sharken03
  • Fixed: error messages in WooCommerce integration when product has no categories
  • Fixed: add_inline_js errors in newer versions of WooCommerce
  • Fixed: error message when some device/browser/OS data could not be set
  • Fixed: tracking Twitter events was broken


  • Fixed: broken links when listing subcategories instead of products (thanks Jon)
  • Fixed: wheather/weather typo (thanks John Hockaday)
  • Fixed: wrong usage of get_the_permalink() instead of get_permalink() (thanks Szepe Viktor)


  • Fixed: PHP error in enhanced ecommerce implementation when using layered nav widget


  • Updated: Added subtabs to the admin UI to make room for new features :-)
  • Updated: WhichBrowser library to the latest version
  • Added: You can now dismiss plugin notices permanently for each user
  • Added: weather data. See updated plugin description for details
  • Added: Enhanced E-commerce for WooCommerce (experimental!)
  • Fixed: PHP notice in frontend.php script. Credit to Daniel Sousa


  • Fixed: WooCommerce 2.1.x compatibility


  • Updated/Fixed: dataLayer variables are now populated at the end of the head section. Using this the container code can appear just after the opening body tag, thus Webmaster Tools verification using Tag Manager option will work
  • Added: blacklist or whitelist tags and macros to increase security of your Tag Manager setup


  • Updated: better add-to-cart events for WooCommerce, it includes now product name, SKU and ID
  • Added: browser, OS and device data to dataLayer variables
  • Added: postCountOnPage and postCountTotal dataLayer variables to track empty categories/tags/taxonomies


  • Fixed: WooCommerce integration did not work on some environments


  • Added: scroll tracking
  • Fixed: social tracking option on the admin panel was being shown as an edit box instead of a checkbox
  • Fixed: WooCommerce transaction data was not included in the dataLayer if you selected "Custom" code placement
  • Fixed: do not do anything if you enabled WooCommerce integration but did not activate WooCommerce plugin itself
  • Updated: do not re-declare dataLayer variable if it already exists (because another script already created it before my plugin was run)


  • Added: you can now select container code placement. This way you can insert the code snippet after the opening body tag. Please read FAQ for details
  • Added: initial support for social event tracking for Facebook and Twitter buttons. Please read FAQ for details
  • Updated: event name on successful WooCommerce transaction: OrderCompleted -> gtm4wp.orderCompleted
  • Fixed: frontend JS codes did not load on some WordPress installs


  • Updated: admin page does not show an alert box if Tag Manager ID or dataLayer variable name is incorrect. Instead it shows a warning line below the input field.
  • Updated: rewritten the code for WooCommerce dynamic remarketing. Added tag for homepage and order completed page.


  • ! BACKWARD INCOMPATIBLE CHANGE ! - Names of Tag Manager click events has been changed to comply with naming conventions:
    • ContactFormSubmitted -> gtm4wp.contactForm7Submitted
    • DownloadClick -> gtm4wp.downloadClick
    • EmailClick -> gtm4wp.emailClick
    • OutboundClick -> gtm4wp.outboundClick
    • AddProductToCart -> gtm4wp.addProductToCart
  • Updated: click events are now disabled by default to reflect recently released Tag Manager auto events. I do not plan to remove this functionality. You can decide which solution you would like to use :-)
  • Updated: language template (pot) file and Hungarian translation
  • Added: new form move events to track how visitors interact with your (comment, contact, etc.) forms
  • Added: event names to admin options page so that you know what events to use in Google Tag Manager
  • Added: Google Tag Manager icon to admin settings page
  • Added: Settings link to admin plugins page
  • Fixed: null value in visitorType dataLayer variable if no logged in user exists (now 'visitor-logged-out')


  • First beta release

Requires: 3.0.1 or higher
Compatible up to: 4.2.5
Last Updated: 4 months ago
Active Installs: 30,000+


5 out of 5 stars


8 of 27 support threads in the last two months have been resolved.

Got something to say? Need help?


Not enough data

0 people say it works.
0 people say it's broken.

100,1,1 100,1,1
100,2,2 100,1,1
100,2,2 100,1,1 100,1,1 100,1,1
100,1,1 100,1,1
100,1,1 100,1,1