DocsIntegrationsAnalytics Integrations

Analytics Integrations

Koryla can forward experiment assignment events to your analytics platform automatically. When a new visitor is assigned to a variant, the Worker fires a background event using waitUntil — so it never blocks the page load.

How it works

Every time a visitor is assigned to a variant for the first time, the edge function calls your configured analytics platform in the background. The event is fired only once per visitor per experiment — returning visitors who already have the ky_ cookie do not trigger a second event.

Astro demo: See netlify/edge-functions/koryla.ts#L115-L132 for the fireEvent function that dispatches events without blocking the response.

Supported platforms

PlatformPlansDoc
Google Analytics 4Starter, GrowthSetup →
PostHogGrowthSetup →
PlausibleStarter, GrowthSetup →
MixpanelGrowthSetup →
AmplitudeGrowthSetup →
Custom WebhookGrowthSetup →

Setting up an integration

  1. Go to Integrations in your workspace dashboard
  2. Select your analytics platform
  3. Enter your credentials (Measurement ID, API key, etc.)
  4. Toggle it on

Changes take effect within 60 seconds (the KV cache TTL).

Event schema

All integrations receive the same event data:

FieldTypeExample
experiment_idUUID"a1b2c3..."
experiment_namestring"Homepage CTA Test"
variant_idUUID"x9y8z7..."
variant_namestring"Blue button"
session_idstringanonymous visitor identifier
timestampISO 8601"2026-04-10T22:00:00Z"

Events fire only once per visitor

Analytics events are fired only on new variant assignments — not on every page view. A returning visitor who already has the ky_ cookie will not trigger another event. This keeps your data clean and prevents inflating event counts.