Skip to content

feat: read save and continue as a checkout step on checkout routes - #1729

Merged
crisryantan merged 2 commits into
v3-developmentfrom
feat/checkout-intent-save-and-continue
Oct 29, 2026
Merged

crisryantan merged 2 commits into
v3-developmentfrom
feat/checkout-intent-save-and-continue

Conversation

@crisryantan

Copy link
Copy Markdown
Contributor

Summary

Some checkouts end their payment step with a Save & Continue button that leads to an order review page. When the review page doesn't load the SDK, that button is the last click checkout intent can see, and today it isn't classified at all.

This reads save and continue (including Save & Continue) as a checkout_step, with three limits:

  • only on a checkout route, because the same label saves profile and address forms elsewhere
  • not on a confirmation page under a checkout route
  • not on a plain link, which stays navigation

A checkout_step click only fires a pre-selection entry that opts in with checkoutStepIntent, so this changes nothing for existing entries.

Testing

  • New cases in test/jest/buttonTracking/checkoutIntent.spec.ts: a checkout route, a non-checkout route, a confirmation path and a plain link.
  • npx jest test/jest/buttonTracking: 1,058 passed.

🤖 Generated with Claude Code

Some checkouts end their payment step with a Save and Continue button that leads to the
order review, so it is the last click on a page that loads the SDK. It now counts as a
checkout step there. It stays out of intent everywhere else, since the same label saves
profile and address forms, and a plain link with it is still navigation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@crisryantan
crisryantan requested a review from a team as a code owner October 29, 2026 14:55
@codecov

codecov Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (v3-development@dedca69). Learn more about missing BASE report.

Additional details and impacted files
@@                Coverage Diff                @@
##             v3-development    #1729   +/-   ##
=================================================
  Coverage                  ?   63.27%           
=================================================
  Files                     ?       79           
  Lines                     ?    10390           
  Branches                  ?     2978           
=================================================
  Hits                      ?     6574           
  Misses                    ?     3505           
  Partials                  ?      311           
Flag Coverage Δ
core 53.67% <100.00%> (?)
rokt-kit 92.58% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing blocking. The comments below are optional suggestions. There is no need to push a fix for them before merging.

Comment thread src/buttonTracking/checkoutIntent.ts Resolved
Gate the label on a checkout segment, not the wider checkout route that also counts bare
payment and order segments, and skip account and confirmation paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@jaissica12 jaissica12 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium. Changes which controls count as checkout intent on payment and order routes.

What it does: reads Save and continue as a checkout step on checkout routes, excluding account, confirmation and login pages. To do that, it widens the shared checkout route match to include payment, order and some localised segments.

Findings:

  1. Blocking, unintended scope: the wider route match also feeds the commit check through getIntentRouteClass (routeGatedCommits). So commit labels such as Place order or Pay now now count as checkout intent on /payment and /order pages, where they did not before. The PR description doesn't mention this, and the spec covers only the save-and-continue cases. Please either confirm the commit change is intended and add tests for it, or limit the wider match to the save-and-continue rule.

Checked:

  • Read the source and spec diff at head 782b2c9 against v3-development (dedca69).
  • The save-and-continue rule excludes account, confirmation and login paths, and the spec covers those cases.
  • getIntentRouteClass is used only in the commit check at line 320.

Not verified: did not run the jest suite or the build. Did not check which real pages use /payment or /order routes that would now be affected.

@crisryantan

Copy link
Copy Markdown
Contributor Author

Hey @jaissica12, the route match didn't widen. payment, order and the localised segments are already in checkoutPath on v3-development (line 22), and this PR only pulls the checkout part out into CHECKOUT_SEGMENT so the new rule can reuse it. The rebuilt regex has the same source and flags as the old literal, so the commit check behaves exactly as before. Also, Place order and Pay now are plain commits that aren't route-gated at all.

@jaissica12 jaissica12 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: low. Adds one checkout-step label rule with a route gate.

What it does: reads Save and continue as a checkout step only on a checkout route, excluding account, confirmation and login pages.

Correction to my earlier review: I said the route match widened to include payment and order routes, and that this changed commit detection. That was wrong. payment, order and the localised segments were already in checkoutPath on v3-development, and this PR only moves the checkout part into CHECKOUT_SEGMENT. Commit detection is unchanged. The new rule uses checkoutSegmentPath, which needs a real checkout segment, so account payment and order pages stay out.

Findings: no blocking findings.

Checked:

  • Compared checkoutPath on v3-development with the head at 782b2c9.
  • The save-and-continue rule uses checkoutSegmentPath, and the spec covers /account/payment, /my-account/payment/, /order/123/edit, /checkout/account and /checkout/confirmation.

Not verified: did not run the jest suite or the build.

@crisryantan
crisryantan merged commit 08683ce into v3-development Oct 29, 2026
66 checks passed
@crisryantan
crisryantan deleted the feat/checkout-intent-save-and-continue branch October 29, 2026 18:09
github-actions Bot pushed a commit that referenced this pull request Oct 30, 2026
# [3.28.0](v3.27.0...v3.28.0) (2026-10-30)

### Bug Fixes

* **button-tracking:** hide only the token in a named path segment, and keep account pages under u ([#1734](#1734)) ([222a548](222a548))
* keep exit upload batches the browser refuses to send ([#1736](#1736)) ([aa6eea5](aa6eea5))
* keep the page title out of the auto page view log line ([#1725](#1725)) ([0133361](0133361))
* send auto click events with the batch instead of uploading each at once ([#1735](#1735)) ([12dcaf3](12dcaf3)), closes [#1642](#1642)

### Features

* read save and continue as a checkout step on checkout routes ([#1729](#1729)) ([08683ce](08683ce))
* **rokt:** let a pre-selection default name groups of values that count as a match ([#1728](#1728)) ([59c920a](59c920a))
@mparticle-automation

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 3.28.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants