Free sample · no email · 2,396 of 11,898 words
The Conversion Tracking & Cart Recovery Playbook
The opening of the playbook as your AI agent reads it. The full volume adds the step-by-step playbook, the prompts, the checklist and the sources.
1. The problem
What this looks like on a small site
The method in this book came out of one small site: a digital-product store that sells through Stripe and runs on Cloudflare. In its first weeks three things happened. All three are common, and they are easy to miss.
- The analytics tool saw almost nobody. GA4 ran behind a cookie banner with Google Consent Mode. On the same days, GA4 reported 3 users in total, while Cloudflare’s dashboard showed roughly 150 to 340 visitors a day. Neither number was right. The Cloudflare count included crawlers, and GA4 only saw the few people who clicked “accept”. The owner couldn’t answer the basic question: where did today’s visitors come from?
- Carts were lost with no way back. The site sold through Stripe Payment Links. Five real buyers started a checkout and didn’t finish. None of the five had left an email anywhere, so there was nobody to contact and no recovery link to send.
- A gated offer got zero sign-ups. A free resource sat behind an email form (“enter your email to get it”). It collected 0 sign-ups. Once a free taste was offered without any email, plus a clear starter kit for those who wanted more, people started using the product and some left an address.
That is one site’s observation, not a benchmark. The mechanisms behind each one are documented, though, and they apply to almost any small site.
Why GA4 with Consent Mode undercounts
Google’s Consent Mode has two implementations. In basic mode, Google tags don’t load until the visitor interacts with the consent banner. If they decline, nothing is sent to Google, not even the consent state. In advanced mode, tags load at once with consent defaulting to denied. For visitors who decline, they send cookieless pings without identifiers.
Advanced mode lets GA4 model the behaviour of people who declined, but only when the property is eligible. Google’s published thresholds are at least 1,000 events a day with analytics_storage denied for at least 7 days, and at least 1,000 daily users with it granted on at least 7 of the previous 28 days. Even then, Google says that if there isn’t enough consented traffic, events from users who decline aren’t reported at all. A site with a few hundred visitors a day will never reach those thresholds. Its GA4 reports show only the people who accepted.
GA4 isn’t broken. It’s built to respect consent, and its gap-filling is built for large sites. For a small site that means:
- GA4 can still be useful for consented visitors and for Google Ads conversion import.
- GA4 can’t be your answer to “how many people came and where from” on a small site.
Why the host’s request counts don’t fix it
Server-side or edge request counts see every request, including crawlers, uptime checkers and scanners. A site that gets crawled heavily can show steady “visitors” that never existed. On the small site above, the free-plan Cloudflare traffic view also didn’t show where human visitors came from. Cloudflare does have a separate product, Web Analytics, with a JavaScript beacon that uses no cookies or localStorage and reports referrer hosts. It’s a reasonable off-the-shelf option. It can’t do two things this book needs, though: carry the visitor’s source into your own lead records and Stripe orders, and count your own funnel events (offer shown, email given, checkout clicked).
Why Payment Links lose carts
Stripe Payment Links are the fastest way to start selling, and this book keeps them as the fallback. Two things are missing when they are your only checkout:
- No recovery link. In the Payment Link API, there is no
after_expirationsetting. Stripe’s abandoned-cart recovery is configured when you create a Checkout Session, withafter_expiration.recovery.enabled. When a recovery-enabled session expires, Stripe puts a recovery URL in thecheckout.session.expiredevent. That URL stays usable for 30 days and opens a fresh copy of the abandoned session. - No email for the people who leave. Stripe’s own docs note that when a Checkout Session expires, the webhook payload doesn’t include the customer’s email unless they gave promotional consent. Stripe offers that consent checkbox only when both the business and the customer are in the US. Outside that case, the buyer who typed their email into Stripe’s form and then closed the tab is invisible to you.
The fix is to capture the email on your own site, before Stripe, as an optional step, and to create the Checkout Session yourself.
Why gated offers collect nothing
An email gate in front of a free thing asks for trust before giving value. On a new site with no reputation, many visitors won’t pay that price. The honest alternative is to give a real taste with no email (a sample chapter, a demo, a free tier, an API that works without a key). Then offer something extra and specific to the people who want more, at moments when they have just seen value. Chapter 4.7 covers the placements.
What good looks like
At the end of this book you have:
- A first-party, cookie-free counter that records, per day, visits by source, landing pages, page views, device, country and your funnel events. Visitors get no IDs, no IPs are stored and no cookies are set.
- A first-touch source label stored in the visitor’s browser and attached to every lead record and to every Stripe Checkout Session as
client_reference_id. - An optional email step before checkout that saves a lead and pre-fills Stripe.
- Your own Checkout Sessions with recovery enabled, the right promo behaviour and a fallback to the Payment Link on any error.
- A handler for expired sessions that sends one polite recovery email when you have permission to.
- Three to five honest capture points, including a free taste without email.
- A daily report you read in two minutes, plus a 7-day and a 30-day review that ends in one decision.
2. Before you start
Inputs you need
- The site code and a way to add one script to the
<head>of every page (a shared layout or template). - A backend you control that can receive a POST from the browser and call the Stripe API: a Cloudflare Worker, a serverless function, or a small server. The examples use a Worker with a KV namespace.
- A key-value store or database for daily counter documents and lead records.
- Stripe: your products, prices and Payment Links already working; the secret key in a secret store; a webhook endpoint that already fulfils orders on
checkout.session.completed(Vol. 43 covers this). - An email sender for transactional mail (receipts, keys, the recovery message).
- The list of places you link from: directories, social profiles, newsletters, ads, communities, partner sites.
Access matrix
| Who | Needs |
|---|---|
| You | Stripe Dashboard owner (settings, terms), DNS/hosting, ad accounts |
| Agent | Repo read/write, local dev, a Stripe test-mode or sandbox key in env, deploy only after your review |
| Nobody | Live secret keys in chat, commits or logs |
Decisions to make first
- Source label format. Lowercase,
a-z0-9-only, at most 40 characters. Decide your channel names now (hn,reddit,newsletter,x,producthunt,google-ads,partner-<name>). - First touch or last touch. This book stores the first source a browser arrived with and keeps it. First touch answers “which channel finds new buyers”, which is the question a small site asks first. Your daily counter still records the source of every visit, so you see both.
- Where privacy lands. The aggregate counter stores no identifiers. Two other parts do touch personal data or device storage: the first-touch label kept in
localStorage, and the link between that label and an email or order. Decide with Vol. 46 (and advice if you sell into the EU or UK) whether you keep the label only after consent, keep it for everyone and disclose it, or skip device storage. See 4.1. - Recovery email permission. Decide which reminder you will send and to whom: Stripe’s consent-based flow (US), a single service reminder to people who gave you their email at the checkout step for exactly that purpose, or none. See 4.6.
Intake checklist
- I can add a script to the head of every page from one place.
- I have a backend route I can deploy, and a store for daily documents.
- Stripe webhooks already fulfil orders on
checkout.session.completed. - I have the list of every Payment Link URL and its price ID.
- I have a transactional email sender with SPF/DKIM set up.
- I know which countries my buyers are in, and I’ve read the consent chapter of Vol. 46.
- I’ve written my channel names down.
3. The method
Eight steps. Steps 1 to 3 answer “where did this visitor come from”. Steps 4 to 6 stop losing carts. Step 7 adds honest ways to start a relationship. Step 8 tells you what to do next.
Step 1: Name your sources and tag every link
- What to do: Write a short source list. Add
?ref=<channel>to every link you control that points at your site: directory listings, social bios, posts, newsletters, partner pages and ads. Useutm_*too if you already do, but keeprefshort. - Why: Referrers are often missing (apps, email clients, privacy settings,
noreferrerlinks). A tag you placed yourself is the only label you can rely on. - Done when: A source list exists in the repo, and every outbound link you control carries a
reftag. The exceptions are fields that reject parameters, which are listed by name.
Step 2: Install the cookie-free counter
- What to do: Add a small beacon to the
<head>of every page. It sends the path, a landing flag, the tagged source, the referrer host and a device class to/api/hit. That route adds them to one daily document of aggregate counts. - Why: You need a count that doesn’t depend on a consent click or a third-party script, and that crawlers which don’t run JavaScript never reach.
- Done when: You open a page with
?ref=probe-<today>and the daily document shows one visit for that source, one landing on that path and one view.
Step 3: Carry the first touch into leads and Stripe
- What to do: The beacon stores the first source label in the browser. Every lead form sends it with the email. Every Stripe checkout carries it as
client_reference_id=ref_<label>. - Why: Visits tell you where traffic comes from. Leads and orders tell you which traffic matters. You only get that second answer if the label travels with the person.
- Done when: A test lead record shows the probe label, and a test-mode Checkout Session shows
client_reference_id = ref_probe-<today>.
Step 4: Add an optional email step before checkout
- What to do: Intercept clicks on your Stripe links. Show a small dialog (“Where should we send your receipt?”) with a Skip button. Save the email as a lead, then go on to checkout with the email pre-filled. Without JavaScript the plain link still works.
- Why: It’s the only point where you can get an email from someone who might abandon checkout, and you get it by offering something useful.
- Done when: All three paths work: email given (a lead is saved and the email is pre-filled in Stripe), skipped (straight to Stripe), and JavaScript off (the plain Payment Link opens).
Step 5: Create your own Checkout Sessions, with fallback
- What to do: Add a
/api/checkoutroute. It maps the Payment Link to its price and creates a Checkout Session with the email, the promo, tax, recovery and the reference ID. It redirects there, and on any error redirects to the original Payment Link with pre-fill parameters. - Why: Only sessions you create can turn recovery on. The fallback means a bug in your code costs you a feature, not a sale.
- Done when: In live mode, a probe checkout reaches a Stripe page with the email pre-filled and the promo applied. A forced error lands on the Payment Link. Both probe sessions are expired by hand.
Step 6: Handle expired sessions and send one recovery message
- What to do: Listen for
checkout.session.expired. If recovery is on and you have permission to email this person, send one short message with the recovery URL. Record that you sent it. Trackrecovered_fromon completed sessions. - Why: Recovery only helps if someone hears about it, and sending more than one message is how a reminder turns into spam.
- Done when: A test-mode session that you expire produces exactly one email to the test address with a working recovery link. A second expiry for the same email sends nothing.
Step 7: Put honest capture points in place
- What to do: Pick three to five capture points: a free taste with no email, a starter-kit offer shown once, an offer box at the end of each sample, the checkout email step, and gated continuation for people who finished a first lesson.
- Why: People give an email when they’ve seen value and know exactly what they’ll get. Tricks (fake timers, confirmshaming, pre-ticked boxes) cost trust and can break consumer-protection rules.
- Done when: Each capture point is live, says in one sentence what the person gets, and sends its own event (
lead:<point>). The free taste works with no email at all.
Step 8: Read the daily report, then decide at 7 and 30 days
- What to do: Run a small script each day that prints visits, views, leads and checkout clicks per day, plus top sources, landing pages and events. At day 7 and day 30, run the review in 4.8 and write down one decision.
- Why: The point of measurement is the next decision: which channel to double, which page to fix, which offer to drop.
- Done when: The report runs from one command. A dated review note exists for day 7, and later for day 30, each ending in one written decision.
Keep going: the full playbook
- Playbook steps
- Prompts
- Checklist
- Measuring results
- Common mistakes
Book + Claude skill + MCP access. Black Friday 2026 price. Back to the book page
Or start free
4 complete playbooks, the 7-day Claude Code course and a key your AI can use right now. No card.
Free. We email you about new lessons and volumes now and then. Unsubscribe any time.
Your free key
Install (Claude Code, Codex, Gemini CLI)
Other apps: add the MCP server https://playbookmcp.com/mcp with header Authorization: Bearer + your key. Keep this key; it is shown once.