GTM Kit 2.22: a consent bridge for banners that run inside Google Tag Manager
GTM Kit 2.22.0 closes a gap for one kind of site: stores whose consent banner runs entirely inside Google Tag Manager, as a tag template, with no WordPress consent plugin. On those sites GTM Kit could not see the visitor’s answer through any documented interface. A new Consent Bridge tag fixes that. The release also adds the installed add-on versions to the system data you share with support, fixes variation prices on some themes, and gives developers two new filters for the items in cart, checkout and purchase events.
What changed
A consent bridge for banners that run inside Google Tag Manager
Since 2.21, GTM Kit adds the buyer’s email, phone, name and address to the purchase event only once the visitor has granted ad_storage and ad_user_data. To make that decision it reads consent from its own data layer, from dataLayer, and from the consent state Google Tag Manager holds.
That last source is the one a GTM-based banner (Cookiebot, CookieYes or Usercentrics set up as a GTM tag, for example) writes to. Reading it relied on an internal Google structure that Google does not document and could change at any time. If it changed, those sites would quietly fall back to “no consent found”.
The GTM Kit Consent Bridge is a small tag for your container. It reads the consent state through Google Tag Manager’s documented template interfaces and passes it to GTM Kit on the page. GTM Kit’s purchase consent check reads the bridge first. Without the bridge, GTM Kit keeps reading consent the way it did in 2.21, so nothing changes for sites that do not install it.
Do you need it? Only when both are true: your consent banner runs inside Google Tag Manager, and no WordPress plugin passes consent to your site. If you use a consent plugin with WP Consent API support, or GTM Kit’s own Consent Mode settings, you do not need it.
Do not install it on a site without a consent banner. Google Tag Manager reports a consent type that nobody has set as granted, so there the bridge would tell GTM Kit that every visitor had consented.
Install it:
- Open GTM Kit → GTM Templates (the Template Assistant).
- Select GTM Kit Consent Bridge under Consent Bridge and download the container file.
- In Google Tag Manager, go to Admin → Import Container, choose the file and Merge it into your workspace.
- Check that [GTM Kit] Consent Bridge fires on Initialization – All Pages, and that your consent banner’s own tag fires earlier, on Consent Initialization – All Pages (the major banner templates already do). Preview, then publish.
If your banner fires later than the bridge, the details stay safe but can arrive slower: GTM Kit does not trust an early “granted” until Google Tag Manager confirms a consent setting, and otherwise waits up to three seconds as before.
The bridge only reads. It does not set consent defaults, change the visitor’s choice, send anything to Google or push anything to the data layer. Your banner stays in charge of Consent Mode.
Support data names the add-on versions
When you share system data with GTM Kit support, it now includes the installed versions of GTM Kit Premium and the GTM Kit Woo Add-On, so support can see which build your site runs without asking. The anonymised site data is unchanged.
Variation prices on themes that load variations over admin-ajax
Some themes load product variations over admin-ajax instead of the WooCommerce variation form. Those variations now carry the same tax-resolved price GTM Kit adds to every other variation, so the variation events those themes send report the same price as the rest of the data layer.
Developer notes
- New filter
gtmkit_datalayer_cart_item_data($item, $cart_item, $cart_item_key, $event_context). Runs for each item in the cart and checkout events, with the WooCommerce cart line next to the item, so you can add data stored on the line. Return the item. - New filter
gtmkit_datalayer_order_item_data($order_item, $item, $order). The same for each item in the purchase event, with the WooCommerce order line and the order. window.gtmkit.wc.cartSnapshot(get()andset( items )). WooCommerce block tracking now keeps the last reported cart here, as normalised cart items. If your script reports Store API cart changes too, compare againstget()and record what you reported withset(), so a change is reported once, by whichever script sees it first.window.gtmkit.consentBridgeholds the consent the bridge reported (state, one entry per consent type,'granted'or'denied'), and agtmkit:consent:bridgedevent fires onwindoweach time the bridge reports a consent type (detail:type,value,basis). It exists whether or not GTM Kit’s own Consent Mode is on. Read it; do not write to it.
Upgrade notes
- Nothing changes on update. The bridge does something only after you add it to your container.
- If your consent banner runs inside Google Tag Manager and you send customer details with the purchase event, add the bridge.