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

Jetpack Manage Banner: Add tracking info to the CTA and update event names in Jetpack #35378

Merged
merged 8 commits into from
Feb 2, 2024

Conversation

cleacos
Copy link
Contributor

@cleacos cleacos commented Jan 31, 2024

Fixes https://github.com/Automattic/jetpack-manage/issues/271

Add better tracking to the two Jetpack Manage banners (they exist in the My Jetpack package and the Jetpack plugin).

Proposed changes:

We aim to improve tracking by listening for all button/link clicks and when the banners are viewed.
We're adding in a "viewed" track as well since the banner is conditionally loaded, so just using page visits would not give an accurate enough representation of usage.
This PR adds tracking info to the CTAs in the Jetpack Manage Banner in My Jetpack:

Tracked events - My Jetpack

  • View: jetpack_myjetpack_manage_banner_view
    • feature: 'manage'
    • page: props.path
  • Clicks: jetpack_myjetpack_manage_banner_click
    • feature: manage
    • target: the same event is used with different target values to register different CTA clicks:
      • target: jp-manage-learn-more
      • target: jp-manage-dashboard-sites
      • target: jp-manage-sign-up

Tracked events - Jetpack dashboard

  • View: jetpack_manage_banner_view
    • feature: manage
    • page: /dashboard
  • Clicks: jetpack_wpa_click
    • feature: manage
    • page: /dashboard
    • target: the same event is used with different target values to register different CTA clicks:
      • target: jp-manage-learn-more
      • target: jp-manage-dashboard-sites
      • target: jp-manage-sign-up

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

https://github.com/Automattic/jetpack-manage/issues/238

Does this pull request change what data or activity we track or use?

Yes. It adds 4 new tracking event as described in the "Proposed changes" section.

Testing instructions:

  • Go to /wp-admin/admin.php?page=my-jetpack (with and without a Jetpack Manage user, with 2 or more sites attached to them)
  • Click on "Learn more" and "Manage sites" (or "Sign up for free", depending on if the user has access to Jetpack Manage or not).
  • Verify that 2-3 jetpack_myjetpack_manage_banner_click events are triggered with expected targets:
    - target: jp-manage-learn-more
    - target: jp-manage-dashboard-sites
    - target: jp-manage-sign-up
  • Go to /wp-admin/admin.php?page=jetpack#/dashboard (with and without a Jetpack Manage user, with 2 or more sites attached to them)
  • Verify that the jetpack_manage_banner_view event is triggered
  • Click on "Learn more" and "Manage sites" (or "Sign up for free", depending on if the user has access to Jetpack Manage or not).
  • Verify that 2-3 jetpack_wpa_click events are triggered with expected targets:
    • jp-manage-learn-more
    • jp-manage-dashboard-sites
    • jp-manage-sign-up

@cleacos cleacos self-assigned this Jan 31, 2024
Copy link
Contributor

github-actions bot commented Jan 31, 2024

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WordPress.com Simple site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin, and enable the add/my-jetpack-manage-banner-tracking-info branch.

  • To test on Simple, run the following command on your sandbox:

    bin/jetpack-downloader test jetpack add/my-jetpack-manage-banner-tracking-info
    

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions github-actions bot added [Package] My Jetpack [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ Admin Page React-powered dashboard under the Jetpack menu labels Jan 31, 2024
Copy link
Contributor

github-actions bot commented Jan 31, 2024

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ 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 🤖


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 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 reviewed, it can then be merged.
If you need an extra review from someone familiar with the codebase, you can update the labels from "[Status] Needs Team Review" to "[Status] Needs Review", and in that case Jetpack Approvers will do a final review of your PR.


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen daily.
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly. The next release is scheduled for February 6, 2024 (scheduled code freeze on February 5, 2024).

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Backup plugin:

  • Next scheduled release: March 5, 2024.
  • Scheduled code freeze: February 26, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Boost plugin:

  • Next scheduled release: March 5, 2024.
  • Scheduled code freeze: February 26, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Search plugin:

  • Next scheduled release: March 5, 2024.
  • Scheduled code freeze: February 26, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Social plugin:

  • Next scheduled release: March 5, 2024.
  • Scheduled code freeze: February 26, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Starter Plugin plugin:

  • Next scheduled release: March 5, 2024.
  • Scheduled code freeze: February 26, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Protect plugin:

  • Next scheduled release: March 5, 2024.
  • Scheduled code freeze: February 26, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Videopress plugin:

  • Next scheduled release: March 5, 2024.
  • Scheduled code freeze: February 26, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.


Migration plugin:

  • Next scheduled release: March 5, 2024.
  • Scheduled code freeze: February 26, 2024.

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@cleacos cleacos added [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ Admin Page React-powered dashboard under the Jetpack menu and removed Admin Page React-powered dashboard under the Jetpack menu [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ labels Jan 31, 2024
@cleacos cleacos requested review from a team and tbradsha January 31, 2024 23:43
@cleacos cleacos marked this pull request as ready for review January 31, 2024 23:43
@cleacos cleacos added [Status] Needs Team Review [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. and removed [Status] In Progress labels Jan 31, 2024
@github-actions github-actions bot added [Status] In Progress [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Migration [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Starter Plugin [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. labels Jan 31, 2024
@kallehauge kallehauge removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. [Status] In Progress labels Feb 1, 2024
Copy link
Contributor

@kallehauge kallehauge left a comment

Choose a reason for hiding this comment

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

We have a couple of failing tests as well. One of them is just to merge trunk, so no worries about it, but I tried to rerun the E2E test earlier today and it didn't fix anything.

The E2E test is something about not being able to fetch credentials, so it seems very unrelated to this PR; so maybe merging trunk will fix it? 😄

@cleacos
Copy link
Contributor Author

cleacos commented Feb 2, 2024

The E2E test is something about not being able to fetch credentials, so it seems very unrelated to this PR;

Yep, it's unrelated; I saw the same error in other PRs.


I already recalled where I borrowed that code from the previous existing banner: https://github.com/Automattic/jetpack/pull/35283/files#diff-30fa007f36904a42a4886e3ce92058f8c3d9b155fe46f13246ca382c83eb76e1

The thing is that we cannot use arrow functions in props, and probably that is the reason why they all are wrapped into a useCallback function, even if it's not strickly necessary, creating those "cache" versions of the functions is allowed and possible. Other alternatives I've been exploring didn't work, always I hit with the linter, telling me to wrap everything with the useCallback function.

In the end, handleXXXXClick functions will depend on trackClick which will depend on XXX. So to me it makes sense.

I updated the code, but the click handling is almost the same, only minor tweaks.

@cleacos cleacos force-pushed the add/my-jetpack-manage-banner-tracking-info branch from 524e656 to 2e79ab4 Compare February 2, 2024 11:55
@kallehauge kallehauge added the [Status] Needs Privacy Updates Our support docs will need to be updated to take this change into account label Feb 2, 2024
Copy link
Contributor

@kallehauge kallehauge left a comment

Choose a reason for hiding this comment

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

LGTM and manual testing is working as expected (verified via Tracks live view)

@kallehauge kallehauge merged commit 8821d6d into trunk Feb 2, 2024
68 checks passed
@kallehauge kallehauge deleted the add/my-jetpack-manage-banner-tracking-info branch February 2, 2024 22:26
spsiddarthan pushed a commit that referenced this pull request Feb 15, 2024
…names in Jetpack (#35378)

* Add tracking info to the JP Manage banner clicks

* Update the trackEvent target in Jetpack dashboard

* changelog

* Update My Jetpack package version

* Add changelogs after my-jetpack package update

* Add the view event to Manage Banner in My Jetpack

* Add the view event to Manage Banner in Jetpack dashboard

* Code tweaks. Removing unnecessary useCallback hook.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Admin Page React-powered dashboard under the Jetpack menu [Package] My Jetpack [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Plugin] Migration [Plugin] Protect A plugin with features to protect a site: brute force protection, security scanning, and a WAF. [Plugin] Search A plugin to add an instant search modal to your site to help visitors find content faster. [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Starter Plugin [Plugin] VideoPress A standalone plugin to add high-quality VideoPress videos to your site. [Status] Needs Privacy Updates Our support docs will need to be updated to take this change into account
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants