GTM Kit 2.24: AI assistants can change your settings, with your confirmation
GTM Kit 2.24.0 lets an AI assistant do more than read how GTM Kit is set up: it can now change a short list of settings, and every change goes through a preview you confirm. The release also ties product variations to their parent product in the data layer, puts GTM Kit in the WordPress command palette, and fixes how searches from WooCommerce’s Product Search block are counted.
What changed
AI assistants can change a short list of settings
GTM Kit 2.21 let AI assistants connected through the WordPress Abilities API read GTM Kit’s configuration, consent defaults and tracking health. 2.24 adds two abilities that change settings:
- The assistant first asks for a preview. GTM Kit validates the change, shows what would be saved and any side effects, and returns a one-time confirmation code.
- The change is applied only when the assistant sends that code back. The code is single-use, expires after five minutes, is tied to your user, and is refused if the settings changed in the meantime.
Assistants that reach your site through the MCP Adapter ask you before applying. We tested this end to end, including on stores where WooCommerce or WP Rocket bundle an older copy of the adapter. On those stores GTM Kit’s abilities were hidden before this release; they are now visible on every adapter version we tested.
What an assistant can change: the container ID, the data layer name, the server-side tagging domain, the Google tag gateway, the Consent Mode defaults, and the WooCommerce, Contact Form 7 and Easy Digital Downloads integrations. It can never change the GTM environment settings, the Stape loader or a licence key.
This is off by default. Only users who can change GTM Kit’s settings on the settings screen can use the write abilities, so a capability you have tightened with gtmkit_admin_capability applies here too. Turn them on with a filter:
add_filter( 'gtmkit_write_abilities_enabled', '__return_true' );
The assistant uses the same save path as the settings screen, so the same validation applies. See AI assistant abilities for the full list.
The consent status an assistant reads, and the one Site Health checks, now reports what a new visitor gets, not the consent of the administrator who is looking.
Variations carry their parent product’s ID
Product variations in the data layer now include item_group_id: the parent product’s ID, in the same format as item_id (so the parent’s SKU when you track by SKU). A variation can now be tied back to its product in reports and matched against Merchant Center feeds, which group variants the same way.
GTM Kit in the command palette
Press Ctrl+K (Cmd+K on a Mac) on any wp-admin screen and type “GTM Kit” to open any settings section, the setup wizard, or Google Tag Manager.
Product Search is counted correctly
- A search from WooCommerce’s Product Search block is counted once. Block themes counted it twice, and classic themes lost it when engagement search tracking was off.
- A search with a single match, which WooCommerce sends straight to the product page, is now counted.
- Searches from the new version of Product Search, which WooCommerce now adds as a variation of the WordPress Search block, are counted too.
Other fixes
- Saving settings no longer fails when a switch was stored as the text “true” or “false”, which can happen when a setting is changed outside the settings screen.
- The data layer name is checked when you save it, by you or by an assistant. A name that is not a valid JavaScript name is refused instead of breaking the container on every page. When an assistant previews a rename, it warns that other scripts using the old name need updating.
- Importing from GTM4WP brings over a server-side domain that uses GTM4WP’s default script path.
- The Stape loader notice also appears when a saved loader no longer matches your settings.
- Site Health’s consent advice is clearer.
Developer notes
gtmkit_write_abilities_enabled(filter, defaultfalse): switches on the write abilities.gtmkit_abilities_writable_settings(filter): add settings an assistant may change. Add-only; the GTM environment, Stape loader and licence keys are always removed.gtmkit_settings_changed_by_ability(action): fires after an assistant’s change is saved.item_group_idon variation items in every e-commerce event that carries items.
Upgrade notes
- Nothing changes on update. Write abilities stay off until you add the filter.
- If you send variation items to a feed or a custom tag,
item_group_idis a new field; existing fields are unchanged.