Skip to content

Tag Manager API API

by googleapis.com

OAuthHTTPSAnalytics
Open documentation ↗

Overview

This API allows clients to access and modify container and tag configuration.

Tag Manager API is an analytics API from googleapis.com. Requests are authenticated with OAuth. It is served over HTTPS. Its OpenAPI description documents 52 endpoints.

At a glance

Authentication
OAuth
HTTPS
Yes
CORS
Unknown
Category
Analytics
Base URL
https://tagmanager.googleapis.com/
Version
v2
Endpoints
52
Spec updated
2023-04-06

Make a first request

Replace the placeholders; the documentation says exactly where credentials go.

cURL
curl -X GET "https://tagmanager.googleapis.com/tagmanager/v2/accounts" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN"
JavaScript
const response = await fetch("https://tagmanager.googleapis.com/tagmanager/v2/accounts", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
  },
});
const data = await response.json();
console.log(data);
Python
import requests

response = requests.request(
    "GET",
    "https://tagmanager.googleapis.com/tagmanager/v2/accounts",
    headers={
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_TOKEN",
    },
    timeout=30,
)
print(response.json())

Endpoints

MethodPathWhat it does
GET/tagmanager/v2/accountsLists all GTM Accounts that a user has access to.
GET/tagmanager/v2/accounts/containers:lookupLooks up a Container by destination ID.
GET/tagmanager/v2/{parent}/built_in_variablesLists all the enabled Built-In Variables of a GTM Container.
POST/tagmanager/v2/{parent}/built_in_variablesCreates one or more GTM Built-In Variables.
GET/tagmanager/v2/{parent}/clientsLists all GTM Clients of a GTM container workspace.
POST/tagmanager/v2/{parent}/clientsCreates a GTM Client.
GET/tagmanager/v2/{parent}/containersLists all Containers that belongs to a GTM Account.
POST/tagmanager/v2/{parent}/containersCreates a Container.
GET/tagmanager/v2/{parent}/destinationsLists all Destinations linked to a GTM Container.
POST/tagmanager/v2/{parent}/destinations:linkAdds a Destination to this Container and removes it from the Container to which it is currently linked.
GET/tagmanager/v2/{parent}/environmentsLists all GTM Environments of a GTM Container.
POST/tagmanager/v2/{parent}/environmentsCreates a GTM Environment.
GET/tagmanager/v2/{parent}/foldersLists all GTM Folders of a Container.
POST/tagmanager/v2/{parent}/foldersCreates a GTM Folder.
GET/tagmanager/v2/{parent}/gtag_configLists all Google tag configs in a Container.
POST/tagmanager/v2/{parent}/gtag_configCreates a Google tag config.
GET/tagmanager/v2/{parent}/tagsLists all GTM Tags of a Container.
POST/tagmanager/v2/{parent}/tagsCreates a GTM Tag.
GET/tagmanager/v2/{parent}/templatesLists all GTM Templates of a GTM container workspace.
POST/tagmanager/v2/{parent}/templatesCreates a GTM Custom Template.
GET/tagmanager/v2/{parent}/triggersLists all GTM Triggers of a Container.
POST/tagmanager/v2/{parent}/triggersCreates a GTM Trigger.
GET/tagmanager/v2/{parent}/user_permissionsList all users that have access to the account along with Account and Container user access granted to each of them.
POST/tagmanager/v2/{parent}/user_permissionsCreates a user's Account & Container access.
GET/tagmanager/v2/{parent}/variablesLists all GTM Variables of a Container.
POST/tagmanager/v2/{parent}/variablesCreates a GTM Variable.
GET/tagmanager/v2/{parent}/version_headersLists all Container Versions of a GTM Container.
GET/tagmanager/v2/{parent}/version_headers:latestGets the latest container version header
GET/tagmanager/v2/{parent}/versions:liveGets the live (i.e. published) container version
GET/tagmanager/v2/{parent}/workspacesLists all Workspaces that belong to a GTM Container.
POST/tagmanager/v2/{parent}/workspacesCreates a Workspace.
GET/tagmanager/v2/{parent}/zonesLists all GTM Zones of a GTM container workspace.
POST/tagmanager/v2/{parent}/zonesCreates a GTM Zone.
GET/tagmanager/v2/{path}Gets a user's Account & Container access.
PUT/tagmanager/v2/{path}Updates a user's Account & Container access.
DELETE/tagmanager/v2/{path}Removes a user from the account, revoking access to it and all of its containers.
POST/tagmanager/v2/{path}/built_in_variables:revertReverts changes to a GTM Built-In Variables in a GTM Workspace.
GET/tagmanager/v2/{path}/statusFinds conflicting and modified entities in the workspace.
POST/tagmanager/v2/{path}:combineCombines Containers.
POST/tagmanager/v2/{path}:create_versionCreates a Container Version from the entities present in the workspace, deletes the workspace, and sets the base container version to the newly created version.
POST/tagmanager/v2/{path}:entitiesList all entities in a GTM Folder.
POST/tagmanager/v2/{path}:move_entities_to_folderMoves entities to a GTM Folder.
POST/tagmanager/v2/{path}:move_tag_idMove Tag ID out of a Container.
POST/tagmanager/v2/{path}:publishPublishes a Container Version.
POST/tagmanager/v2/{path}:quick_previewQuick previews a workspace by creating a fake container version from all entities in the provided workspace.
POST/tagmanager/v2/{path}:reauthorizeRe-generates the authorization code for a GTM Environment.
POST/tagmanager/v2/{path}:resolve_conflictResolves a merge conflict for a workspace entity by updating it to the resolved entity passed in the request.
POST/tagmanager/v2/{path}:revertReverts changes to a GTM Zone in a GTM Workspace.
POST/tagmanager/v2/{path}:set_latestSets the latest version used for synchronization of workspaces when detecting conflicts and errors.
GET/tagmanager/v2/{path}:snippetGets the tagging snippet for a Container.
POST/tagmanager/v2/{path}:syncSyncs a workspace to the latest container version by updating all unmodified workspace entities and displaying conflicts for modified entities.
POST/tagmanager/v2/{path}:undeleteUndeletes a Container Version.

Questions

Does the Tag Manager API API need an API key?

Yes. The Tag Manager API API uses OAuth authentication; the documentation explains how to get credentials.

Does the Tag Manager API API support HTTPS?

Yes, the Tag Manager API API is served over HTTPS.

How many endpoints does the Tag Manager API API have?

Its OpenAPI description lists 52 endpoints in version v2. All of them are shown on this page.

What are alternatives to the Tag Manager API API?

Other Analytics APIs include Google Play Integrity API, versionhistory.googleapis.com API, Doc Converter, Perspective Comment Analyzer API, Safe Browsing API.

Compare alternatives →

Google Play Integrity API

Analytics

The Play Integrity API helps you check that you're interacting with your genuine app on a genuine Android device powered by Google Play services. The Play Integrity API has replaced SafetyNet Attestation and Android Device Verification.

OAuth1 endpoints

versionhistory.googleapis.com API

Analytics

Version History API - Prod

No auth4 endpoints

Doc Converter

Analytics

This api converts file formats of OpenXml and OpenOffice documents formats to vector files (e.g., svg)

No auth1 endpoints

Perspective Comment Analyzer API

Analytics

The Perspective Comment Analyzer API provides information about the potential impact of a comment on a conversation (e.g. it can provide a score for the "toxicity" of a comment). Users can leverage the "SuggestCommentScore" method to submit corrections to improve Perspective over time. Users can set the "doNotStore" flag to ensure that all submitted comments are automatically deleted after scores are returned.

OAuth2 endpoints

Safe Browsing API

Analytics

Enables client applications to check web resources (most commonly URLs) against Google-generated lists of unsafe web resources. The Safe Browsing APIs are for non-commercial use only. If you need to use APIs to detect malicious URLs for commercial purposes – meaning “for sale or revenue-generating purposes” – please refer to the Web Risk API.

No auth7 endpoints

Web Fonts Developer API

Analytics

The Google Web Fonts Developer API lets you retrieve information about web fonts served by Google.

No auth1 endpoints

Listed from APIs.guru (CC0).