Get Google Analytics OAuth connect URL
Changed onStarts OAuth for Google Analytics (GA4). Each connected GA4 property becomes its own account with platform googleanalytics; it reads reports and does not post.
Requested scope: https://www.googleapis.com/auth/analytics.readonly.
Flow
Redirect the user to authUrl.
- One readable property: Zernio connects it and redirects to redirect_url (or the dashboard) with connected=googleanalytics, profileId, accountId and username (the property name).
- Several properties: the user first picks one on a Zernio-hosted page, which then redirects the same way.
Your own property picker
Add headless=true to redirect_url. Zernio then redirects there with step=select_property, profileId, platform=googleanalytics and a pendingDataToken for GET /v1/connect/googleanalytics/properties and POST /v1/connect/googleanalytics/select-property.
Errors
On failure the redirect carries error, platform=googleanalytics and error_message. Errors include:
- googleanalytics_scope_missing: the user unticked Analytics access.
- googleanalytics_no_properties
Request
- Base URLhttps://zernio.com/api
- URLhttps://zernio.com/api/v1/connect/googleanalytics
- Auth
- HTTP bearer
- or API key in header X-Connect-Token
Query parameters
Your Zernio profile ID (get from /v1/profiles).
Custom redirect after connection. Must be an absolute http(s) URL or custom app scheme such as myapp://callback; relative and unsafe URLs return 400.
Zernio account ID of the Google Analytics account being reconnected. Picking a different property then fails instead of adding a second account.
Response
OAuth authorization URL and authenticated state
Changes
- info
endpoint added
- info