Cogny CLI · Analytics

    Google Analytics 4 queried from the terminal.

    Run GA4 reports and realtime reports, list dimensions, metrics, conversion events and audiences, and build audiences — from Bash over the GA4 MCP. The Data API without the boilerplate.

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

    cogny --who

    TWO PATHS
    You're a human

    The GA4 Explore UI is slow and the Data API needs a service account and client library. The CLI gives you the same reports as one JSON call you can schedule or pipe. Connect Google Analytics 4 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 Analytics 4 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 Analytics 4 MCP. Send --input JSON, get JSON back.

    mcp__Google_Analytics_4__tool_run_reportA GA4 Data API report: dimensions × metrics over a date range.
    $ cogny tools call mcp__Google_Analytics_4__tool_run_report \
      --input '{"property_id":"353328203","dimensions":["sessionDefaultChannelGroup"],"metrics":["sessions","conversions"],"date_ranges":[{"start_date":"7daysAgo","end_date":"today"}]}'
    example response
    {
      "rows": [
        {
          "sessionDefaultChannelGroup": "Organic Search",
          "sessions": 18422,
          "conversions": 412
        },
        {
          "sessionDefaultChannelGroup": "Paid Search",
          "sessions": 9211,
          "conversions": 388
        },
        {
          "sessionDefaultChannelGroup": "Direct",
          "sessions": 7044,
          "conversions": 121
        }
      ]
    }
    mcp__Google_Analytics_4__tool_run_realtime_reportUsers on the site right now, by dimension.
    $ cogny tools call mcp__Google_Analytics_4__tool_run_realtime_report \
      --input '{"property_id":"353328203","dimensions":["unifiedScreenName"],"metrics":["activeUsers"]}'
    example response
    {
      "rows": [
        {
          "unifiedScreenName": "/pricing",
          "activeUsers": 23
        },
        {
          "unifiedScreenName": "/",
          "activeUsers": 17
        }
      ]
    }
    mcp__Google_Analytics_4__tool_list_conversion_eventsWhich events are marked as conversions.
    $ cogny tools call mcp__Google_Analytics_4__tool_list_conversion_events \
      --input '{"property_id":"353328203"}'
    example response
    {
      "conversion_events": [
        {
          "event_name": "purchase",
          "counting_method": "ONCE_PER_EVENT"
        },
        {
          "event_name": "sign_up",
          "counting_method": "ONCE_PER_SESSION"
        }
      ]
    }

    cogny tools list

    MORE

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

    mcp__Google_Analytics_4__tool_list_account_summariesmcp__Google_Analytics_4__tool_get_metadatamcp__Google_Analytics_4__tool_list_custom_dimensionsmcp__Google_Analytics_4__tool_list_custom_metricsmcp__Google_Analytics_4__tool_list_audiencesmcp__Google_Analytics_4__tool_create_audiencemcp__Google_Analytics_4__tool_list_data_streamsmcp__Google_Analytics_4__tool_list_google_ads_links

    cogny --faq

    Is this the GA4 Data API?

    It wraps it. `tool_run_report` maps to a runReport call; `tool_run_realtime_report` to a realtime report. You get the rows as JSON without a service account or the google-analytics-data client.

    Can I schedule these from cron?

    Yes. The CLI is a normal binary — wire `cogny tools call tool_run_report --input ...` into cron, a Makefile, or your agent and capture stdout.

    Does it cost a credit per call?

    On Cogny Solo, standard MCP calls are unmetered under fair use. The first 15 calls are free on the freemium tier before you pick a plan.

    related CLIs

    /cli/search-console/cli/google-ads/cli/google-tag-manager/cli/plausible

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