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

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

  1. Open /onboarding → Connectors → the GA4 card (only shown as required when the tenant declared the ga4 rail; otherwise optional).
  2. Enter measurement_id (G-…), the Measurement Protocol api_secret (created under Admin → Data streams → the web stream → Measurement Protocol API secrets → Create), and optionally the numeric property_id (Admin → Property settings).
  3. Grant Viewer on the property to the platform service account named on the card (read it off the card; never from a document).
  4. 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).

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

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.

← All docsView source on GitHub →