Actualizar etiqueta en Google Tag Manager, con una API

Reemplaza una etiqueta completa: envía todos los campos que quieras conservar, tal como los devuelve Get tag, con los cambios, porque un campo omitido se borra. Pon paused en true para detener una etiqueta sin eliminarla. El cambio solo llega al sitio después de Create version y Publish version.

Identificador
google_tag_manager_update_tag

La llamada

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>"
  }
}

Tu sistema envía el id de la conexión de tu cliente y los argumentos de la tool. Los headers son los mismos de toda la API de Connect: el token de tu producto y el token de tu cliente.

Parámetros

Las descripciones de los parámetros siguen la documentación oficial de la app, en inglés.

ParámetroTipoObligatorioDescripción
accountIdstringSíAccount id from List accounts.
containerIdstringSíContainer id from List containers: the number in containerId, not the GTM- code of publicId.
workspaceIdstringSíWorkspace id from List workspaces.
tagIdstringSíTag id from List tags.
fingerprintstringNoThe fingerprint from Get tag: if the tag changed since then, Google refuses the update.
namestringSíName of the tag in Tag Manager.
typestringSíKind 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.Valores: 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.

Conexiones posibles

Tu cliente conecta su cuenta de Google Tag Manager una sola vez, con uno de los modos de abajo. La misma conexión sirve para todas las tools del toolkit.

OAuth con la app de tu producto

Registras la app OAuth de tu producto una sola vez, con POST /api/merchants/credentials/google_tag_manager, y tu cliente autoriza la cuenta en una pantalla de consentimiento. Connect renueva el token cuando está por vencer.

La respuesta

Si la llamada tiene éxito, Connect conserva el status y el cuerpo de la respuesta de la app. Los errores HTTP devueltos por la app usan el objeto {error, api_error}; la autenticación o validación pueden fallar antes de la ejecución. El header X-Toolkit-Execution-Id identifica la ejecución registrada, disponible en GET /api/tools/executions/{uuid}.

Lista para agentes de IA

El input de esta tool es un JSON Schema, disponible en GET /api/tools/google_tag_manager_update_tag. Se convierte en la definición de tool de tu agente sin conversión.

Otras tools de Google Tag Manager

Ver las 13 tools

Toolkits de la misma categoría

Ver los 100 toolkits

Mira Connect aplicado a tu producto.

Pruébalo durante 15 días sin tarjeta, o cuéntale tu caso a nuestro equipo.