> ## Documentation Index
> Fetch the complete documentation index at: https://docs.modulex.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Tag Manager Integration for AI Agents & Workflows

> Manage tags, variables, and workspaces in Google Tag Manager containers

{/* Self-hosted logo — build-time vendored from modulex.json / Iconify (see scripts/lib/logo.js). */}

<img src="https://mintcdn.com/modulexaillc/zKB2qsP6Q61VNLfB/logos/google-tag-manager.svg?fit=max&auto=format&n=zKB2qsP6Q61VNLfB&q=85&s=cd63b58507e21137aa277e00922d3135" alt="Google Tag Manager logo" width="72" height="72" data-path="logos/google-tag-manager.svg" />

## Overview

Add **Google Tag Manager** to any ModuleX agent or workflow. Manage tags, variables, and workspaces in Google Tag Manager containers via the Tag Manager API v2 (`www.googleapis.com/tagmanager/v2`).

<Info>
  **Categories**: Analytics & Data · Analytics · Marketing · **Auth**: OAuth2 · **Actions**: 6
</Info>

## Authentication

### OAuth2 Authentication

Connect using Google OAuth (recommended)

#### Required Credentials

| Field         | Description                    | Required | Format |
| ------------- | ------------------------------ | -------- | ------ |
| Client ID     | Google OAuth App Client ID     | Yes      | `-`    |
| Client Secret | Google OAuth App Client Secret | Yes      | `-`    |

#### OAuth Configuration

* **Authorization URL**: `https://accounts.google.com/o/oauth2/v2/auth`
* **Token URL**: `https://oauth2.googleapis.com/token`
* **Scopes**: `https://www.googleapis.com/auth/tagmanager.edit.containers`, `https://www.googleapis.com/auth/tagmanager.readonly`

## Available Actions

<AccordionGroup>
  <Accordion title="create_tag — Create a tag in a Google Tag Manager workspace">
    ### Parameters

    <ResponseField name="account_id" type="string" required>
      The Google Tag Manager account ID
    </ResponseField>

    <ResponseField name="container_id" type="string" required>
      The container ID
    </ResponseField>

    <ResponseField name="workspace_id" type="string" required>
      The workspace ID
    </ResponseField>

    <ResponseField name="name" type="string" required>
      The name of the tag
    </ResponseField>

    <ResponseField name="type" type="string" required>
      The type of the tag (see Tag Dictionary Reference)
    </ResponseField>

    <ResponseField name="parameter" type="string" required>
      JSON string representing the list of parameters for the tag
    </ResponseField>

    <ResponseField name="live_only" type="boolean">
      Whether the tag should only fire in the live environment
    </ResponseField>

    <ResponseField name="notes" type="string">
      Any notes or comments about the tag
    </ResponseField>

    <ResponseField name="consent_settings" type="string">
      JSON string representing consent settings for the tag
    </ResponseField>

    <ResponseField name="monitoring_metadata" type="string">
      JSON string representing monitoring metadata for the tag
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "TagResource": {
          "additionalProperties": false,
          "description": "A Google Tag Manager tag resource.",
          "properties": {
            "tag_id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Tag Id"
            },
            "name": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Name"
            },
            "type": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Type"
            },
            "live_only": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Live Only"
            },
            "notes": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Notes"
            },
            "parameter": {
              "items": {
                "additionalProperties": true,
                "type": "object"
              },
              "title": "Parameter",
              "type": "array"
            },
            "fingerprint": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Fingerprint"
            },
            "tag_manager_url": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Tag Manager Url"
            },
            "path": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Path"
            },
            "account_id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Account Id"
            },
            "container_id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Container Id"
            },
            "workspace_id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Workspace Id"
            }
          },
          "title": "TagResource",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "tag": {
          "anyOf": [
            {
              "$ref": "#/$defs/TagResource"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        }
      },
      "required": [
        "success"
      ],
      "title": "CreateTagOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="get_tag — Get a specific tag from a Google Tag Manager workspace">
    ### Parameters

    <ResponseField name="account_id" type="string" required>
      The Google Tag Manager account ID
    </ResponseField>

    <ResponseField name="container_id" type="string" required>
      The container ID
    </ResponseField>

    <ResponseField name="workspace_id" type="string" required>
      The workspace ID
    </ResponseField>

    <ResponseField name="tag_id" type="string" required>
      The tag ID
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "TagResource": {
          "additionalProperties": false,
          "description": "A Google Tag Manager tag resource.",
          "properties": {
            "tag_id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Tag Id"
            },
            "name": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Name"
            },
            "type": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Type"
            },
            "live_only": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Live Only"
            },
            "notes": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Notes"
            },
            "parameter": {
              "items": {
                "additionalProperties": true,
                "type": "object"
              },
              "title": "Parameter",
              "type": "array"
            },
            "fingerprint": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Fingerprint"
            },
            "tag_manager_url": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Tag Manager Url"
            },
            "path": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Path"
            },
            "account_id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Account Id"
            },
            "container_id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Container Id"
            },
            "workspace_id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Workspace Id"
            }
          },
          "title": "TagResource",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "tag": {
          "anyOf": [
            {
              "$ref": "#/$defs/TagResource"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        }
      },
      "required": [
        "success"
      ],
      "title": "GetTagOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="get_tags — List all tags in a Google Tag Manager workspace">
    ### Parameters

    <ResponseField name="account_id" type="string" required>
      The Google Tag Manager account ID
    </ResponseField>

    <ResponseField name="container_id" type="string" required>
      The container ID
    </ResponseField>

    <ResponseField name="workspace_id" type="string" required>
      The workspace ID
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "TagResource": {
          "additionalProperties": false,
          "description": "A Google Tag Manager tag resource.",
          "properties": {
            "tag_id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Tag Id"
            },
            "name": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Name"
            },
            "type": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Type"
            },
            "live_only": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Live Only"
            },
            "notes": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Notes"
            },
            "parameter": {
              "items": {
                "additionalProperties": true,
                "type": "object"
              },
              "title": "Parameter",
              "type": "array"
            },
            "fingerprint": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Fingerprint"
            },
            "tag_manager_url": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Tag Manager Url"
            },
            "path": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Path"
            },
            "account_id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Account Id"
            },
            "container_id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Container Id"
            },
            "workspace_id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Workspace Id"
            }
          },
          "title": "TagResource",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "tags": {
          "items": {
            "$ref": "#/$defs/TagResource"
          },
          "title": "Tags",
          "type": "array"
        }
      },
      "required": [
        "success"
      ],
      "title": "GetTagsOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="list_account_id_options — List available Google Tag Manager accounts">
    ### Response

    ```json theme={null}
    {
      "$defs": {
        "AccountItem": {
          "additionalProperties": false,
          "description": "A Google Tag Manager account.",
          "properties": {
            "account_id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Account Id"
            },
            "name": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Name"
            },
            "share_data": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Share Data"
            },
            "fingerprint": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Fingerprint"
            },
            "path": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Path"
            },
            "tag_manager_url": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Tag Manager Url"
            }
          },
          "title": "AccountItem",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "accounts": {
          "items": {
            "$ref": "#/$defs/AccountItem"
          },
          "title": "Accounts",
          "type": "array"
        }
      },
      "required": [
        "success"
      ],
      "title": "ListAccountIdOptionsOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="update_tag — Update a tag in a Google Tag Manager workspace">
    ### Parameters

    <ResponseField name="account_id" type="string" required>
      The Google Tag Manager account ID
    </ResponseField>

    <ResponseField name="container_id" type="string" required>
      The container ID
    </ResponseField>

    <ResponseField name="workspace_id" type="string" required>
      The workspace ID
    </ResponseField>

    <ResponseField name="tag_id" type="string" required>
      The tag ID
    </ResponseField>

    <ResponseField name="type" type="string" required>
      The type of the tag (see Tag Dictionary Reference)
    </ResponseField>

    <ResponseField name="parameter" type="string" required>
      JSON string representing the list of parameters for the tag
    </ResponseField>

    <ResponseField name="name" type="string">
      The name of the tag
    </ResponseField>

    <ResponseField name="live_only" type="boolean">
      Whether the tag should only fire in the live environment
    </ResponseField>

    <ResponseField name="notes" type="string">
      Any notes or comments about the tag
    </ResponseField>

    <ResponseField name="consent_settings" type="string">
      JSON string representing consent settings for the tag
    </ResponseField>

    <ResponseField name="monitoring_metadata" type="string">
      JSON string representing monitoring metadata for the tag
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "$defs": {
        "TagResource": {
          "additionalProperties": false,
          "description": "A Google Tag Manager tag resource.",
          "properties": {
            "tag_id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Tag Id"
            },
            "name": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Name"
            },
            "type": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Type"
            },
            "live_only": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Live Only"
            },
            "notes": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Notes"
            },
            "parameter": {
              "items": {
                "additionalProperties": true,
                "type": "object"
              },
              "title": "Parameter",
              "type": "array"
            },
            "fingerprint": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Fingerprint"
            },
            "tag_manager_url": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Tag Manager Url"
            },
            "path": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Path"
            },
            "account_id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Account Id"
            },
            "container_id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Container Id"
            },
            "workspace_id": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "title": "Workspace Id"
            }
          },
          "title": "TagResource",
          "type": "object"
        }
      },
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "tag": {
          "anyOf": [
            {
              "$ref": "#/$defs/TagResource"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        }
      },
      "required": [
        "success"
      ],
      "title": "UpdateTagOutput",
      "type": "object"
    }
    ```
  </Accordion>

  <Accordion title="update_variable — Update a variable in a Google Tag Manager workspace">
    ### Parameters

    <ResponseField name="account_id" type="string" required>
      The Google Tag Manager account ID
    </ResponseField>

    <ResponseField name="container_id" type="string" required>
      The container ID
    </ResponseField>

    <ResponseField name="workspace_id" type="string" required>
      The workspace ID
    </ResponseField>

    <ResponseField name="variable_id" type="string" required>
      The variable ID
    </ResponseField>

    <ResponseField name="name" type="string" required>
      The name of the variable
    </ResponseField>

    <ResponseField name="type" type="string" required>
      The type of the variable (e.g. 'jsm')
    </ResponseField>

    <ResponseField name="parameter" type="string" required>
      JSON string representing the list of parameters for the variable
    </ResponseField>

    <ResponseField name="format_value" type="string">
      JSON string representing the formatValue object for the variable
    </ResponseField>

    ### Response

    ```json theme={null}
    {
      "additionalProperties": false,
      "properties": {
        "success": {
          "title": "Success",
          "type": "boolean"
        },
        "data": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Data"
        }
      },
      "required": [
        "success"
      ],
      "title": "UpdateVariableOutput",
      "type": "object"
    }
    ```
  </Accordion>
</AccordionGroup>

## Limits & Quotas

* Google Tag Manager API uses per-project quotas managed via the Google Cloud Console.
* Default quota: 10,000 requests per day per project (varies by endpoint).
* Rate limit: approximately 5 requests per second per user.
* Error model: non-2xx responses raise `httpx.HTTPStatusError` (Pattern A).

## Related integrations

<CardGroup cols={3}>
  <Card title="Amplitude" href="/integrations/tools/amplitude" />

  <Card title="Databricks" href="/integrations/tools/databricks" />

  <Card title="Google Analytics" href="/integrations/tools/google-analytics" />
</CardGroup>

## Links

* [Google Tag Manager](https://tagmanager.google.com)
