← All integration guides

Experiments

Compare conversion rate and revenue per visitor for a feature flag.

Run an A/B test

An experiment links one feature flag to one conversion goal. Draft tests stay idle until you start them. Assignment uses the visitor id, not the analytics session id. The server buckets rolloutBucket(visitorId, flagKey). identify() does not change the visitor id or that assignment.

GET /api/projects/{id}/flags?subjectId= returns { flags }. When the experiment is running, that evaluation writes one experiment_exposures row. Repeating the request does not add another row. userId is a deprecated alias for the same subject.

New experiments report with exposure_v2 and count only subjects that have an exposure. Older experiments can stay on session_proxy_v1. The results page labels those Legacy and does not recompute them from exposures. Results still show conversion rate, uplift, and a two-proportion Z-test. Statistical significance is separate from revenue.

Revenue per visitor

When financial events are ingested, each arm also shows revenue per visitor (RPV). Analytica sums amount for identified users in that bucket during the experiment window. A refund event subtracts the absolute amount. That total is divided by every visitor in the bucket, including people who were never identified and therefore contribute no revenue.

The join is identified_user_id on the session to userId on the financial event. Send subscription events for the same ids you pass to identify(), or RPV stays at zero even if the conversion rate moves.