Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stepper: Add a flag to skip the calypso_signup_start on sign up flows #91597

Merged
merged 2 commits into from
Jun 10, 2024

Conversation

gabrielcaires
Copy link
Contributor

@gabrielcaires gabrielcaires commented Jun 7, 2024

Solves part of #91280

Proposed Changes

  • Move all calypso_signup_start to a separate hook with automated tests.
  • Add a signed_up flag to skip the calypso_signup_start event when the user backs from the /account/user page.

Why are these changes being made?

We observed duplicated instance of calypso_signup_start. It is caused by the follow sequence of user interactions:

  • A non-logged user starts a signup flow (e.g. /setup/migration-signup)
  • The flow will trigger the calypso_signup_start
  • The user is redirected to /account/users with a redirect_to query param
  • After the login/signing the user is redirected back to the original flow
  • The original flow calls the calypso_signup_start again

The overall idea is to add a flag to the redirect_to param to indicate the user is backing from a sign-in flow.

Note

I am going to add the flag on the redirect_to on my next PR.

Testing Instructions

  • Open any flow with the flag isSignupFlow (E.g /setup/migration-signup)
  • Check if the event calypso_signup_start was triggered
  • Add the flag signed_up=1 to the current URL (E.g. /setup/migration-signup/site-migration-identify?siteSlug=YOUR_SITE&signed_up=1
  • Reload the page and check if no calypso_signup_start is triggered.

/

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?
  • 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 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)?

@matticbot
Copy link
Contributor

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~28 bytes added 📈 [gzipped])

name           parsed_size           gzip_size
entry-stepper       +101 B  (+0.0%)      +28 B  (+0.0%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@gabrielcaires gabrielcaires changed the title Fix/duplicated sign up tracking Stepper: Add flag to skip the calypso_signup_start on sign up flows Jun 7, 2024
@gabrielcaires gabrielcaires requested a review from a team June 7, 2024 11:58
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jun 7, 2024
@gabrielcaires gabrielcaires marked this pull request as ready for review June 7, 2024 11:58
@gabrielcaires gabrielcaires changed the title Stepper: Add flag to skip the calypso_signup_start on sign up flows Stepper: Add a flag to skip the calypso_signup_start on sign up flows Jun 7, 2024
Copy link
Contributor

@valterlorran valterlorran left a comment

Choose a reason for hiding this comment

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

Working as expected! One question tho: Are we supposed to fire the calypso_signup_step_start event even with the signed_up flag?

@daledupreez
Copy link
Contributor

One question tho: Are we supposed to fire the calypso_signup_step_start event even with the signed_up flag?

I think we should, yes: if the user views the step, we should trigger the event to show that they viewed the step. To me that makes sense.

@gabrielcaires gabrielcaires merged commit 6f03668 into trunk Jun 10, 2024
19 of 21 checks passed
@gabrielcaires gabrielcaires deleted the fix/duplicated-sign-up-tracking branch June 10, 2024 12:30
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jun 10, 2024
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.

4 participants