Skip to content

fix(google-tag-manager): keep untouched fields on update, add create_version - #568

Open
yuriassuncx wants to merge 1 commit into
mainfrom
fix/gtm-update-merge
Open

yuriassuncx wants to merge 1 commit into
mainfrom
fix/gtm-update-merge

Conversation

@yuriassuncx

@yuriassuncx yuriassuncx commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The GTM API's PUT replaces the whole entity. update_tag, update_trigger and update_variable forwarded only a few fields, so every update silently deleted the rest. Lost fields included:

  • consentSettings, which holds the Consent Mode/LGPD check of tags that need consent;
  • parentFolderId;
  • setupTag/teardownTag;
  • priority and the schedule.

get_tag also hid consentSettings, so callers could not notice.

Found while preparing the Grupo Dass containers (GTM-TL4DML26, GTM-P8Q5HMS, GTM-M6QJTLF). Tags lost their folder on update, and tags that need consent could not be edited safely.

Fix

  • GTMClient.mergedPut: reads the current entity, overlays only the fields the caller set (undefined is skipped), then sends the PUT. Used by all three update methods.
  • Tag tools: get/list/update return consentSettings. update_tag accepts consentSettings and parentFolderId.
  • Variable formatValue: typed as the options object GTM returns. The old Parameter schema made list_variables/get_variable fail output validation.
  • New create_version tool: workspaces/{id}:create_version. It never publishes.

Validation

  • bun test: new gtm-client.test.ts checks that an update keeps consentSettings, parentFolderId and setupTag, and drops undefined keys.
  • bun run check: no new errors. The existing @decocms/bindings EventBusBindingClient error also happens on main.

🤖 Generated with Claude Code


Summary by cubic

Fixes GTM tag, trigger, and variable updates silently deleting fields the tool didn't forward. The GTM API's PUT replaces the whole entity, so every update dropped the consent settings, folder, setup/teardown tags, priority, and schedule.

  • Update methods now merge the caller's input over the current entity, keeping untouched fields.
  • Tag get/list/update expose consentSettings; update_tag accepts consentSettings and parentFolderId.
  • Variable formatValue is now the options object GTM returns, fixing list_variables/get_variable output validation.
  • Added a create_version tool that creates a container version without publishing.

Written for commit 6ed2851. Summary will update on new commits.

View guided diff Turn on auto-fix

…version

GTM's PUT replaces the whole entity, so update_tag/update_trigger/update_variable
silently deleted every field the tool did not forward: consentSettings (the
Consent Mode/LGPD check), parentFolderId, setupTag/teardownTag, priority and
schedule. The client now reads the current entity and overlays only the fields
the caller set.

Also:
- get/list/update tag expose consentSettings; update_tag accepts it and parentFolderId
- variable formatValue is an options object, not a Parameter; the old schema made
  list_variables/get_variable fail output validation
- create_version tool (creates a version from a workspace, never publishes)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/airtable October 29, 2026 03:15 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/blog-generator October 29, 2026 03:15 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/content-scraper October 29, 2026 03:15 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/deco-llm October 29, 2026 03:15 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/deco-news-weekly-digest October 29, 2026 03:15 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/discord-read October 29, 2026 03:15 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/figma-mcp October 29, 2026 03:15 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/flux October 29, 2026 03:15 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/google-analytics October 29, 2026 03:15 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/google-big-query October 29, 2026 03:16 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/google-calendar October 29, 2026 03:16 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/google-calendar-sa October 29, 2026 03:16 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/google-drive October 29, 2026 03:16 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/google-meet October 29, 2026 03:16 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/google-search-console October 29, 2026 03:16 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/google-sheets October 29, 2026 03:16 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/google-slides October 29, 2026 03:16 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/google-tag-manager October 29, 2026 03:16 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/google-workspace October 29, 2026 03:16 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/grafana October 29, 2026 03:16 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/grain October 29, 2026 03:16 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/hyperdx October 29, 2026 03:16 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/magento October 29, 2026 03:16 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/meta-ads October 29, 2026 03:16 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/nanobanana October 29, 2026 03:17 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/object-storage October 29, 2026 03:17 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/pandadoc October 29, 2026 03:17 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/perplexity October 29, 2026 03:17 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/registry October 29, 2026 03:17 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/shopify October 29, 2026 03:17 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/slack-mcp October 29, 2026 03:17 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/veo October 29, 2026 03:17 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/vtex October 29, 2026 03:17 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/vtex-docs October 29, 2026 03:17 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/wake October 29, 2026 03:17 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/whatsappagent October 29, 2026 03:17 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/youtube-channel-admin October 29, 2026 03:17 In progress
@deco-hosting
deco-hosting Bot requested a deployment to preview/pr-568/youtube-search October 29, 2026 03:17 In progress

This branch is being deployed

38 in progress deployments
preview/pr-568/youtube-search — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/youtube-channel-admin — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/whatsappagent — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/wake — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/vtex-docs — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/vtex — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/veo — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/slack-mcp — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/shopify — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/registry — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/perplexity — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/pandadoc — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/object-storage — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/nanobanana — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/meta-ads — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/magento — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/hyperdx — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/grain — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/grafana — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/google-workspace — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/google-tag-manager — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/google-slides — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/google-sheets — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/google-search-console — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/google-meet — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/google-drive — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/google-calendar-sa — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/google-calendar — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/google-big-query — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/google-analytics — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/flux — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/figma-mcp — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/discord-read — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/deco-news-weekly-digest — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/deco-llm — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/content-scraper — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/blog-generator — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
preview/pr-568/airtable — 6ed28512 Deployed Oct 29, 2026 by deco-hosting[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant