Data & Analytics Overview

How Coframe collects experiment data and how it connects to your analytics stack

Guide~2 min read

Copy this guide and your current settings as a prompt for your AI agent.

Preview agent promptSee the guide, code and settings included when you copy.

Coframe collects three categories of data for every visitor session: a treatment assignment (which experiment and variant the visitor saw), a per-impression identifier for the page view, and any conversion events you fire from your code. These inputs feed experiment results in the Coframe dashboard. You can also forward treatment assignments to your own analytics platform in real time using the treatment callback.

On this page
  1. 01What Coframe Collects
  2. 02Connecting to Your Analytics Stack
  3. 03Related

01What Coframe Collects

Treatment assignments

When a visitor is assigned to an experiment and variant, Coframe records the assignment. The data payload — CoframeTreatmentDataV2 — contains eight fields: experiment ID and slug, variant ID and slug, the visitor’s user token, an impression ID for the page view, and two boolean flags indicating whether the visitor is in the global holdout or the experiment baseline.

See Experiment Assignment & IDs for the full field reference and assignment logic.

Impressions

Each session is tagged with a coframe_impression_id — a UUID generated when the SDK script runs that uniquely identifies the page view. This ID is included in the treatment assignment payload so you can deduplicate impressions when the same visitor encounters the same experiment across multiple page views.

Conversions

A conversion event tells Coframe that a visitor completed a meaningful action, so that action can be counted as a metric outcome for active experiments. Push a conversion command to window.CFQ at the point the action occurs. The payload requires at least one of metricId or metricName; the optional value and metadata fields carry numeric and string context.

See Tracking Settings and the CFQ command reference for the full API and code examples.

Event batching

The SDK accumulates events and sends them in batches before flushing. The default batch size is 32 events per flush; configure it with batchSize in your SDK options. See Config Reference.

02Connecting to Your Analytics Stack

When Coframe applies a treatment, it calls the bulkCallbackV2 handler you subscribe via window.CFQ, passing the CoframeTreatmentDataV2 array for the current page view. This lets you forward experiment assignments to Segment, Amplitude, Heap, or any other analytics platform in real time.

See Tracking Settings for the canonical callback setup and field overview. Platform-specific implementations:

03Related

Related reading

Content and video lessons from Coframe documentation. Code examples are not executed on this page.

BACK TOData & Analytics

Documentation

Open Coframe App

Search documentation

Search all guides and references↑ ↓ Navigate · Esc Close