Tag Manager API

借助此 API,客户端可以访问和修改容器和代码配置。

服务:tagmanager.googleapis.com

如要调用此服务,我们建议您使用 Google 提供的客户端库。如果您的应用需要使用您自己的库来调用此服务,则在发出 API 请求时应使用以下信息。

发现文档

发现文档是用于说明和使用 REST API 的机器可读规范。它用于构建客户端库、IDE 插件以及与 Google API 交互的其他工具。一项服务可能会提供多个发现文档。此服务提供了以下发现文档:

服务端点

服务端点是指定 API 服务的网络地址的基本网址。一项服务可能有多个服务端点。此服务具有以下服务端点,下面的所有 URI 都与此服务端点相关:

  • https://tagmanager.googleapis.com

REST 资源:v2.accounts

方法
get GET /tagmanager/v2/{path}
获取 GTM 账号。
list GET /tagmanager/v2/accounts
列出用户有权访问的所有 GTM 账号。
update PUT /tagmanager/v2/{path}
更新 GTM 账号。

REST 资源:v2.accounts.containers

方法
combine POST /tagmanager/v2/{path}:combine
组合容器。
create POST /tagmanager/v2/{parent}/containers
创建容器。
delete DELETE /tagmanager/v2/{path}
删除容器。
get GET /tagmanager/v2/{path}
获取容器。
list GET /tagmanager/v2/{parent}/containers
列出属于 GTM 账号的所有容器。
lookup GET /tagmanager/v2/accounts/containers:lookup
按目标 ID 或代码 ID 查找容器。
move_tag_id POST /tagmanager/v2/{path}:move_tag_id
将代码 ID 从容器中移出。
snippet GET /tagmanager/v2/{path}:snippet
获取容器的代码植入代码段。
update PUT /tagmanager/v2/{path}
更新容器。

REST 资源:v2.accounts.containers.destinations

方法
get GET /tagmanager/v2/{path}
获取目的地。
link POST /tagmanager/v2/{parent}/destinations:link
将目标添加到此容器,并将其从当前关联的容器中移除。
list GET /tagmanager/v2/{parent}/destinations
列出与 GTM 容器关联的所有目标位置。

REST 资源:v2.accounts.containers.environments

方法
create POST /tagmanager/v2/{parent}/environments
创建 GTM 环境。
delete DELETE /tagmanager/v2/{path}
删除 GTM 环境。
get GET /tagmanager/v2/{path}
获取 GTM 环境。
list GET /tagmanager/v2/{parent}/environments
列出 GTM 容器的所有 GTM 环境。
reauthorize POST /tagmanager/v2/{path}:reauthorize
为 GTM 环境重新生成授权代码。
update PUT /tagmanager/v2/{path}
更新 GTM 环境。

REST 资源:v2.accounts.containers.version_headers

方法
latest GET /tagmanager/v2/{parent}/version_headers:latest
获取最新的容器版本标头
list GET /tagmanager/v2/{parent}/version_headers
列出 GTM 容器的所有容器版本。

REST 资源:v2.accounts.containers.versions

方法
delete DELETE /tagmanager/v2/{path}
删除容器版本。
get GET /tagmanager/v2/{path}
获取容器版本。
live GET /tagmanager/v2/{parent}/versions:live
获取实际(即
publish POST /tagmanager/v2/{path}:publish
发布容器版本。
set_latest POST /tagmanager/v2/{path}:set_latest
设置在检测到冲突和错误时用于同步工作区的最新版本。
undelete POST /tagmanager/v2/{path}:undelete
恢复删除的容器版本。
update PUT /tagmanager/v2/{path}
更新容器版本。

REST 资源:v2.accounts.containers.workspaces

方法
create POST /tagmanager/v2/{parent}/workspaces
创建工作区。
create_version POST /tagmanager/v2/{path}:create_version
根据工作区中显示的实体创建容器版本,删除工作区,并将基础容器版本设置为新建的版本。
delete DELETE /tagmanager/v2/{path}
删除工作区。
get GET /tagmanager/v2/{path}
获取工作区。
getStatus GET /tagmanager/v2/{path}/status
查找工作区中存在冲突的已更改实体。
list GET /tagmanager/v2/{parent}/workspaces
列出属于 GTM 容器的所有工作区。
quick_preview POST /tagmanager/v2/{path}:quick_preview
根据提供的工作区中的所有实体创建虚构的容器版本,以此方式快速预览工作区。
resolve_conflict POST /tagmanager/v2/{path}:resolve_conflict
将工作区实体更新为请求中传递的已解决冲突的实体,从而为工作区实体解决合并冲突。
sync POST /tagmanager/v2/{path}:sync
更新所有未经修改的工作区实体,并显示已修改实体之间的冲突,从而将工作区同步到最新容器版本。
update PUT /tagmanager/v2/{path}
更新工作区。

REST 资源:v2.accounts.containers.workspaces.built_in_variables

方法
create POST /tagmanager/v2/{parent}/built_in_variables
创建一个或多个 GTM 内置变量。
delete DELETE /tagmanager/v2/{path}
删除一个或多个 GTM 内置变量。
list GET /tagmanager/v2/{parent}/built_in_variables
列出 GTM 容器的所有已启用的内置变量。
revert POST /tagmanager/v2/{path}/built_in_variables:revert
还原对 GTM 工作区中 GTM 内置变量的更改。

REST 资源:v2.accounts.containers.workspaces.clients

方法
create POST /tagmanager/v2/{parent}/clients
创建 GTM 客户端。
delete DELETE /tagmanager/v2/{path}
删除 GTM 客户端。
get GET /tagmanager/v2/{path}
获取 GTM 客户端。
list GET /tagmanager/v2/{parent}/clients
列出 GTM 容器工作区的所有 GTM 客户端。
revert POST /tagmanager/v2/{path}:revert
还原对 GTM 工作区中 GTM 客户端的更改。
update PUT /tagmanager/v2/{path}
更新 GTM 客户端。

REST 资源:v2.accounts.containers.workspaces.folders

方法
create POST /tagmanager/v2/{parent}/folders
创建 GTM 文件夹。
delete DELETE /tagmanager/v2/{path}
删除 GTM 文件夹。
entities POST /tagmanager/v2/{path}:entities
列出 GTM 文件夹中的所有实体。
get GET /tagmanager/v2/{path}
获取 GTM 文件夹。
list GET /tagmanager/v2/{parent}/folders
列出容器的所有 GTM 文件夹。
move_entities_to_folder POST /tagmanager/v2/{path}:move_entities_to_folder
将实体移动到 GTM 文件夹。
revert POST /tagmanager/v2/{path}:revert
还原对 GTM 工作区中 GTM 文件夹的更改。
update PUT /tagmanager/v2/{path}
更新 GTM 文件夹。

REST 资源:v2.accounts.containers.workspaces.gtag_config

方法
create POST /tagmanager/v2/{parent}/gtag_config
创建 Google 代码配置。
delete DELETE /tagmanager/v2/{path}
删除 Google 代码配置。
get GET /tagmanager/v2/{path}
获取 Google 代码配置。
list GET /tagmanager/v2/{parent}/gtag_config
列出容器中的所有 Google 代码配置。
update PUT /tagmanager/v2/{path}
更新 Google 代码配置。

REST 资源:v2.accounts.containers.workspaces.tags

方法
create POST /tagmanager/v2/{parent}/tags
创建 GTM 代码。
delete DELETE /tagmanager/v2/{path}
删除 GTM 代码。
get GET /tagmanager/v2/{path}
获取 GTM 代码。
list GET /tagmanager/v2/{parent}/tags
列出容器的所有 GTM 代码。
revert POST /tagmanager/v2/{path}:revert
还原对 GTM 工作区中 GTM 代码的更改。
update PUT /tagmanager/v2/{path}
更新 GTM 代码。

REST 资源:v2.accounts.containers.workspaces.templates

方法
create POST /tagmanager/v2/{parent}/templates
创建 GTM 自定义模板。
delete DELETE /tagmanager/v2/{path}
删除 GTM 模板。
get GET /tagmanager/v2/{path}
获取 GTM 模板。
import_from_gallery POST /tagmanager/v2/{parent}/templates:import_from_gallery
从库中导入 GTM 自定义模板。
list GET /tagmanager/v2/{parent}/templates
列出 GTM 容器工作区的所有 GTM 模板。
revert POST /tagmanager/v2/{path}:revert
还原对 GTM 工作区中 GTM 模板的更改。
update PUT /tagmanager/v2/{path}
更新 GTM 模板。

REST 资源:v2.accounts.containers.workspaces.transformations

方法
create POST /tagmanager/v2/{parent}/transformations
创建 GTM 转换。
delete DELETE /tagmanager/v2/{path}
删除 GTM 转换。
get GET /tagmanager/v2/{path}
获取 GTM 转换。
list GET /tagmanager/v2/{parent}/transformations
列出 GTM 容器工作区的所有 GTM 转换。
revert POST /tagmanager/v2/{path}:revert
还原对 GTM 工作区中 GTM 转换的更改。
update PUT /tagmanager/v2/{path}
更新 GTM 转换。

REST 资源:v2.accounts.containers.workspaces.triggers

方法
create POST /tagmanager/v2/{parent}/triggers
创建 GTM 触发器。
delete DELETE /tagmanager/v2/{path}
删除 GTM 触发器。
get GET /tagmanager/v2/{path}
获取 GTM 触发器。
list GET /tagmanager/v2/{parent}/triggers
列出容器的所有 GTM 触发器。
revert POST /tagmanager/v2/{path}:revert
还原对 GTM 工作区中 GTM 触发器的更改。
update PUT /tagmanager/v2/{path}
更新 GTM 触发器。

REST 资源:v2.accounts.containers.workspaces.variables

方法
create POST /tagmanager/v2/{parent}/variables
创建 GTM 变量。
delete DELETE /tagmanager/v2/{path}
删除 GTM 变量。
get GET /tagmanager/v2/{path}
获取 GTM 变量。
list GET /tagmanager/v2/{parent}/variables
列出容器的所有 GTM 变量。
revert POST /tagmanager/v2/{path}:revert
还原对 GTM 工作区中 GTM 变量的更改。
update PUT /tagmanager/v2/{path}
更新 GTM 变量。

REST 资源:v2.accounts.containers.workspaces.zones

方法
create POST /tagmanager/v2/{parent}/zones
创建 GTM 区域。
delete DELETE /tagmanager/v2/{path}
删除 GTM 区域。
get GET /tagmanager/v2/{path}
获取 GTM 区域。
list GET /tagmanager/v2/{parent}/zones
列出 GTM 容器工作区的所有 GTM 区域。
revert POST /tagmanager/v2/{path}:revert
还原对 GTM 工作区中 GTM 区域的更改。
update PUT /tagmanager/v2/{path}
更新 GTM 区域。

REST 资源:v2.accounts.user_permissions

方法
create POST /tagmanager/v2/{parent}/user_permissions
创建用户的账号和容器访问权限。
delete DELETE /tagmanager/v2/{path}
从账号中移除用户,撤消其对该账号及其所有容器的访问权限。
get GET /tagmanager/v2/{path}
获取用户的账号和容器访问权限。
list GET /tagmanager/v2/{parent}/user_permissions
列出有权访问该账号的所有用户及其各自获得的账号和容器访问权限。
update PUT /tagmanager/v2/{path}
更新用户的账号和容器访问权限。

REST 资源:v1.accounts

方法
get GET /tagmanager/v1/accounts/{accountId}
获取 GTM 账号。
list GET /tagmanager/v1/accounts
列出用户有权访问的所有 GTM 账号。
update PUT /tagmanager/v1/accounts/{accountId}
更新 GTM 账号。

REST 资源:v1.accounts.containers

方法
create POST /tagmanager/v1/accounts/{accountId}/containers
创建容器。
delete DELETE /tagmanager/v1/accounts/{accountId}/containers/{containerId}
删除容器。
get GET /tagmanager/v1/accounts/{accountId}/containers/{containerId}
获取容器。
list GET /tagmanager/v1/accounts/{accountId}/containers
列出属于 GTM 账号的所有容器。
update PUT /tagmanager/v1/accounts/{accountId}/containers/{containerId}
更新容器。

REST 资源:v1.accounts.containers.environments

方法
create POST /tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments
创建 GTM 环境。
delete DELETE /tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments/{environmentId}
删除 GTM 环境。
get GET /tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments/{environmentId}
获取 GTM 环境。
list GET /tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments
列出 GTM 容器的所有 GTM 环境。
update PUT /tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments/{environmentId}
更新 GTM 环境。

REST 资源:v1.accounts.containers.folders

方法
create POST /tagmanager/v1/accounts/{accountId}/containers/{containerId}/folders
创建 GTM 文件夹。
delete DELETE /tagmanager/v1/accounts/{accountId}/containers/{containerId}/folders/{folderId}
删除 GTM 文件夹。
get GET /tagmanager/v1/accounts/{accountId}/containers/{containerId}/folders/{folderId}
获取 GTM 文件夹。
list GET /tagmanager/v1/accounts/{accountId}/containers/{containerId}/folders
列出容器的所有 GTM 文件夹。
update PUT /tagmanager/v1/accounts/{accountId}/containers/{containerId}/folders/{folderId}
更新 GTM 文件夹。

REST 资源:v1.accounts.containers.folders.entities

方法
list GET /tagmanager/v1/accounts/{accountId}/containers/{containerId}/folders/{folderId}/entities
列出 GTM 文件夹中的所有实体。

REST 资源:v1.accounts.containers.move_folders

方法
update PUT /tagmanager/v1/accounts/{accountId}/containers/{containerId}/move_folders/{folderId}
将实体移动到 GTM 文件夹。

REST 资源:v1.accounts.containers.reauthorize_environments

方法
update PUT /tagmanager/v1/accounts/{accountId}/containers/{containerId}/reauthorize_environments/{environmentId}
为 GTM 环境重新生成授权代码。

REST 资源:v1.accounts.containers.tags

方法
create POST /tagmanager/v1/accounts/{accountId}/containers/{containerId}/tags
创建 GTM 代码。
delete DELETE /tagmanager/v1/accounts/{accountId}/containers/{containerId}/tags/{tagId}
删除 GTM 代码。
get GET /tagmanager/v1/accounts/{accountId}/containers/{containerId}/tags/{tagId}
获取 GTM 代码。
list GET /tagmanager/v1/accounts/{accountId}/containers/{containerId}/tags
列出容器的所有 GTM 代码。
update PUT /tagmanager/v1/accounts/{accountId}/containers/{containerId}/tags/{tagId}
更新 GTM 代码。

REST 资源:v1.accounts.containers.triggers

方法
create POST /tagmanager/v1/accounts/{accountId}/containers/{containerId}/triggers
创建 GTM 触发器。
delete DELETE /tagmanager/v1/accounts/{accountId}/containers/{containerId}/triggers/{triggerId}
删除 GTM 触发器。
get GET /tagmanager/v1/accounts/{accountId}/containers/{containerId}/triggers/{triggerId}
获取 GTM 触发器。
list GET /tagmanager/v1/accounts/{accountId}/containers/{containerId}/triggers
列出容器的所有 GTM 触发器。
update PUT /tagmanager/v1/accounts/{accountId}/containers/{containerId}/triggers/{triggerId}
更新 GTM 触发器。

REST 资源:v1.accounts.containers.variables

方法
create POST /tagmanager/v1/accounts/{accountId}/containers/{containerId}/variables
创建 GTM 变量。
delete DELETE /tagmanager/v1/accounts/{accountId}/containers/{containerId}/variables/{variableId}
删除 GTM 变量。
get GET /tagmanager/v1/accounts/{accountId}/containers/{containerId}/variables/{variableId}
获取 GTM 变量。
list GET /tagmanager/v1/accounts/{accountId}/containers/{containerId}/variables
列出容器的所有 GTM 变量。
update PUT /tagmanager/v1/accounts/{accountId}/containers/{containerId}/variables/{variableId}
更新 GTM 变量。

REST 资源:v1.accounts.containers.versions

方法
create POST /tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions
创建容器版本。
delete DELETE /tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}
删除容器版本。
get GET /tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}
获取容器版本。
list GET /tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions
列出 GTM 容器的所有容器版本。
publish POST /tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/publish
发布容器版本。
restore POST /tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/restore
恢复容器版本。
undelete POST /tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/undelete
恢复删除的容器版本。
update PUT /tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}
更新容器版本。

REST 资源:v1.accounts.permissions

方法
create POST /tagmanager/v1/accounts/{accountId}/permissions
创建用户的账号和容器权限。
delete DELETE /tagmanager/v1/accounts/{accountId}/permissions/{permissionId}
从账号中移除用户,撤消其对该账号及其所有容器的访问权限。
get GET /tagmanager/v1/accounts/{accountId}/permissions/{permissionId}
获取用户的账号和容器权限。
list GET /tagmanager/v1/accounts/{accountId}/permissions
列出有权访问该账号的所有用户及其各自获得的账号和容器权限。
update PUT /tagmanager/v1/accounts/{accountId}/permissions/{permissionId}
更新用户的账号和容器权限。