@grainql/analytics-web). Grain Tag has no remote configuration. Read
Remote configuration for the cache-first flow.
The pattern
A test has four parts.
Both events carry the same
test_name and variant properties. Without the variant on both
events, the result cannot be split per variant.
The variant value
Create the key in the dashboard and add a rule that splits users into variants. Set the control variant as the default value indefaultConfigurations, so that a client with no response yet
shows the control.
control, price_24, and price_27. Read Remote configuration to
create the key.
The exposure event
Send the exposure event one time, when the component that shows the variant mounts. In React, send it from an effect that depends on the variant.A. Then a typo in the dashboard shows the control instead
of an empty page.
The conversion event
The conversion event is the goal of the test: a click, a signup, a purchase. Send it with the sametest_name and variant as the exposure event. When the goal is on another page, read the
variant again on that page with useConfig. The cache returns the same value for the same user.
variant property to
that event instead of a second event. Read Template events.
Read the results
The conversion rate of a variant is the number of users withtest_converted divided by the
number of users with test_viewed. Both counts are filtered on the same variant.
In the dashboard, build a track from test_viewed to test_converted and split it by the
variant property. Read Tracks.
To compute the rate outside the dashboard, count both events per variant with the Query API. Read
Export and query data.
Rules for a test:
- Change one element per test. Then the difference has one cause.
- Run the test for at least one full week, so that every weekday is in the sample.
- Do not read the result before each variant has about 1000 users.
- When a variant wins, move its share to 100% in the dashboard, then replace the code with the winning variant and delete the key.