Connector guide — Google Analytics 4 (ga4)
Fixed sections (Phase D1 format; tests/governance/test_onboarding_connector_guides.py pins them). Facts marked [Validated] are measured in code or tests; [Observed] facts carry a date; [Gap] names an open item. No credential, token, account identifier or tenant value appears in this file.
What it is
Google's web/app analytics property. For MIZ OKI it is a measurement rail: the Data API pull (sessions, conversions, channel reports, aggregates only) and the Measurement Protocol leg that the measurement rails service uses to send server-side events. Catalog category analytics, wave 1.
Status (measured)
[Validated] available: true in CONNECTOR_CATALOG (services/service-marketing-connectors/connector_credentials.py, measured 2026-10-12). Required fields measurement_id, api_secret; optional property_id. Test connection reads the property as the platform service account. Live verification against a tenant property: the self-pilot tenant only (see docs/tenants/mycocoons/TENANT_REFERENCE.md); no external tenant has connected GA4 yet.
Who owns the account
The customer. The GA4 property stays in the customer's Google account; MIZ OKI is added as a Viewer (the platform service account) and, for discovery, a human seat as Editor. Both can be removed by the customer at any time (law 3, merchant-owned accounts).
Prerequisites
- The customer can sign in to analytics.google.com as an Administrator or Editor of the property (not just a Viewer).
- The web data stream exists (Admin → Data streams); the
G-…measurement id is shown on it. - The customer knows who set up Analytics; if an agency owns it, ownership transfer or a grant from the agency comes first (law 3).
Visibility invite (click path)
analytics.google.com → Admin → Property access management → + → Add users → the Media Intelligence access seat as Editor; then the platform service account email shown on the GA4 card in the onboarding UI as Viewer. Vendor UIs drift — if a label differs, follow Google's current help article ("Add, edit, and delete users and user groups").
Connecting in the onboarding UI
- Open
/onboarding→ Connectors → the GA4 card (only shown as required when the tenant declared thega4rail; otherwise optional). - Enter
measurement_id(G-…), the Measurement Protocolapi_secret(created under Admin → Data streams → the web stream → Measurement Protocol API secrets → Create), and optionally the numericproperty_id(Admin → Property settings). - Grant Viewer on the property to the platform service account named on the card (read it off the card; never from a document).
- Click Test connection. Move on only when it passes.
Fields
| key | where the tenant finds it | format | secret? | required? |
|---|---|---|---|---|
measurement_id |
Admin → Data streams → web stream | G- + 8–12 uppercase alphanumerics (catalog pattern) |
no | yes |
api_secret |
Admin → Data streams → web stream → Measurement Protocol API secrets | opaque string; never echoed, masked hint only | yes | yes |
property_id |
Admin → Property settings → Property ID | numeric | no | no |
Test connection
| Failure | Plain-English fix |
|---|---|
422 invalid_field_format on measurement_id |
Use the G-… id from the web data stream, not the GTM-… container id or an AW-… tag. |
| Property read refused (403) naming a service-account email | Grant Viewer on the property to exactly that email (Admin → Property access management). Propagation can take a minute; retry once. |
| Property not found (404) | The property_id belongs to a different property or account, or the account is a Universal Analytics property (sunset). Re-check Admin → Property settings. |
| 503 fail-closed | The credential vault could not be read; an operator checks vault health. Nothing for the customer to re-enter. |
What it feeds
The analytics direct pull (aggregates into canonical ingestion → mizoki_unified_data) and the GA4 Measurement Protocol rail in services/measurement-rails/ (server-side events). Writebacks stay dark under MEASUREMENT_WRITEBACK=false; collecting the secret arms nothing (law 8).
Consent posture
Aggregate reports are de-personalised by construction. Any person-level event that would reach canonical ingestion passes the consent gate first (fail-closed, per-event basis required); without a per-subject basis the person-level fields stay dark and only the de-personalised remainder is kept. The tenant's consent declaration (P2-5) never substitutes for a per-subject basis.
Revoke / offboard
Customer side: Admin → Property access management → remove the Media Intelligence seat and the platform service account; delete the Measurement Protocol API secret. Platform side: the operator removes the tenant's ga4 vault entry through the governed path; readiness then reports connectors.ga4:not-configured where the rail is declared.
Known gaps
- OB-GAP-6 — one vault entry per provider per tenant; a second property is recorded as a named gap.
- OB-GAP-10 — completion reads credential state, not delivered data.
Last verified
Catalog and readiness code measured 2026-10-12 on main 47309238. Vendor documentation: Google Analytics Help — "[GA4] Add, edit, and delete users and user groups" (support.google.com/analytics/answer/9305587) and "Measurement Protocol API secrets" (developers.google.com/analytics/devguides/collection/protocol/ga4) — URLs as recorded in the checklist; not re-fetched from this sandbox on 2026-10-12.