Repository navigation
Record a checkout source on every Cloud checkout - #1115
Merged
Merged
Conversation
Stripe never got trial_source because only one path ever sent a source:
the first-success card to /start-trial, clicked on that same page load.
Every other way into a checkout (the trial banner, the licence page, the
ended-trial wall, post-Approve, the sign-up prompt, the chat's setup
links, the pricing links from the app and from emails) sent nothing,
and the banner and the email shared one value. In production: 6 card
clicks and 200 offer emails since 13 Oct, 104 checkout links, all 'app'.
- Allow-list of entry points (CHECKOUT_SOURCES), mirrored in the
frontend: first_success_banner, first_success_email, trial_banner,
license_page, trial_ended_wall, post_approve, signup_prompt,
trial_limit, starter_pack, chat_setup, start_trial, app. The legacy
first_success stays accepted for emails already sent.
- The checkout-link endpoint always sends a source ('app' by default).
- Each entry point names itself; Settings > License passes on the
offer email's and the chat's source.
- Pricing-page links carry ?source=: app_pricing and the app places,
email_trial_warn3/warn1/expired and email_winback from the emails.
- /start-trial reports start_trial_viewed and
start_trial_checkout_started with the source and kind.
- Ops doc: the source table, deploy order and the queries to count
checkouts and completions per source.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every Cloud checkout now names the place it started, so Stripe can count checkouts and completions per entry point, including the first-success offer (#1078). Website side: HelpCode-ai/anythingmcp-website#396.
Why
trial_sourcenever showed upThe plumbing from #1078 and website #380 worked, but only on one path: a click on the first-success card that went to
/start-trial?source=first_successand pressed the button on that same visit. No other way into a checkout sent a source. That covers the trial banner, Settings > License, the ended-trial wall, "add a card" after Approve, the sign-up prompt, the chat's setup links, and every pricing link from the app and from the emails. The card and the email also shared one value.Production since 13 Oct:
via=app.What changes
Allow-list
CHECKOUT_SOURCESinlicense-checkout.ts, mirrored infrontend/src/lib/checkout-source.ts. Values:first_success_banner,first_success_email,trial_banner,license_page,trial_ended_wall,post_approve,signup_prompt,trial_limit,starter_pack,chat_setup,start_trial,app. The oldfirst_successis still accepted, for emails already sent and tabs already open.POST /api/license/checkout-linkalways sends a source. It usesappwhen the page didn't name one.Entry points each name themselves. Settings > License passes on the source of the offer email or the chat setup tools when they link there.
Pricing links carry
?source=:app_pricingby default, or the name of the place the link sits;email_trial_warn3,email_trial_warn1,email_trial_expiredandemail_winback.The site records these as
checkout_sourceonce website chore(deps-dev): bump typescript-eslint from 8.62.0 to 8.62.1 #396 is live.The offer email links with
first_success_email, so it's counted apart from the card./start-trialreportsstart_trial_viewed(once per load) andstart_trial_checkout_started, both withsourceandkind. Clicks from the email become measurable this way.docs/operations/card-trial-offer.mdgets the source table, the deploy order, and the queries for checkouts and completions per source.Deploy order
No hard order. The site already stores any slug it gets on an intent, so this works against today's site, with the source landing in
trial_source. Deploying the website PR first is better: then every checkout lands incheckout_source, and the email and app pricing links are recorded from the start.Checks
tscclean, full jest suite green (658 suites).tscclean,next buildpasses, full Playwright suite green (183). New cases cover the card's and the email's sources, the/start-trialevents, the licence page passing the email's source on, and the banner, wall and pricing-link sources.