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.
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.runGoogleAnalyticsRealtimeReport({ body: { accountId: 'account_abc123', metrics: [ 'sessions', 'activeUsers', ], minuteRanges: [ { startMinutesAgo: 0, endMinutesAgo: 0, name: 'Example', }, ], },});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": {}}List visitor posts on a Facebook Page
Returns the posts other people published on the connected Facebook Page, newest first. Zernio reads the Page feed (Graph `/{page-id}/feed`, which works on New Pages Experience Pages, unlike the deprecated `visitor_posts` edge) and drops the posts the Page published itself and the posts other people published on their own timeline that only tag the Page. A Page without visitor posts returns an empty `data` array. Cursor-paginated: pass `nextCursor` from the previous response as `cursor` to read the next page. `limit` sets how many feed entries are scanned, so a page can hold fewer posts than `limit`, or none, while `nextCursor` is not null. `nextCursor` is null when there are no more pages, and the final page can come back empty. Works on `facebook` accounts with a Page selected. Meta requires the `pages_read_user_content` permission, which Zernio requests with the comments scope: an account connected without it receives Meta's refusal as `platform_api_error`.
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).