Statsig
Send Coframe treatment events to Statsig using a bulkCallbackV2 snippet.
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 logs a coframe_treatment_applied event to Statsig for every treatment a visitor receives, letting you tie experiment assignments to Statsig metrics and pulse results.
01Add this bulkCallbackV2 to your analytics callback
{
bulkCallbackV2: function(treatments) {
if (!window.statsig || !treatments || !treatments.length) return;
treatments.forEach(function(t) {
window.statsig.logEvent("coframe_treatment_applied", null, {
cf_user_token: t.coframe_user_token,
cf_variant_id: t.coframe_variant_id,
cf_variant_slug: t.coframe_variant_slug,
cf_experiment_id: t.coframe_experiment_id,
cf_experiment_slug: t.coframe_experiment_slug,
cf_impression_id: t.coframe_impression_id,
cf_is_global_holdout: String(t.coframe_in_global_holdout),
cf_is_baseline: String(t.coframe_in_exp_baseline),
});
});
}
}02Where to place it
Place the snippet above inside your Coframe analytics callback as described in Tracking Settings.
03What gets sent
Each call passes the coframe_* fields from the treatment object as event metadata. These fields are described in Experiment Assignment & IDs.
# Statsig
Send Coframe treatment events to Statsig using a bulkCallbackV2 snippet.
Coframe logs a `coframe_treatment_applied` event to Statsig for every treatment a visitor receives, letting you tie experiment assignments to Statsig metrics and pulse results.
## Add this bulkCallbackV2 to your analytics callback
JS
```
{
bulkCallbackV2: function(treatments) {
if (!window.statsig || !treatments || !treatments.length) return;
treatments.forEach(function(t) {
window.statsig.logEvent("coframe_treatment_applied", null, {
cf_user_token: t.coframe_user_token,
cf_variant_id: t.coframe_variant_id,
cf_variant_slug: t.coframe_variant_slug,
cf_experiment_id: t.coframe_experiment_id,
cf_experiment_slug: t.coframe_experiment_slug,
cf_impression_id: t.coframe_impression_id,
cf_is_global_holdout: String(t.coframe_in_global_holdout),
cf_is_baseline: String(t.coframe_in_exp_baseline),
});
});
}
}
```
## Where to place it
Place the snippet above inside your Coframe analytics callback as described in [Tracking Settings](../docs/tracking-settings.html).
## What gets sent
Each call passes the `coframe_*` fields from the treatment object as event metadata. These fields are described in [Experiment Assignment & IDs](../docs/experiment-assignment.html).