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: Log event on page load #94732

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

renancarvalho
Copy link
Contributor

@renancarvalho renancarvalho commented Sep 19, 2024

Related to #94717
Fixes #94717

Proposed Changes

  • Make sure it calls recordSignupStart on page load, currently there's an issue that it is not called upon page refresh.
  • Add useEffect hook together with initialState variable to handle page load

Why are these changes being made?

Testing Instructions

  • Use live link and navigate to /setup/onboarding
  • On domains or plans step, make sure the calypso_signup_start is triggered only once upon page refresh.
  • Navigate between steps and refresh the page, it should log only once.
  • Use /start/onboarding as a reference

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

@renancarvalho renancarvalho self-assigned this Sep 19, 2024
@renancarvalho renancarvalho requested a review from a team as a code owner September 19, 2024 20:23
@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 Sep 19, 2024
@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug fix/domains_tracking_mount on your sandbox.

@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        +98 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.

@escapemanuele escapemanuele requested review from a team and chriskmnds September 19, 2024 21:22
Copy link
Contributor

@chriskmnds chriskmnds left a comment

Choose a reason for hiding this comment

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

On domains or plans step, make sure the calypso_signup_start is triggered only once upon page refresh.
Navigate between steps and refresh the page, it should log only once.

This is the basis that I am basically questioning below. Please feel free to object/question the direction.

I have a separate PR that makes this hook record the event unconditionally and also handles not being recorded on refresh. See #94743

Let's please hold off proceeding here until we review #94743, as that may be the direction to go

// this ensures it gets logged after a page refresh.
useEffect( () => {
if ( isInitialMount ) {
recordSignupStart( flowName, ref, extraProps || {} );
Copy link
Contributor

Choose a reason for hiding this comment

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

This leads to the same situation we are trying to resolve in discussion #94175 (comment)

We shouldn't ignore any additional/extra props. If the event gets recorded multiple times because of it, then so be it. Analytics can pick the first. This is my understanding from it, and how we can proceed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. Stepper
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stepper: calypso_signup_start not being triggered on refresh
3 participants