GTM4WP 2.0.0 is out
GTM4WP 2.0.0 is the new stable release on wordpress.org. A short summary of what changed, with links to the posts and documentation pages that cover the details.
GTM4WP 2.0.0 is out. After three betas and a release candidate, the new major version is now the stable release on wordpress.org, so your site will receive it as a regular plugin update. Instead of repeating everything that has been written about 2.0 during the pre-release phase, this post is a short summary with links to the articles and documentation pages that describe each change in detail.
A rewrite that keeps your setup working
Version 2.0 is a complete rewrite of the plugin. The settings screen, the internal structure and large parts of the WooCommerce tracking are new. The public integration surface did not change: the template functions, filters, actions, wp-config constants and the stored option key are the same as in 1.x, so existing customizations keep working. Your settings are migrated automatically when the new version activates.
The minimum requirements are WordPress 6.3, PHP 8.0 and WooCommerce 5.0. If your site runs older versions, WordPress will not offer the update and you stay on 1.22.5.
New development happens on 2.0 only: the 1.x line will not receive further features or bug fixes, although I will still fix any security issue that is reported in it. If your site has to stay on 1.22.5 for now, it will keep working, but please plan the upgrade so that you do not fall too far behind.
If you want the background on why the plugin needed a rewrite, it is in GTM4WP 1.22.4 is out, and 2.0 is on the way. The pre-release posts document how the version matured: beta 2, beta 3 and the release candidate. The complete list of changes is in the changelog on GitHub.
What to check after the update
Most sites do not need to do anything. Three changes can affect an existing measurement setup:
- Visitor, device, customer and cart data no longer arrive in the first data layer push. Prepare your measurement setup for the new cache-safe data layer explains why this changed, and How to set up triggers for visitor, device, customer and cart data shows the triggers your tags need.
- Browser, operating system and device data is now collected in the browser using User-Agent Client Hints instead of a bundled PHP library. Safari and Firefox expose less detail than Chrome, so some of these values will be less specific than before.
- If you run a WooCommerce store, go through What GTM4WP 2.0 changes for WooCommerce stores. It lists the seven things to verify in your plugin settings and in your Google Tag Manager container.
Version 2.0 also removes some features that few sites used, among them the weather and geo data integrations and the scroll tracking option, which the built-in Scroll Depth trigger of Google Tag Manager replaces. The changelog lists all removals.
Updated documentation
I updated the documentation on this site ahead of the release. The pages now describe 2.0, and where 1.x behaved differently, the older behavior is marked in the text, so the same page serves you on both versions. The WooCommerce guides also link a rebuilt container template that you can import into Google Tag Manager with the variables, triggers and tags they describe.
- Google Analytics 4 ecommerce tracking for WooCommerce
- Google Ads conversion tracking for WooCommerce
- Google Ads dynamic remarketing for WooCommerce
- Enhanced Conversions for Google Ads with WooCommerce
- WooCommerce settings reference, a new page that documents every option in the WooCommerce section of the plugin
- How to make your WordPress theme compatible with ecommerce tracking, for theme developers
- Hard code Google Tag Manager parameters in wp-config.php
If something does not work
You can go back to 1.22.5 with a rollback plugin at any time. The old option format is kept in sync while 2.0 runs, so a downgrade keeps your configuration, but please take a backup before you start. Please report problems in the support forum on wordpress.org or on GitHub.
Thank you to everyone who tested the betas and the release candidate and reported problems. Several fixes in this final version came from those reports.
