Purchases after assignment in the one-tap checkout test
The task
The growth team reads out the one_tap_checkout experiment. Everyone assigned to it is in experiment_assignments with their variant and assigned_at time. Some users are also in the other experiment, new_onboarding, and must not be mixed in.
A purchase is an event with event_name = 'purchase'. It counts for the experiment only if it happened at or after the user's assigned_at for one_tap_checkout. Earlier purchases do not count.
Return one row for each variant of one_tap_checkout:
variantassigned_users: users assigned to that variantbuyers: those users with at least one counted purchasepurchases: number of counted purchase eventsrevenue: totalrevenueof counted purchases, 0 if none
Sort by variant.
Expected output
variantassigned_usersbuyerspurchasesrevenue- Sorted by variant ascending.
- Checked on the sample and on 2 hidden datasets. How grading works
Tables Mobile shopping app · click a name to insert it
users360 rows in the sample
One row per user. Key: user_id.
| int | Unique id. | |
| timestamp | Sign-up time (UTC). | |
| text | Two-letter country code. | |
| text | ios, android or web. | |
| text | organic, paid, referral or partner. NULL when unknown. |
events7,616 rows in the sample
One row per tracked event. Key: event_id.
| bigint | Unique id. | |
| int | Who fired it. | |
| text | app_open, search, view_item, add_to_cart, begin_checkout, purchase or share. | |
| timestamp | When (UTC). | |
| text | Session the event belongs to. NULL for a few events sent from the background. | |
| numeric(10,2) | Order value for purchase events, NULL otherwise. |
experiment_assignments349 rows in the sample
Which variant each user saw in each experiment. Key: user_id, experiment.
| int | The user. | |
| text | new_onboarding or one_tap_checkout. | |
| text | control or treatment. | |
| timestamp | When the user was assigned (UTC). |
Related questions
- April spend and cost per click for search and socialeasy
- Completed trips for every city and vehicle typemedium
- Daily spend against sign-ups for one campaignhard
- Each December rider's most recent completed tripmedium
- Email-referred customers and their completed orderseasy
- Free and paid listeners per genremedium
Loading the editor and PostgreSQL
Loading the editor and PostgreSQL