The catalogue/Google Analytics

Google Analytics

app.google.analytics

Run GA4 reports, query realtime data, and manage properties and data streams

OAuth 2googleRead the source
Version2.0.0
Categorygoogle
AuthOAuth 2
Tools13
Transportstdio
LicenceMIT
01

What it does

The app, in its own words.

Google Analytics 4 (GA4) — run reports, query realtime data, and manage properties and data streams

googleanalyticsga4reportsmetricsdimensionseventsrealtime
02

Tools

13 tools the agent can call.

Every one is declared with typed parameters and returns structured results, so the host can render them instead of narrating them.

  • analytics-batch-run-reportsRun up to 5 GA4 reports against the same property in one call. Returns { reports: [<RunReportResponse>...] }. Useful for dashboards.
  • analytics-create-data-streamCreate a web/iOS/Android data stream under a property. Returns { stream: { streamId, displayName, type, webStreamData? } }.
  • analytics-create-propertyCreate a new GA4 property under an account. Returns { property: { propertyId, displayName, parent, timeZone, currencyCode, ... } }.
  • analytics-delete-propertySoft-delete a GA4 property (recoverable for ~7 days from Google Analytics UI). Returns { property: { propertyId, deleteTime, ... } }.
  • analytics-get-data-streamGet a single data stream's details. Returns { stream: { streamId, displayName, type, webStreamData?, androidAppStreamData?, iosAppStreamData? } }.
  • analytics-get-metadataGet all dimensions and metrics available for a property, including custom ones. Returns { dimensions: [{ apiName, uiName, description, customDefinition }], metrics: [{ apiName, uiName, description, type, customDefinition }] }.
  • analytics-get-propertyGet a GA4 property's details. Returns { property: { propertyId, displayName, propertyType, parent, timeZone, currencyCode, industryCategory, serviceLevel, createTime, updateTime } }.
  • analytics-list-accountsList GA4 accounts accessible to the user. Returns { accounts: [{ accountId, name, displayName, regionCode, createTime }], count }.
  • analytics-list-data-streamsList data streams (web/iOS/Android) for a property. Returns { streams: [{ streamId, displayName, type, webStreamData, androidAppStreamData, iosAppStreamData }], count }.
  • analytics-list-propertiesList GA4 properties under an account. Returns { properties: [{ propertyId, displayName, propertyType, currencyCode, timeZone, industryCategory }], count }.
  • analytics-run-realtime-reportRun a GA4 realtime report (last 30 minutes of activity). Returns { dimensionHeaders, metricHeaders, rows, rowCount, propertyQuota? }.
  • analytics-run-reportRun a GA4 report. Returns { dimensionHeaders, metricHeaders, rows, rowCount, totals?, metadata, propertyQuota? }. Dates accept ISO ("2024-01-01") or relative ("7daysAgo", "yesterday", "today").
  • analytics-update-propertyUpdate mutable fields of a GA4 property (displayName, timeZone, currencyCode, industryCategory). Returns { property: <updated> }.
03

Auth and permissions

What it asks for.

Declared in the manifest, in advance. The app cannot reach anything it did not ask for here.

Scopes

https://www.googleapis.com/auth/analytics.readonlyhttps://www.googleapis.com/auth/analytics.edithttps://www.googleapis.com/auth/userinfo.email

System secrets

CLIENT_IDCLIENT_SECRETREDIRECT_URI

User secrets

ACCESS_TOKENREFRESH_TOKENEMAILEXPIRY_DATE

Reading further

The manifest and the source for Google Analytics live in the monorepo, alongside the other apps.

Read the sourceBack to the catalogue

Google Analytics · Agent Apps