Skip to content

Purchases after assignment in the one-tap checkout test

HardFull bankJoinsFunnels22 min2 hidden datasets

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:

  • variant
  • assigned_users: users assigned to that variant
  • buyers: those users with at least one counted purchase
  • purchases: number of counted purchase events
  • revenue: total revenue of 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.

intUnique id.
timestampSign-up time (UTC).
textTwo-letter country code.
textios, android or web.
textorganic, paid, referral or partner. NULL when unknown.
events7,616 rows in the sample

One row per tracked event. Key: event_id.

bigintUnique id.
intWho fired it.
textapp_open, search, view_item, add_to_cart, begin_checkout, purchase or share.
timestampWhen (UTC).
textSession 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.

intThe user.
textnew_onboarding or one_tap_checkout.
textcontrol or treatment.
timestampWhen the user was assigned (UTC).

Related questions

Loading the editor and PostgreSQL