Building Tests6 min read

GA4 Integration

Connect a GA4 property so you can use existing GA4 events as goals. OAuth flow, property selection, sync schedule, and limits.

GA4 Integration

Connect a Google Analytics 4 property to Otter A/B so your existing GA4 events can drive A/B test goals — no double-instrumentation required.

If your team already tracks purchases, leads, or signups in GA4, you can plug Otter A/B into that data instead of reinstrumenting the conversion. Once a project is connected to a GA4 property, you can add a GA4 Event goal to any test and pick from the events GA4 is already collecting.

The connection is project-scoped — one GA4 property per Otter A/B project. If you run tests across multiple websites or stores, create one project per site and connect each one to the matching GA4 property.

Connecting GA4

  1. 1

    Open the project’s integrations tab

    In Otter A/B, open the project you want to connect and head to Settings → Integrations → Google Analytics 4. Click Connect GA4.
  2. 2

    Authorize with Google

    You'll be sent to Google's OAuth consent screen. Otter A/B requests read-only access to your GA4 properties (analytics.readonly) and nothing else — no ads, no write access, no other Google services.
  3. 3

    Pick a property

    Otter A/B fetches the GA4 properties your Google account can read and shows them in a list. Pick the one that matches the website you're running tests on. If you don't see the property you expected, double-check that your Google account has read access on it in the GA4 admin panel.
  4. 4

    Add a GA4 goal to a test

    On the Goals step of the test wizard, choose GA4 Event and enter the event name exactly as it appears in GA4 (e.g. purchase, generate_lead, sign_up). Names are case-sensitive.

How sync works

A background job runs every five minutes and pulls events from GA4 for projects that have an active test using a GA4 goal. Projects without an active GA4-backed test don't sync, so the GA4 API quota is only spent when there's real demand.

The first sync after a connection is established pulls events from the last seven days. Subsequent syncs use an overlapping one-hour window so late-arriving events get caught. GA4 can take 24–48 hours to fully attribute and surface some events, so conversion counts may inch up for a couple of days after a test technically completes.

The Otter A/B side stores per-sync metadata — start time, event count, conversions recorded, error message if any, duration in milliseconds. You can see the latest sync status under Project Settings → Integrations → GA4.

Connection states

pending_property_selection

You've authorized with Google but haven't picked a property yet. The connection exists; syncs haven't started. Pick a property to move to active.

active

A property is selected and syncs run every 5 minutes (when there's an active GA4-backed test). This is the healthy state.

expired

Google revoked the OAuth token — usually because the user disconnected our app from their Google account permissions, or because the token couldn't be refreshed. Reconnect to resume syncing.

revoked

You disconnected via the Otter A/B UI. No syncs run. Reconnect at any time.

Mid-test rules

Property changes are blocked during active GA4 tests. Otter A/B refuses to switch GA4 properties while you have any running tests using a GA4 goal — switching would mix incompatible event data. Pause or complete those tests first.

Disconnect is blocked during active GA4 tests. Same reason: pulling the plug mid-test would lose conversions on the Otter side and corrupt the result. Pause, complete, or archive the tests first.

Pick the right property the first time. A common mistake is connecting the staging property by accident. Verify the property name on the selection screen — the GA4 property ID is shown alongside.

Frequently asked questions

Quick answers to the questions teams ask most about this part of Otter A/B.