Data & Analytics Overview
How Coframe collects experiment data and how it connects to your analytics stack
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.
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:
# Data & Analytics Overview How Coframe collects experiment data and how it connects to your analytics stack 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. ## What 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](../docs/experiment-assignment.html) 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](../docs/tracking-settings.html) and the [CFQ command reference](../docs/cfq-commands.html) 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](../docs/config-reference.html). ## Connecting 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](../docs/tracking-settings.html) for the canonical callback setup and field overview. Platform-specific implementations: - [Segment](../docs/segment.html) - [Amplitude](../docs/amplitude.html) - [Google Tag Manager](../docs/gtm.html) - [Google Analytics](../docs/google-analytics.html) - [Heap](../docs/heap.html) - [PostHog](../docs/posthog.html) - [Statsig](../docs/statsig.html) ## Related - [Experiment Assignment & IDs](../docs/experiment-assignment.html) — how visitors are assigned and what the assignment fields mean - [Events and Tracking](../docs/events-and-tracking.html) — what events Coframe records and how they are structured - [Experiment Analytics](../docs/experiment-analytics.html) — how experiment data is measured and grouped