← providers

Google Analytics

Query GA4 reporting and realtime analytics data

Endpoints

Call these through the okoro proxy at https://okoro.ai/p/google-analytics

ActionMethodPathMin scope
Run reportPOSTread
Run realtime reportPOSTread
Run funnel reportPOSTread
Batch run reportsPOSTread
Batch run pivot reportsPOSTread
Check compatibilityPOSTread
Get metadataGETread

Examples

Every request requires a short-lived operation token scoped to a single action.

1. Get an operation token

Exchange your service token for a short-lived operation token scoped to a single action.

TOKEN=$(curl -sX POST "https://okoro.ai/t/tokens" \
  -H "Authorization: Bearer $OKORO_SERVICE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"provider": "google-analytics", "scope": "read", "intent": "describe what you are doing"}' \
  | jq -r '.token')

2. Call the API

Use the operation token as a Bearer token. The proxy forwards the request to Google Analytics and logs the action.

Run report
curl -X POST "https://okoro.ai/p/google-analytics/properties/{id}/runReport" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
Run realtime report
curl -X POST "https://okoro.ai/p/google-analytics/properties/{id}/runRealtimeReport" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
Run funnel report
curl -X POST "https://okoro.ai/p/google-analytics/properties/{id}/runFunnelReport" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
Batch run reports
curl -X POST "https://okoro.ai/p/google-analytics/properties/{id}/batchRunReports" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
Batch run pivot reports
curl -X POST "https://okoro.ai/p/google-analytics/properties/{id}/batchRunPivotReports" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
Check compatibility
curl -X POST "https://okoro.ai/p/google-analytics/properties/{id}/checkCompatibility" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
Get metadata
curl -X GET "https://okoro.ai/p/google-analytics/properties/{id}/metadata" \
  -H "Authorization: Bearer $TOKEN"

Scopes

Your service token must be configured with at least the required scope level.

read
GET POST
/properties/*/runReport /properties/*/runRealtimeReport /properties/*/runFunnelReport /properties/*/batchRunReports /properties/*/batchRunPivotReports /properties/*/checkCompatibility /properties/*/metadata /properties/*
write
GET POST
/properties/*/runReport /properties/*/runRealtimeReport /properties/*/runFunnelReport /properties/*/batchRunReports /properties/*/batchRunPivotReports /properties/*/checkCompatibility /properties/*/metadata /properties/*
update
GET POST
/properties/*/runReport /properties/*/runRealtimeReport /properties/*/runFunnelReport /properties/*/batchRunReports /properties/*/batchRunPivotReports /properties/*/checkCompatibility /properties/*/metadata /properties/*
delete
GET POST
/properties/*
all
GET POST
/**