jetpack
jetpack copied to clipboard
JS Package Licensing: Record events related to license activations
Fixes 1164141197617539-as-1202857845845246
Changes proposed in this Pull Request:
- Add the
@automattic/jetpack-analytics
dependency tojs-packages/licensing
to record events associated with license activations. - Update the
@automattic/jetpack-licensing
dependency to include these changes in the Jetpack plugin. - Record when the user visits the license activation page.
- Record when the user submits a license key.
- Record the result of a license activation attempt.
Other information:
- [x] Have you written new tests for your changes, if applicable?
- [x] Have you checked the E2E test CI results, and verified that your changes do not break them?
Jetpack product discussion
The result of a discussion over Slack was captured in 1164141197617539-as-1202857845845246.
Does this pull request change what data or activity we track or use?
As mentioned in the description, we will track the following events:
- When the user visits the license activation page.
- When the user submits a license key.
- The result of a license activation attempt.
Testing instructions:
- Apply this patch to your Jetpack installation using Jetpack Beta or a similar medium.
- Connect your WP Admin user to WordPress.com via the Jetpack Connection.
- Open the Network tab to see the network traffic.
- Enter
jetpack_wpa_
in the search bar to see only the traffic we care about. - Visit
https://your-jetpack-site/wp-admin/admin.php?page=jetpack#/license/activation
. - Make sure we record an event called
jetpack_wpa_license_key_activation_view
. - Enter any text into the License Key input box (not a real license key), and submit it.
- Make sure we record an event called
jetpack_wpa_click
with target equal tolicense_activation_button
. - After the attempt fails, make sure we record an event called
jetpack_wpa_license_activation_error
. - Open a new tab, visit https://cloud.jetpack.com/pricing, purchase a Jetpack license, and copy the license key to your clipboard.
- Go back to the other tab (
https://your-jetpack-site/wp-admin/admin.php?page=jetpack#/license/activation
). - Paste the real license key you just purchased.
- Make sure we record an event called
jetpack_wpa_click
with target equal tolicense_activation_button
. - After the attempt succeeds, make sure we record an event called
jetpack_wpa_license_activation_success
.
Thank you for your PR!
When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
- :white_check_mark: Include a description of your PR changes.
- :white_check_mark: All commits were linted before commit.
- :white_check_mark: Add a "[Status]" label (In Progress, Needs Team Review, ...).
- :white_check_mark: Add testing instructions.
- :white_check_mark: Specify whether this PR includes any changes to data or privacy.
- :white_check_mark: Add changelog entries to affected projects
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation :robot:
The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.
Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. Then, add the "[Status] Needs Team review" label and ask someone from your team review the code. Once you’ve done so, switch to the "[Status] Needs Review" label; someone from Jetpack Crew will then review this PR and merge it to be included in the next Jetpack release.
Jetpack plugin:
- Next scheduled release: November 1, 2022.
- Scheduled code freeze: October 25, 2022.
Are you an Automattician? You can now test your Pull Request on WordPress.com. On your sandbox, run bin/jetpack-downloader test jetpack add/licensing-package-analytics
to get started. More details: p9dueE-5Nn-p2
Seems ok from a code perspective, and I see someone else has reviewed from a functional perspective.
Needs a trunk merge though.
Merge done. Thanks, @anomiex !