GTM4WP 2.0.0 beta 3 is available for download
The third beta of GTM4WP 2.0 is out. You can download it from GitHub.
Download from here:
https://github.com/duracelltomi/gtm4wp/releases/tag/2.0.0-beta3
What changed since beta 2
Media events
- A media player’s third-party script is now requested only on pages that contain one of its embeds. Enabling a player used to load its script on every page of the site. With every player enabled that meant 288 KB fetched from seven providers on every page view, and it handed those providers each visitor’s IP address on pages with no player at all. The detection works from the finished page, so embeds placed in widgets, block templates, page builders and shortcode output are covered.
- Consent plugins keep control without any rule naming GTM4WP: an embed that is held back until the visitor agrees leaves the tracker nothing to find, so the provider is never contacted. A site that wants a single switch can block the new
gtm4wp-media-gate.jsscript, and the same decision is available server-side through thegtm4wp_media_sdk_blockedfilter. - Every media event now fills all eight of Google Tag Manager’s built-in Video variables, including Video Visible, which reports whether the player was on screen at the moment of the event.
- Native HTML5
<video>and<audio>tracking is a new opt-in player option (experimental). A local file is identified by its file name without any query string, so a cache buster no longer turns the same file into a different video in your reports. - Dailymotion embeds are rebuilt with Dailymotion’s current player, so events report the real video title and channel name. If the player cannot be built, the original embed is restored and simply goes untracked. Spotify and Cloudflare Stream events now report real titles, and VideoPress events carry playback time and duration again.
- The YouTube tracker now loads for every YouTube embed on the page, not only ones found in the post’s stored content. An embed URL carrying a
#fragment (a start-time anchor, for example) is now tracked under the right video.
WooCommerce
- Product pages using the blockified Add to Cart + Options block (block themes, WooCommerce 10.9+) no longer fall back to a full page reload when adding to the cart. The hidden form field the plugin printed is what made WooCommerce disable the interactive form; the product data now travels in a data attribute instead. Reported in #462.
- Enhanced Conversions user data now hashes the way Google matches it. Phone numbers are converted to E.164 using dialling rules generated from Google’s numbering plan data for all 245 territories, and gmail.com / googlemail.com addresses are folded the way Google folds them (dots and
+tags removed) before hashing. A phone number that cannot be placed in E.164 with confidence is left out rather than sent as a hash that could never match. - Product list attribution (the “Persist product list attribution across the funnel” option) now also lands on
view_item, works behind a full-page cache, and covers the product grid blocks, Product Collection and the Cart block’s cross-sells. Every tracked list also reports a stableitem_list_idthat does not change with the site language. - On the order received page, the customer details, the new/returning signals and the Enhanced Conversions data are included only when WooCommerce itself would show that order to the visitor viewing the page. The purchase event, the totals and the items are unchanged.
- The purchase event carries
customer_type(new/returning), the name the GA4 e-commerce reference documents, next to the existingnew_customerboolean that Google Ads reads. - The “Set maximum timeout for select_item event” option now takes effect. The tracker looked it up under the wrong name, so every product-list click used the built-in 2000 ms wait no matter what was configured.
- Cache-safe data layer: the client-delivered values now arrive as three named events (
gtm4wp.visitorData,gtm4wp.customerData,gtm4wp.cartData), each firing only when its own data changed. GTM4WP also loads WooCommerce’s cart-refresh script on stores where WooCommerce would not, so the customer and cart variables arrive on a normal page view instead of never.
Forms
- Contact Form 7 GA4 events:
form_submitnow fires on every submission attempt, following the GA4 Enhanced Measurement definition, and bothform_submitandgenerate_leadcarry aform_statusparameter so accepted and rejected submissions can be told apart in the container. - The form fill events gained an “Only report fields the visitor filled in” option, so tabbing through a form without typing no longer produces a leave event for every field. Both events now also fill Google Tag Manager’s built-in Form variables.
Settings screen
- The settings screen is usable on a phone: the header buttons stack, the section list becomes a search field with a pinned dropdown, the tab strip scrolls sideways and the container table turns into cards.
- Every one of the plugin’s 110 options now has a help link to the part of gtm4wp.com that documents it, each section links its documentation page from the header, admin notices link straight to the option they are about, and any position on the screen can be bookmarked.
- The tag restriction settings use Google’s current vocabulary (Blocklist / Allowlist selected entities) and the entity list is grouped into Tags, Triggers, Variables and Entity groups. Saved settings are untouched; only the labels changed.
- The “please enter your GTM ID” notice is no longer shown when the container code placement is set to Off, since that placement deliberately leaves the container code out.
Hardening and fixes
- A single value that PHP cannot convert to JSON no longer takes down the whole script block it appears in. The affected value is left out and the rest is written normally, and a purchase whose event could not be written is no longer marked as tracked, so the next page view tries again.
- The plugin’s REST routes refuse cross-site reads however the route address is capitalised.
- The main plugin file refuses to run when requested directly, matching every other PHP file in the plugin.
- The
$gtp4wp_plugin_url,$gtp4wp_plugin_basenameand$gtp4wp_script_pathglobals (a typo spelling inherited from 1.x) are deprecated and will be removed in GTM4WP 2.1. The changelog names the replacements.
How to install it
Download the file named duracelltomi-google-tag-manager-for-wordpress-2.0.0-beta3.zip from the release page. Do not use the source code archives that GitHub generates on the same page, because the compiled scripts are not stored in the repository and those archives will not work as a plugin.
In your WordPress admin, go to Plugins, Add New Plugin, Upload Plugin, and upload the file. WordPress will ask whether to replace the version you have. If you are already running beta 2, install beta 3 over it the same way.
Please test this on a staging copy of your site first. This is a pre-release and I do not recommend it for a production site yet.
The stable release stays 1.22.5
The version served by wordpress.org is still 1.22.5, so nobody receives 2.0 as an automatic update. If you want to go back after testing, install 1.22.5 again, either by uploading it or with a rollback plugin. Your settings are migrated when 2.0 activates and the old option format is kept in sync, so a downgrade keeps your configuration, but please take a backup before you start.
Feedback
If something does not work, or a data layer value is not what you expect, please open an issue so that it can be fixed before the final release:
