Update tag with the Google Tag Manager API

Replaces a whole tag: send every field to keep, as Get tag returns it, with the changes, because a field left out is cleared. Set paused to true to stop a tag without deleting it. The change reaches the site only after Create version and Publish version.

Identifier
google_tag_manager_update_tag

The request

POST https://connect.reportei.com/api/tools/google_tag_manager_update_tag/execute
Authorization: Bearer <merchant token>
x-customer-token: <customer token>
Content-Type: application/json
Accept: application/json

{
  "customer_toolkit": "<connection UUID>",
  "arguments": {
    "accountId": "<accountId>",
    "containerId": "<containerId>",
    "workspaceId": "<workspaceId>",
    "tagId": "<tagId>",
    "name": "<name>",
    "type": "<type>"
  }
}

Your system sends your customer's connection id and the tool arguments. The headers are the same as the rest of the Connect API: your product's token and your customer's token.

Parameters

ParameterTypeRequiredDescription
accountIdstringYesAccount id from List accounts.
containerIdstringYesContainer id from List containers: the number in containerId, not the GTM- code of publicId.
workspaceIdstringYesWorkspace id from List workspaces.
tagIdstringYesTag id from List tags.
fingerprintstringNoThe fingerprint from Get tag: if the tag changed since then, Google refuses the update.
namestringYesName of the tag in Tag Manager.
typestringYesKind of tag, such as html for Custom HTML. For other kinds, copy type and parameter from a tag of the same kind with Get tag.
parameterarrayNoSettings of the tag, which depend on its type. A Custom HTML tag takes a template parameter with key html and the code in value.
firingTriggerIdarrayNoIds of the triggers that fire the tag, from List triggers or Create trigger. The tag fires when any of them is true.
blockingTriggerIdarrayNoIds of the triggers that block the tag, from List triggers. While any of them is true, the tag does not fire.
pausedbooleanNotrue keeps the tag from firing without deleting it.
tagFiringOptionstringNoHow often the tag fires: unlimited, once per event or once per page load.Values: unlimited, oncePerEvent, oncePerLoad
notesstringNoNotes about the tag.
liveOnlybooleanNotrue fires the tag only in the live environment, not in preview.
priorityobjectNoFiring priority as an integer parameter: tags with a higher value fire first. The default is 0.
scheduleStartMsstringNoStart of the firing schedule, in milliseconds since 1970, as text.
scheduleEndMsstringNoEnd of the firing schedule, in milliseconds since 1970, as text.
parentFolderIdstringNoFolder id of the tag, from Get tag.
consentSettingsobjectNoConsent the tag checks before firing.
monitoringMetadataobjectNoA map parameter with key and value pairs added to the event data for tag monitoring. Its entries are template parameters without variables.
monitoringMetadataTagNameKeystringNoKey under which the tag name goes in monitoringMetadata. Empty leaves it out.
setupTagarrayNoTag that fires before this one.
teardownTagarrayNoTag that fires after this one.

Supported connections

Your customer connects their Google Tag Manager account once, with one of the modes below. The same connection serves every tool of the toolkit.

OAuth with your product's app

You register your product's OAuth app once, with POST /api/merchants/credentials/google_tag_manager, and your customer authorizes the account on a consent screen. Connect renews the token when it is about to expire.

The response

On success, Connect preserves the app's response status and body. HTTP errors returned by the app use the {error, api_error} envelope; authentication or validation can fail before execution. The X-Toolkit-Execution-Id header identifies the recorded execution, available at GET /api/tools/executions/{uuid}.

Ready for AI agents

This tool's input is a JSON Schema, available at GET /api/tools/google_tag_manager_update_tag. It becomes your agent's tool definition with no conversion.

Other Google Tag Manager tools

See all 13 tools

Toolkits in the same category

See all 100 toolkits

See Connect applied to your product.

Try it for 15 days with no card, or walk our team through your use case.