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

Add WooCommerce onboarding connection track events and stop auto authorization for the new onboarding flow #34414

Merged
merged 5 commits into from
Jul 3, 2019

Conversation

justinshreve
Copy link
Contributor

@justinshreve justinshreve commented Jul 2, 2019

This PR adds some WooCommerce Onboarding connection track events to the WooCommerce onboarding connection flow (see #34414 and p6riRB-4rG-p2 forbackground). Note that these events are only fired in this context, and not during normal Jetpack onboarding.

It also adds a few additional missing styles to the connection page, and stops auth authorization from happening for the new WooCommerce flow.

Screen Shot 2019-07-02 at 3 46 13 PM

See p1560449057014200-slack-wc-onboarding for background on the events.

Branched from #34380.

Testing instructions

  • npm run test-client to make sure all tests pass.

--

If you have WooCommerce / WooCommerce Admin Installed:

  • Enable the onboarding flow in WooCommerce Admin and to tell it to point at local Calypso.
    • Start WooCommerce in development (not plugin) mode
    • Define the following constant in your wp-config.php or a plugin file: define( 'WOOCOMMERCE_CALYPSO_LOCAL', true );.
    • Make a POST request to /wp-json/wc-admin/v1/onboarding/profile on your local site, setting skipped and completed to false.
  • Visit /wp-admin/admin.php?page=wc-admin on your local site, and the onboarding wizard should be displayed.
  • Click Get Started, and then Activate & Continue.

If you don't want to install WooCommerce / WooCommerce Admin:

  • Disconnect Jetpack from your site

  • Click “Setup Jetpack”.

  • On the connection/authorization screen ( https://wordpress.com/jetpack/connect/authorize?client_id= ….. ) copy and paste the whole URL.

  • Replace https://wordpress.com with http://calypso.localhost:3000 and replace the from parameter in the URL (it may be something like connection-banner or landing-page-bottom) with from=woocommerce-setup-wizard . See Pastebin 213d5 or ping me if you have issues.

  • Paste localStorage.setItem( 'debug', 'calypso:analytics*' ); in your console.

  • Test login and signup to see that events are firing.

You may run into an issue testing logged out, if your store email matches a WPCOM account. D30046-code will help with this.

@justinshreve justinshreve added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. Store labels Jul 2, 2019
@justinshreve justinshreve requested review from timmyc and joshuatf July 2, 2019 15:42
@justinshreve justinshreve requested review from a team as code owners July 2, 2019 15:42
@justinshreve justinshreve self-assigned this Jul 2, 2019
@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

matticbot commented Jul 2, 2019

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

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

name        parsed_size           gzip_size
entry-main       +146 B  (+0.0%)      +49 B  (+0.0%)

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

Sections (~544 bytes added 📈 [gzipped])

name             parsed_size           gzip_size
jetpack-connect      +1146 B  (+0.2%)     +260 B  (+0.2%)
accept-invite         +456 B  (+0.3%)     +155 B  (+0.4%)
login                 +442 B  (+0.3%)     +129 B  (+0.4%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Async-loaded Components (~272 bytes added 📈 [gzipped])

name                          parsed_size           gzip_size
async-load-signup-steps-user       +456 B  (+0.5%)     +155 B  (+0.7%)
async-load-design-blocks           +442 B  (+0.0%)     +117 B  (+0.0%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

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.

@justinshreve justinshreve changed the title Add WooCommerce onboarding connection track events Add WooCommerce onboarding connection track events and stop auto authorization for the new onboarding flow Jul 2, 2019
@justinshreve justinshreve force-pushed the add/woocommerce-connect-tracks branch from c7e486c to d8c08d7 Compare July 2, 2019 19:47
Copy link
Contributor

@timmyc timmyc left a comment

Choose a reason for hiding this comment

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

I tested out the flow with a jurassic.ninja site and can verify the tracks events were being fired 👍

@timmyc timmyc added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Jul 2, 2019
@justinshreve justinshreve force-pushed the add/woocommerce-connect-tracks branch from d8c08d7 to b5e2455 Compare July 3, 2019 14:51
@justinshreve justinshreve requested review from a team as code owners July 3, 2019 14:51
@justinshreve justinshreve changed the base branch from update/woocommerce-onboarding-connect to master July 3, 2019 14:51
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.

4 participants