Créer une balise avec l'API Google Tag Manager

Crée une balise dans un workspace. Elle n'atteint le site qu'après Create version et Publish version. Sans firingTriggerId la balise ne se déclenche jamais.

Identifiant
google_tag_manager_create_tag

L'appel

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

Votre système envoie l'id de la connexion de votre client et les arguments de la tool. Les headers sont les mêmes que pour toute l'API Connect : le token de votre produit et celui de votre client.

Paramètres

Les descriptions des paramètres suivent la documentation officielle de l'app, en anglais.

ParamètreTypeObligatoireDescription
accountIdstringOuiAccount id from List accounts.
containerIdstringOuiContainer id from List containers: the number in containerId, not the GTM- code of publicId.
workspaceIdstringOuiWorkspace id from List workspaces.
namestringOuiName of the tag in Tag Manager.
typestringOuiKind 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.
parameterarrayNonSettings of the tag, which depend on its type. A Custom HTML tag takes a template parameter with key html and the code in value.
firingTriggerIdarrayNonIds of the triggers that fire the tag, from List triggers or Create trigger. The tag fires when any of them is true.
blockingTriggerIdarrayNonIds of the triggers that block the tag, from List triggers. While any of them is true, the tag does not fire.
pausedbooleanNontrue keeps the tag from firing without deleting it.
tagFiringOptionstringNonHow often the tag fires: unlimited, once per event or once per page load.Valeurs : unlimited, oncePerEvent, oncePerLoad
notesstringNonNotes about the tag.

Connexions possibles

Votre client connecte son compte Google Tag Manager une seule fois, avec l'un des modes ci-dessous. La même connexion sert à toutes les tools du toolkit.

OAuth avec l'app de votre produit

Vous enregistrez une fois l'app OAuth de votre produit, avec POST /api/merchants/credentials/google_tag_manager, et votre client autorise le compte sur un écran de consentement. Connect renouvelle le token avant son expiration.

La réponse

En cas de succès, Connect conserve le statut et le corps de la réponse de l'app. Les erreurs HTTP renvoyées par l'app utilisent l'objet {error, api_error} ; l'authentification ou la validation peuvent échouer avant l'exécution. Le header X-Toolkit-Execution-Id identifie l'exécution enregistrée, consultable avec GET /api/tools/executions/{uuid}.

Prête pour les agents IA

L'input de cette tool est un JSON Schema, disponible via GET /api/tools/google_tag_manager_create_tag. Il devient la définition de tool de votre agent sans conversion.

Autres tools Google Tag Manager

Voir les 13 tools

Toolkits de la même catégorie

Voir les 100 toolkits

Voyez Connect appliqué à votre produit.

Essayez-le pendant 15 jours sans carte, ou présentez votre cas à notre équipe.