Crear etiqueta en Google Tag Manager, con una API

Crea una etiqueta en un workspace. Solo llega al sitio después de Create version y Publish version. Sin firingTriggerId la etiqueta nunca se dispara.

Identificador
google_tag_manager_create_tag

La llamada

POST https://connect.reportei.com/api/tools/google_tag_manager_create_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>",
    "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.
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.

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_create_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.