ga4. It was tested with @googleapis/analyticsdata, Google’s generated REST client.
Connect
Node
ancha connect ga4 --lang ts prints. With @googleapis/analyticsdata, pass rootUrl: GA4_API_URL + '/' and the Bearer header on each request, and turn retries off. gRPC clients are not supported.
Endpoints
All four are partial. Pivots, cohorts, comparisons, metric expressions and fields outside the list below are coverage gaps.
Invalid credentials return 401
UNAUTHENTICATED; a property the token cannot read returns 403 PERMISSION_DENIED. Quota limits are 200,000 tokens a day, 40,000 an hour and 14,000 per project an hour. Ask for the current state with returnPropertyQuota: true.
Starter data
Thega4-starter dataset has two properties.
Acme’s traffic runs from 2026-10-19 to 2026-10-26: nineteen sessions from LinkedIn paid social (“Ridgeway Robotics Q4 pilot”), Google paid search (“Pipeline reporting” and “Warehouse analytics”) and Google organic search, mostly from San Francisco and one from Toronto, with
generate_lead as the key event. The 2026-10-26 session becomes visible 2 simulated minutes after the world starts, as recent GA4 data arrives late.
Checks
Google Analytics is read-only and has no state checks. Use trace checks, for example{ called: "POST /v1beta/properties/345678901:runReport" }.
Limits
- Historical, synthetic data only: no Measurement Protocol, live collection or realtime reports.
- No attribution models and no Admin API.