Cogny CLI · Analytics

    Google Tag Manager scriptable from Bash.

    Walk the account → container → workspace tree, list and search tags, triggers, and variables, run a GDPR privacy audit, and create or publish container versions — all from the shell over the Google Tag Manager MCP. No GTM UI clicking, no API client.

    # 1. sign up (free for 15 calls) — uses your git email
    $ npx @cogny/cli init --agent claude-code
    
    # 2. see every Google Tag Manager tool
    $ cogny tools list
    
    # 3. call any tool from Bash — no MCP wiring
    $ cogny tools call mcp__Google_Tag_Manager__tool_list_tags --input '{…}'
    ❯ start Cogny Solo — $9/mo@cogny/cli on npm →

    cogny --who

    TWO PATHS
    You're a human

    Auditing a container today means clicking through every tag, trigger, and variable in the GTM UI to find what fires where and whether consent is wired up. The CLI returns the whole workspace as JSON so you (or an agent) can diff it, grep it, and publish a versioned change. Connect Google Tag Manager once in Cogny Solo and let your coding agent — or scheduled reports — do the querying for you.

    ❯ start Solo
    You're an agent

    Self-onboard with one command. The CLI issues a key, wires nothing, and exposes every Google Tag Manager tool over JSON-RPC. First 15 calls are free.

    $ npx @cogny/cli init --agent claude-code

    cogny tools call

    3 EXAMPLES

    Real tool names from the Google Tag Manager MCP. Send --input JSON, get JSON back.

    mcp__Google_Tag_Manager__tool_list_tagsList every tag in a workspace with its type and firing triggers.
    $ cogny tools call mcp__Google_Tag_Manager__tool_list_tags \
      --input '{"account_id":"6139230416","container_id":"137051450","workspace_id":"5"}'
    example response
    [
      {
        "tagId": "30",
        "name": "GA4 - Custom Events",
        "type": "gaawe",
        "firingTriggerId": [
          "29"
        ]
      },
      {
        "tagId": "12",
        "name": "GA4 Config",
        "type": "gaawc",
        "firingTriggerId": [
          "2147479553"
        ]
      }
    ]
    mcp__Google_Tag_Manager__tool_audit_container_privacyFlag tracking tags, cookie variables, and missing consent triggers.
    $ cogny tools call mcp__Google_Tag_Manager__tool_audit_container_privacy \
      --input '{"account_id":"6139230416","container_id":"137051450","workspace_id":"5"}'
    example response
    {
      "tracking_tags": [
        {
          "name": "Meta Pixel",
          "type": "html",
          "has_consent_trigger": false
        }
      ],
      "cookie_variables": [
        "_fbp",
        "_ga"
      ],
      "recommendations": [
        "Add a consent-mode trigger to \"Meta Pixel\" before it fires."
      ]
    }
    mcp__Google_Tag_Manager__tool_create_versionSnapshot the workspace into a publishable container version.
    $ cogny tools call mcp__Google_Tag_Manager__tool_create_version \
      --input '{"account_id":"6139230416","container_id":"137051450","workspace_id":"5","name":"Add GA4 lead event tag","notes":"Wires generate_lead to GA4."}'
    example response
    {
      "containerVersionId": "47",
      "name": "Add GA4 lead event tag",
      "tagCount": 14
    }

    cogny tools list

    MORE

    A sample of the rest of the Google Tag Manager surface. Run cogny tools list --json for every tool and its input schema.

    mcp__Google_Tag_Manager__tool_list_accountsmcp__Google_Tag_Manager__tool_list_containersmcp__Google_Tag_Manager__tool_get_container_snippetmcp__Google_Tag_Manager__tool_list_triggersmcp__Google_Tag_Manager__tool_list_variablesmcp__Google_Tag_Manager__tool_search_tagsmcp__Google_Tag_Manager__tool_create_tagmcp__Google_Tag_Manager__tool_create_triggermcp__Google_Tag_Manager__tool_publish_version

    cogny --faq

    Is this an official Google Tag Manager CLI?

    No — it is the Cogny CLI calling the Google Tag Manager MCP over the cogny-mcp-proxy. You connect Google once in Cogny and then read or edit containers from Bash with no tagmanager API client to wire up.

    Can it actually publish, or only read the container?

    Both. Read tools list accounts, containers, workspaces, tags, triggers, and variables. Write tools create/update/delete tags, triggers, and variables, then tool_create_version snapshots the workspace and tool_publish_version makes it live (subject to the connected account’s GTM publish permission and OAuth scope).

    Does it help with GDPR compliance?

    tool_audit_container_privacy scans a workspace for third-party tracking tags, cookie variables, and tags firing without a consent trigger, and returns recommendations — a fast first pass before a manual review.

    related CLIs

    /cli/ga4/cli/search-console/cli/plausible

    Building an agent? The full tool map for all servers is one fetch: /cli/llms.txt