Crear activador en Google Tag Manager, con una API

Crea un activador en un workspace y devuelve su triggerId. Un activador de pageview sin filter se dispara en todas las páginas. Una condición compara una variable, como {{Page URL}}, con un valor; las variables integradas de clics y formularios, como {{Click ID}}, solo funcionan una vez activadas en el workspace, algo que este toolkit no hace.

Identificador
google_tag_manager_create_trigger

La llamada

POST https://connect.reportei.com/api/tools/google_tag_manager_create_trigger/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": "pageview"
  }
}

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 trigger in Tag Manager.
typestringSíEvent that fires the trigger: pageview, domReady or windowLoaded for page loads, customEvent for a dataLayer event, click for any element, linkClick for links only, formSubmission, historyChange, timer, scrollDepth, elementVisibility, youTubeVideo, jsError, init or consentInit.Valores: pageview, domReady, windowLoaded, customEvent, click, linkClick, formSubmission, historyChange, timer, scrollDepth, elementVisibility, youTubeVideo, jsError, init, consentInit
filterarrayNoConditions that must all be true for the trigger to fire.
customEventFilterarrayNoOnly customEvent: conditions on the event, such as {{_event}} equals the event name pushed to the dataLayer.
autoEventFilterarrayNoOnly the triggers that listen to the page, such as linkClick, formSubmission and timer: conditions that enable the listener on a page, usually on {{Page URL}}.
waitForTagsobjectNoOnly formSubmission and linkClick: true holds the submit or the link until the tags fire.
waitForTagsTimeoutobjectNoOnly formSubmission and linkClick: how long to hold, in milliseconds.
checkValidationobjectNoOnly formSubmission and linkClick: true fires the tags only if the submit or the click is not canceled by the page, such as by a failed validation.
eventNameobjectNoOnly timer: name of the event the timer pushes.
intervalobjectNoOnly timer: milliseconds between events.
limitobjectNoOnly timer: how many events to push at most.
parameterarrayNoOther settings of the trigger, such as the scroll percentages of a scrollDepth trigger or the element of an elementVisibility trigger.
notesstringNoNotes about the trigger.

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