MetorialDocs

Set up Google Tag Manager in Metorial for AI agents

Share Google Tag Manager with your team in Claude, ChatGPT and Cursor through Metorial: OAuth sign-in, 11 tools (1 read-only).

To give your team Google Tag Manager in Claude, ChatGPT, Cursor and other AI clients, an admin shares the Google Tag Manager integration in a Metorial portal, and each person signs in to Google Tag Manager with their own account. Agents can manage Google Tag Manager accounts, containers, workspaces, tags, triggers, variables, and versions. The integration has 11 tools, 1 read-only and 10 write, plus 3 triggers.

What you'll learn

  • How an admin shares Google Tag Manager in a portal and how each person connects
  • The 9 OAuth scopes Google Tag Manager can request, and what each one allows
  • How to keep the 1 read-only tools and reject the other 10

Before you start

Sign-in method

MethodTypeWhat a person provides
Google OAuthOAuthSigns in to Google Tag Manager

Google OAuth

People sign in to Google Tag Manager and approve the scopes you allow. The integration can request:

ScopeNameWhat it allows
https://www.googleapis.com/auth/tagmanager.readonlyRead OnlyView your Google Tag Manager container and its subcomponents
https://www.googleapis.com/auth/tagmanager.edit.containersEdit ContainersManage your container and its subcomponents, excluding versioning and publishing
https://www.googleapis.com/auth/tagmanager.edit.containerversionsEdit VersionsManage your container versions
https://www.googleapis.com/auth/tagmanager.delete.containersDelete ContainersDelete your Google Tag Manager containers
https://www.googleapis.com/auth/tagmanager.manage.accountsManage AccountsView and manage your Google Tag Manager accounts
https://www.googleapis.com/auth/tagmanager.manage.usersManage UsersManage user permissions of your account and container
https://www.googleapis.com/auth/tagmanager.publishPublishPublish your Google Tag Manager container versions
https://www.googleapis.com/auth/userinfo.profileUser ProfileView your basic profile info
https://www.googleapis.com/auth/userinfo.emailUser EmailView your email address

The read-only tools need only https://www.googleapis.com/auth/tagmanager.readonly. Allow just that scope in the Scopes picker when you create your own auth credentials, and the connection cannot change anything.

Use your own Google Tag Manager OAuth app

With your own OAuth app, people see your company's name on the Google Tag Manager consent screen, and the client ID and secret belong to you.

Start the credentials in Metorial

In the dashboard, select Settings, then Organization Settings. Under Integrations and MCP, select Provider Auth, then Create Auth Credentials. Choose Google Tag Manager and copy the Redirect URI.

Register the app

In the Google Cloud console, enable the API behind Google Tag Manager under APIs & Services, Library. Then go to Google Auth platform, Clients, click Create Client, choose Web application, and paste the redirect URI from Metorial under Authorized redirect URIs. Google shows the client secret only when you create the client.

The Google Workspace guide covers the consent screen and the OAuth client in Google Cloud step by step.

Finish in Metorial

Copy the app's client ID and client secret. Back in Metorial, enter a Name, the Client ID and the Client Secret, review Scopes, and select Create. Then pick these credentials for the Google Tag Manager integration.

Admin: share Google Tag Manager in a portal

In the dashboard

Open Shared Resources

Open Workforce, choose the portal, and select Shared Resources under Access.

Share a new integration

Select Share a Resource, then New Integration, and choose Google Tag Manager. For how members connect, choose Each person connects, so everyone signs in to Google Tag Manager as themselves.

Limit the tools

Under Tool Filters, set the write and destructive groups to Reject if agents should only read from Google Tag Manager.

Choose who gets it

Add the access groups that should see Google Tag Manager. When a person asks for access from the portal, the request appears under Access Requests.

With the CLI

The CLI cannot create the per-user Google Tag Manager integration. Once it exists, check which groups have it:

metorial-admin portals access list <portal-id> --type provider_template --search "google tag manager"

Employee: connect Google Tag Manager

In the portal

Open Google Tag Manager in the catalog

Sign in to your portal and open Google Tag Manager. The status reads Available.

Authenticate

Under Quick setup, select Authenticate. A Google Tag Manager sign-in tab opens. Sign in and approve the permissions listed.

Confirm

The status changes to Configured. If it later reads Needs reconnect, select Reconnect and sign in again.

With the CLI

metorial catalog search "google tag manager"
metorial setup <catalog-item-id>

catalog search prints the catalog item ID.

Add it to your AI client

metorial install adds your Google Tag Manager connection to a local MCP client such as Claude Code, Cursor or Codex. metorial list prints the integration ID and metorial client list the client identifiers.

metorial list "google tag manager"
metorial client list
metorial install <client-identifier> <integration-id>

For a client that takes a server URL, such as ChatGPT, metorial install custom <integration-id> creates an installation token and shows the endpoint details.

Make it read-only

Open the integration's Tool Filters and set the write and destructive groups to Reject. Agents keep the read-only tool list_accounts, and lose the 10 write tools, such as manage_tag or manage_folder.

Employees see the result on the integration's page in the portal under Tool access. For the full walkthrough, see Tool permissions.

Check it worked

metorial list "google tag manager"
metorial tools <integration-id>
metorial call <integration-id> list_accounts -d '{}'

metorial tools lists the 11 tools, minus any you rejected. list_accounts takes no input.

To see every input a tool takes, run metorial schema <integration-id> <tool-key>.

Tools

Read-only tools (1)

  • list_accounts: Lists GTM accounts you have access to, optionally including their containers.

Write tools (10)

  • manage_user_permission: Create, list, get, update, or delete user permissions for a GTM account. Needs action and accountId.
  • manage_container: Create, retrieve, update, or delete a GTM container. Needs action and accountId.
  • manage_trigger: Create, list, get, update, or delete triggers in a GTM workspace. Needs action, accountId, containerId and workspaceId.
  • manage_workspace: Create, list, update, delete, or sync GTM workspaces. Needs action, accountId and containerId.
  • manage_folder: Create, list, get, update, or delete folders in a GTM workspace. Needs action, accountId, containerId and workspaceId.
  • manage_environment: Create, list, get, update, delete, or reauthorize GTM environments. Needs action, accountId and containerId.
  • manage_variable: Create, list, get, update, or delete user-defined variables in a GTM workspace. Needs action, accountId, containerId and workspaceId.
  • manage_tag: Create, list, get, update, delete, or revert tags in a GTM workspace. Needs action, accountId, containerId and workspaceId.
  • manage_version: Create, list, get, publish, or delete container versions. Needs action, accountId and containerId.
  • update_account: Update the name or anonymous data sharing setting of a Google Tag Manager account.

Triggers

Google Tag Manager has 3 triggers, which fire on events in Google Tag Manager:

  • version_published: Triggers when a new container version is published (made live).
  • inbound_webhook
  • workspace_changed: Triggers when changes are detected in a GTM workspace, such as modified tags, triggers, or variables.

Next steps