Skip to content

Signup: preserve the ref parameter from login through account creation - #113577

Draft
bluefuton wants to merge 3 commits into
trunkfrom
fix/akismet-signup-flow
Draft

Signup: preserve the ref parameter from login through account creation#113577
bluefuton wants to merge 3 commits into
trunkfrom
fix/akismet-signup-flow

Conversation

@bluefuton

@bluefuton bluefuton commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Proposed Changes

  • getSignupUrl() now carries a ref query parameter from the login page through to /start, /start/account, and /start/<signup_flow>.
  • createAccount() forwards that ref to /users/new and /users/social/new, so the referrer is recorded against the new account.
  • ref is only forwarded when it is a non-empty string after trimming; anything else (arrays, objects, whitespace) is dropped.
  • Unit tests cover the new passthrough and the rejected values.

Why are these changes being made?

Sign-ups that start on akismet.com arrive at WordPress.com with ?ref=…, but the parameter was dropped as soon as the user bounced through /log-in on the way to /start. Without it, the account-creation request had no record of where the user came from, so these sign-ups couldn't be attributed to Akismet.

The change is deliberately generic: any product that sends users to log-in with a ref now keeps it through to account creation, rather than adding an Akismet-specific path.

Testing Instructions

  1. Visit /log-in?ref=akismet and click Create an account.
  2. Confirm the URL you land on is /start?ref=akismet (or /start/account?redirect_to=…&ref=akismet when a redirect is present).
  3. Complete sign-up and confirm the POST to /users/new (or /users/social/new for social sign-up) includes ref=akismet in the payload.
  4. Repeat with /log-in?ref= and with no ref at all — the sign-up URL and payload should be unchanged from trunk.
  5. yarn test-client client/lib/login/test/index.js

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • For UI changes, have you tested the affected components in dark mode?
  • Have you tested accessibility for your changes? Ensure the feature remains usable with various user agents (e.g., browsers), interfaces (e.g., keyboard navigation), and assistive technologies (e.g., screen readers) (PCYsg-S3g-p2).
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@bluefuton bluefuton self-assigned this Aug 13, 2026
@github-actions

Copy link
Copy Markdown

Looks like one of the E2E tests has failed.

You can fix them following these steps:

  1. Check out this branch locally:
    gh pr checkout 113577
  2. Start Claude Code in the repo:
    claude
  3. Run the /fix-e2e-tests skill, passing this PR number:
    /fix-e2e-tests 113577
    

@bluefuton bluefuton changed the title Akismet: track signups from akismet.com via akismet signup flow Signup: preserve the ref parameter from login through account creation Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant