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

Allow TOS agreement before Jetpack is fully active so we track the connection flow #14041

Merged
merged 4 commits into from
Nov 15, 2019

Conversation

gravityrail
Copy link
Contributor

@gravityrail gravityrail commented Nov 14, 2019

Fixes #14040

In #13763 we moved our ToS agreement code into a package, but we changed the logic at the same time. Now, instead of the user agreeing to the ToS when they click the connect button, it is not enabled until the site is fully active, which has essentially killed all the events we were getting during the connection flow.

Changes proposed in this Pull Request:

  • Allow sending events when user has agreed to ToS
  • As a fallback (on sites which may have been connected prior to the ToS flag being available) we also use is_active as a signal that the user has agreed to ToS
  • This also fixes a typo in an action name

Testing instructions:

  • It's helpful to add some debug code to the Tracks library so you can see if events are being sent
  • Go through the connect flow
  • Connection related events like jetpack_jpc_register_begin should now be sent. In 7.9 they were not sent.

@gravityrail gravityrail requested a review from a team November 14, 2019 18:34
@jetpackbot
Copy link

jetpackbot commented Nov 14, 2019

Warnings
⚠️

pre-commit hook was skipped for one or more commits

⚠️ "Proposed changelog entry" is missing for this PR. Please include any meaningful changes

This is an automated check which relies on PULL_REQUEST_TEMPLATE. We encourage you to follow that template as it helps Jetpack maintainers do their job. If you think 'Testing instructions' or 'Proposed changelog entry' are not needed for your PR - please explain why you think so. Thanks for cooperation 🤖

Generated by 🚫 dangerJS against f9416f5

@dereksmart dereksmart added [Pri] BLOCKER [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. [Feature] Tracks labels Nov 14, 2019
@dereksmart dereksmart added this to the 7.9.1 milestone Nov 14, 2019
Copy link
Contributor

@kraftbj kraftbj left a comment

Choose a reason for hiding this comment

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

Have not tested live, but it reads well.

dereksmart
dereksmart previously approved these changes Nov 14, 2019
Copy link
Member

@dereksmart dereksmart left a comment

Choose a reason for hiding this comment

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

image

Co-Authored-By: Derek Smart <smart@automattic.com>
@gravityrail gravityrail added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Nov 14, 2019
@gravityrail gravityrail added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Nov 14, 2019
@lezama
Copy link
Contributor

lezama commented Nov 14, 2019

@dereksmart I also noticed some consecutive events for jetpack_jpc_register_begin

lezama
lezama previously approved these changes Nov 14, 2019
We renamed the action lets also rename it in Jetpack.
Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

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

@enejb It seems you've edited jetpack_agreed_to_terms_of_service into jetpack_reject_terms_of_service. Did you mean to do that? We did not rename jetpack_agreed_to_terms_of_service.

@jeherve jeherve added [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! [Status] Needs Cherry-Pick and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Nov 15, 2019
@enejb
Copy link
Member

enejb commented Nov 15, 2019

Thanks for catching that @jeherve I reverted my last commit.

@enejb
Copy link
Member

enejb commented Nov 15, 2019

I tested this with both flows (original) and in place and it resulted in the same result.

Copy link
Member

@dereksmart dereksmart left a comment

Choose a reason for hiding this comment

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

Good again!

@dereksmart dereksmart added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! labels Nov 15, 2019
Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

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

Looking good to me. Merging.

@jeherve jeherve merged commit f275547 into master Nov 15, 2019
@jeherve jeherve deleted the fix/tos-stats-broken branch November 15, 2019 16:03
@matticbot matticbot added [Status] Needs Changelog [Status] Needs Package Release This PR made changes to a package. Let's update that package now. and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Nov 15, 2019
jeherve pushed a commit that referenced this pull request Nov 15, 2019
…we track… (#14041)

* Allow TOS agreement before Jetpack is fully active so we track the connection flow

* Update packages/terms-of-service/src/class-terms-of-service.php

Co-Authored-By: Derek Smart <smart@automattic.com>

* Also update the action that is being called in jetpack

We renamed the action lets also rename it in Jetpack.

* [not verified] Revert "Also update the action that is being called in jetpack"

This reverts commit e9c0f21.


Co-authored-by: Brandon Kraft <public@brandonkraft.com>
Co-authored-by: Enej Bajgoric <enej.bajgoric@gmail.com>
@jeherve
Copy link
Member

jeherve commented Nov 15, 2019

Cherry-picked to branch-7.9 in ba4b09d

@jeherve jeherve removed [Status] Needs Changelog [Status] Needs Cherry-Pick [Status] Needs Package Release This PR made changes to a package. Let's update that package now. labels Nov 15, 2019
gravityrail pushed a commit that referenced this pull request Nov 16, 2019
* Add products endpoint

* [not verified] Add error code

* Update _inc/lib/class.core-rest-api-endpoints.php

Co-Authored-By: Marin Atanasov <8436925+tyxla@users.noreply.github.com>

* Update _inc/lib/class.core-rest-api-endpoints.php

Co-Authored-By: Marin Atanasov <8436925+tyxla@users.noreply.github.com>

* Add QueryProducts data component and corresponding Redux and rest API calls

* Update _inc/client/state/site/reducer.js

Co-Authored-By: Marin Atanasov <8436925+tyxla@users.noreply.github.com>

* [not verified] Add SingleProductBackupBody component

* [not verified] Rename plans-section__body to single_product_backup__body

* [not verified] Give class name to h4 tag

* [not verified] Remove single_product_backup__body

* [not verified] Check for upgradeLinks and upgradeTitles before using them

* [not verified] Switch function style

* [not verified] Add key to PlanRadioButton

* Remove duplicate definition of getProducts

* Allow TOS agreement before Jetpack is fully active so we track… (#14041)

* Allow TOS agreement before Jetpack is fully active so we track the connection flow

* Update packages/terms-of-service/src/class-terms-of-service.php

Co-Authored-By: Derek Smart <smart@automattic.com>

* Also update the action that is being called in jetpack

We renamed the action lets also rename it in Jetpack.

* [not verified] Revert "Also update the action that is being called in jetpack"

This reverts commit e9c0f21.


Co-authored-by: Brandon Kraft <public@brandonkraft.com>
Co-authored-by: Enej Bajgoric <enej.bajgoric@gmail.com>

* Removed Jetpack references in the IXR client. (#14046)

This change allows the package to be used outside of Jetpack, relying on the methods provided by the Manager, plus using the WP_Error class instead of the Jetpack_Error wrapper.

* Full Sync: Don't allow more than one request to enqueue (#14039)

* Spell checking CI integration (#13992)

* Adds spell checking and fixes files.

This implements a package to spellcheck files, and
does a pass to ensure everything is green.

* [not verified] Implements Travis check for spelling

Adds Yarn script and Travis CI for spell checking.

* [not verified] Fixes feedback.

Updates docs to prevent spelling exceptions for certain files.

* Export SingleProductBackupBody class

* [not verified] No need to export single product backup body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No tracking during connection flow even though user has agreed to ToS
8 participants