Get Google Analytics OAuth connect URL
Starts OAuth for Google Analytics (GA4). Each connected GA4 property becomes its own account
with platform googleanalytics; it reads reports and does not post.
Redirect the user to authUrl. When the Google account can read one property, Zernio connects
it and redirects to redirect_url (or the dashboard) with connected=googleanalytics,
profileId, accountId and username (the property name). When it can read several, the user
first picks one on a Zernio-hosted page, which then redirects the same way. To show your own picker
instead, 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. On failure the
redirect carries error, platform=googleanalytics and error_message; errors include
googleanalytics_scope_missing (the user unticked Analytics access) and
googleanalytics_no_properties.
Requested scope: https://www.googleapis.com/auth/analytics.readonly.
API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.
In: header
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 Body
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.connect.getGoogleAnalyticsConnectUrl({ query: { profileId: 'profile_abc123', },});console.log(data);{ "authUrl": "http://example.com", "state": "string"}Get the saved welcome screen
The workspace's saved welcome screen settings, shared by the whole team. With `showByDefault` on, every `GET /v1/connect/{platform}` made with your API key shows the welcome screen before the platform's authorization screen, without `welcome=true` or any branding parameter. Connects started from the Zernio dashboard always show it, with this branding when saved.
Get HubSpot OAuth connect URL
Initiates OAuth for a HubSpot portal. HubSpot is a connect-only CRM platform: the connected account does not post, read analytics or run ads. One HubSpot portal can be connected per profile; connecting a different portal to a profile that already has one redirects with `error=hubspot_profile_has_portal`. Redirect the user to `authUrl`; after authorization, HubSpot returns the browser to Zernio's internal callback and Zernio redirects to `redirect_url` (or the dashboard when omitted). On success the redirect carries `connected=hubspot`, `profileId`, `accountId` and `username` (the portal domain); on failure it carries `error`, `platform=hubspot` and `error_message`. Reconnecting the same portal and profile updates the stored connection in place and keeps its settings. Requested scopes: `oauth`, `crm.objects.contacts.read`, `crm.objects.contacts.write`.