Run a Google Analytics (GA4) report
Runs a report on a connected GA4 property through Google's Data API (runReport).
Pick any GA4 dimensions and metrics; filters and ordering use Google's own shapes.
Identical requests on the same property are cached for 10 minutes. Google meters each
property by quota tokens; when it is used up the request returns 429 until Google refills it
(hourly quotas within the hour, daily ones at midnight Pacific time).
Authorization
bearerAuth API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.analytics.runGoogleAnalyticsReport({ body: { accountId: 'account_abc123', metrics: [ 'sessions', 'activeUsers', ], dateRanges: [ { startDate: '30daysAgo', endDate: 'today', }, ], offset: 0, keepEmptyRows: false, },});console.log(data);{ "accountId": "string", "propertyId": "string", "dimensionHeaders": [ { "name": "string" } ], "metricHeaders": [ { "name": "string", "type": "string" } ], "rows": [ { "dimensionValues": [ { "value": "string" } ], "metricValues": [ { "value": "string" } ] } ], "rowCount": 0, "metadata": {}, "propertyQuota": {}}Run a Google Analytics (GA4) realtime report
Activity on a connected GA4 property in the last 30 minutes (up to 60 for Analytics 360), through Google's `runRealtimeReport`. Not cached. Only realtime dimensions and metrics are accepted, e.g. `country`, `unifiedScreenName` with `activeUsers`.
List conversation analytics
Per-conversation listing with per-row totals + first/last message timestamps. The inbox analog of GET /v1/analytics (posts listing): same filter shape, same pagination, same sort/order semantics. Use as the entry point for the per-conversation analytics drawer at /v1/analytics/inbox/conversations/{conversationId}. Rows are enriched with the conversation's participant info (`participantName`, `participantUsername`, `participantPicture`) and last-message preview by joining the Conversation document scoped to the caller's team. Max date range is 365 days.