← all adapters
ga4-style
simulates Google Analytics Data API + Admin API v1beta
restadapter v0.1.07 routes
verification
use it
# add to stunt.yaml
services:
ga4:
adapter: embedded:ga4-style
# then
$ stunt upThe embedded: source extracts this adapter from the binary — no git clone, fully offline.
how to mock the Google Analytics Data API + Admin API locally
Install stunt, paste the service block above into stunt.yaml, run stunt up — then point your client at localhost instead of Google Analytics Data API + Admin API. It works offline, keeps state across requests and restarts, and every response is synthetic: the route shapes, status codes, pagination, and webhook delivery follow the real Google Analytics Data API + Admin API v1beta surface — the data is fake, the behavior is real.
backing stores
tokensaccountspropertiesdatastreams
api surface (7)
generated from the adapter manifest — exactly what boots, nothing more · covers 16% of the real API's 66 routes (derived from sdk google-api-go-client @ v0.293.0)
7 routes
GET/v1beta/accounts
GET/v1beta/properties
GET/v1beta/properties/{property}/dataStreams
GET/v1admin/accounts
GET/v1admin/properties
GET/v1admin/properties/{property}/dataStreams
POST/v1beta/properties/{resource}
SDK-verified behaviors (7)
- ✓Admin Accounts.List returns the seeded account
- ✓Admin Properties.List filters by parent account
- ✓Admin DataStreams.List returns the property streams
- ✓Data runReport returns headers, rows, and rowCount
- ✓Data runReport limit pages rows deterministically
- ✓Data runRealtimeReport returns rows
- ✓Unknown dimension runReport -> googleapi 400
Not implemented (4)
- No pivots, cohortSpec, metricAggregations, or keepEmptyRows in runReport
- No runPivotReport, batchRunReports, getMetadata, or checkCompatibility
- No Admin write ops: account/property/dataStream create, patch, delete
- No googleAdsLinks, firebaseLinks, audiences, or conversionEvents
Differs from the real API (3)
- Dimensions: date/country/deviceCategory only; metrics: sessions/activeUsers/screenPageViews
- properties.list honors only the filter=parent:<account> form
- Admin API served at both /v1admin (GA) and /v1beta (the shipped Go client's version); shapes shared
want more of the Google Analytics Data API + Admin API surface? adapters are YAML + Starlark — the authoring guide covers adding routes, fixtures, and state machines. Open an issue for anything big first, or just file a PR — merged routes ship in the next release.