For Agents
Programmatically create and publish Google Tag Manager containers, tags, triggers, variables, and workspaces, and manage user permissions across GTM accounts.
Get started with Tag Manager API in minutes using your preferred integration method.
# Add to your MCP client config (Claude Desktop, Cursor, Windsurf)
{
"jentic": {
"url": "https://api.jentic.com/mcp",
"auth": "oauth"
}
}
# Then ask your agent:
"create a Google Tag Manager tag"
# → Jentic returns the GET /events tool with parameter schema, agent executes.What an agent can do with Tag Manager API API.
Create, update, and publish container versions across GTM workspaces
Provision tags, triggers, and variables programmatically across containers
Replicate environments and promote container versions between staging and production
Audit user permissions and assign roles at the account or container level
GET STARTED
Use for: I need to publish a new container version for our GTM property, Create a custom HTML tag in a Google Tag Manager workspace, List all triggers configured in a container, Set up a new GTM environment for staging
Not supported: Does not handle event collection, report querying, or destination platform configuration — use for managing GTM containers, tags, triggers, and versions only.
The Google Tag Manager API gives programmatic access to GTM accounts, containers, workspaces, tags, triggers, variables, environments, and version history. It lets ops and analytics teams script tag deployments, audit container configurations, replicate environments across properties, and publish container versions without using the GTM web UI. Every change made through the API is captured in workspace history and can be promoted through environments for staged rollouts.
List and inspect built-in variables, clients, and destinations attached to a container
Reauthorize, sync, or resolve workspace conflicts before publishing
Patterns agents use Tag Manager API API for, with concrete tasks.
★ Programmatic Tag Deployment Across Properties
Marketing engineering teams managing tags across dozens of brand properties use the Tag Manager API to standardise tag definitions, push the same conversion-pixel configuration into every container, and audit drift. Instead of clicking through the GTM UI per property, the team scripts the create-tag, create-trigger, and create-version flow and runs it as part of their release pipeline.
Iterate over a list of GTM container IDs and POST to /tagmanager/v2/{parent}/tags to create the same Google Ads conversion tag in each, then create a version and publish.
Staged Environment Promotion
Large publishers run tags in a staging environment before promoting to production. The API lets engineering create a new workspace, modify tags, create a container version, and reauthorize a staging environment to point at it. Once QA passes, the same version is republished to the live environment in a single API call rather than reconfiguring tags by hand.
Create a workspace, add or modify tags via /tagmanager/v2/{parent}/tags, call workspace create_version, then reauthorize the production environment with the new container_version_id.
Container Configuration Audit
Compliance and privacy teams need an inventory of every tag firing on a property and which user has permission to modify them. The API exposes complete tag, trigger, and variable listings plus user-permission resources, enabling automated audit reports that flag unauthorised tags, third-party scripts without consent triggers, or stale custom HTML.
List all containers under an account, then for each container list tags, triggers, and user_permissions, and emit a CSV flagging any custom-HTML tag without an associated consent trigger.
Agent-Driven Tag Updates via Jentic
An AI agent embedded in a marketing workflow receives a request to swap an analytics tag's tracking ID across all brand containers. Through Jentic, the agent searches for the tag-update operation, loads the schema, iterates over container IDs, and publishes a new version per container. Jentic handles the OAuth refresh and credential isolation across the multi-step workflow.
Through Jentic, search 'update a Google Tag Manager tag', load the PUT tag operation, and execute it for each container ID, then publish a new version.
55 endpoints — the google tag manager api gives programmatic access to gtm accounts, containers, workspaces, tags, triggers, variables, environments, and version history.
METHOD
PATH
DESCRIPTION
/tagmanager/v2/accounts
List GTM accounts the user has access to
/tagmanager/v2/{parent}/containers
List containers under an account
/tagmanager/v2/{parent}/containers
Create a new container
/tagmanager/v2/{parent}/clients
Create a client in a workspace
/tagmanager/v2/{parent}/built_in_variables
List built-in variables enabled in a workspace
/tagmanager/v2/{parent}/destinations
List destinations linked to a container
/tagmanager/v2/accounts
List GTM accounts the user has access to
/tagmanager/v2/{parent}/containers
List containers under an account
/tagmanager/v2/{parent}/containers
Create a new container
/tagmanager/v2/{parent}/clients
Create a client in a workspace
/tagmanager/v2/{parent}/built_in_variables
List built-in variables enabled in a workspace
Three things that make agents converge on Jentic-routed access.
Credential isolation
OAuth 2.0 tokens and refresh tokens for Google Tag Manager are stored encrypted in the Jentic vault. Agents call GTM operations through Jentic and never see raw access tokens or scope-grant prompts in their context.
Intent-based discovery
Agents search by intent ('publish a tag manager container', 'create a GTM trigger') and Jentic returns the matching v2 operation with its full input schema, including parent path templating.
Time to first call
Direct GTM API integration: 3-7 days for OAuth, scope juggling, workspace conflict handling, and pagination. Through Jentic: under 1 hour per operation.
Alternatives and complements available in the Jentic catalogue.
Google Analytics API
Read reporting data from the analytics destinations that GTM tags send events to
Use Tag Manager to deploy the GA tracking tags; use Analytics API to query the resulting reports.
Google Analytics Admin API
Manage GA4 properties, data streams, and accounts that GTM tags target
Pair with Tag Manager to fully automate onboarding a new property — create the GA4 stream, then deploy the GTM tag pointing at it.
Google Analytics Data API
Run GA4 reports against the data collected via GTM-deployed tags
Use after Tag Manager has deployed tracking tags to retrieve the resulting event and conversion data.
Specific to using Tag Manager API API through Jentic.
What authentication does the Tag Manager API use?
Google Tag Manager API uses OAuth 2.0 with seven scopes including tagmanager.edit.containers, tagmanager.publish, tagmanager.manage.accounts, and tagmanager.manage.users. Pick the narrowest scope your workflow needs — read-only audits should use tagmanager.readonly. Through Jentic, OAuth tokens and refresh tokens are stored encrypted and rotated automatically; the agent never sees the raw token.
Can I publish a new container version with the Tag Manager API?
Yes. Create or modify entities in a workspace under /tagmanager/v2/{parent}, then call the workspace create_version action and finally publish the resulting version. The publish operation activates the version in the live environment and increments the container's published version pointer.
What are the rate limits for the Tag Manager API?
Google enforces a per-project quota of 25 read requests per second and 25 write requests per second by default, plus a separate per-user limit. Bulk operations should be paginated and back off on 429 responses; quota increases can be requested through the Google Cloud Console for high-volume publishers.
How do I create a tag through Jentic?
Search Jentic for 'create a Google Tag Manager tag', load the schema for POST /tagmanager/v2/{parent}/tags, and execute it with your account, container, and workspace IDs plus the tag definition. Jentic handles the OAuth flow and returns the created tag resource. Get started at https://app.jentic.com/sign-up.
Does the Tag Manager API support server-side tagging containers?
Yes. Server-side containers are managed through the same v2 API surface — the container's usageContext field indicates whether it is a web, iOS, Android, AMP, or server container. Tags, triggers, and variables specific to server-side templates are configured via the standard tag and trigger endpoints under the workspace.
Can I manage user permissions for a GTM account via the API?
Yes. The user_permissions resource under /tagmanager/v2/accounts/{accountId}/user_permissions supports listing, creating, updating, and revoking access at both the account and container level. This is the recommended way to script onboarding and offboarding when many editors share a GTM property.
/tagmanager/v2/{parent}/destinations
List destinations linked to a container