A visit completes a checkout funnel when it contains a payment after an eligible checkout start and within the allowed time. Give each visit one vote. Checking only whether both event names appear can count a payment that happened before checkout.
Which checkout attempts qualify?
Suppose a retailer reporting in USD wants to know what share of visits starting checkout reach payment within 30 minutes of any start. A retry opens a new 30-minute window within the same visit. Multiple successful events still count as one completed visit. This definition answers a visit-level question. Order success rates require order identifiers, and payment amounts belong in a separate revenue measure.
Run the four-visit example
The synthetic export uses elapsed UTC minutes and local visit identifiers. The US and UK both have a visit numbered 1, so the key includes the market. Assume each visit is fully observed through the end of its last checkout window. Events with the same minute cannot establish strict order here.
WITH events(market,visit,step,minute) AS (
VALUES ('US',1,'checkout',10), ('US',1,'paid',12),
('US',1,'paid',13), ('UK',1,'paid',5),
('UK',1,'checkout',8), ('DE',2,'checkout',2),
('DE',2,'checkout',9), ('DE',2,'paid',39),
('US',3,'checkout',4), ('US',3,'paid',35)
), starts AS (
SELECT DISTINCT market,visit FROM events
WHERE step='checkout'
), outcomes AS (
SELECT s.*, EXISTS (
SELECT 1 FROM events c JOIN events p
ON p.market=c.market AND p.visit=c.visit
WHERE c.market=s.market AND c.visit=s.visit
AND c.step='checkout' AND p.step='paid'
AND p.minute > c.minute
AND p.minute <= c.minute+30
) AS completed FROM starts s
)
SELECT COUNT(*) AS started, SUM(completed) AS paid,
100.0*SUM(completed)/NULLIF(COUNT(*),0) AS pct
FROM outcomes;
Why do only two visits qualify?
US visit 1 starts at minute 10 and pays at minutes 12 and 13. It contributes one completion. UK visit 1 pays at minute 5 and starts at minute 8, so it contributes only to the denominator. Joining on visit number alone would allow US payments to satisfy the UK checkout.
The German visit starts at minutes 2 and 9, then pays at 39. That is exactly 30 minutes after the retry, so it qualifies. US visit 3 pays 31 minutes after its only start and misses the cutoff. The query returns four started visits, two completed visits and a 50% rate. Counting visits that contain both event names regardless of order and elapsed time would give 100%.
What if the business means the first checkout only?
Anchor the deadline to the first checkout in each visit. Under that definition, Germany’s minute-39 payment misses its minute-32 deadline. The same events then yield one completion in four visits, or 25%. Ask which definition matches the decision before interpreting a change in the dashboard.
For production data, carry the full payment window beyond the report boundary or mark recent starts as pending. Use timestamps at their original precision and a trustworthy event sequence for ties. If you need to construct visit identifiers first, see how to turn events into sessions. For instrumentation, see the confirmed-lead tracking example.
The SQLite expression reference explains why EXISTS returns one flag even when several payments match a visit.