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

Centralise logic for calypso_customer_home_card_impression avoid null cards #91051

Merged
merged 2 commits into from
May 31, 2024

Conversation

daledupreez
Copy link
Contributor

@daledupreez daledupreez commented May 23, 2024

Proposed Changes

  • While looking at Tracks events being triggered from My Home, I realised that we are logging null for the card event prop in cases where we're using the two-column layout we added for the Launchpad in My Home.
  • This PR centralises the logging code into a new trackMyHomeCardImpression() helper function that supports a location value, and refactors the existing code that tracked these impressions to call the new function

Why are these changes being made?

  • I noticed that we're logging thousands of non-events, so we ought to stop doing that.
  • It also looked like our tracking for secondary cards was inconsistent, so I wanted to make sure we have visibility into which cards are being rendered
  • I also realised that it would be valuable to know where a card was rendered, not only that it was rendered somewhere in My Home.

Testing Instructions

  • Run this branch locally or via Calypso.live
  • Ensure you can view Tracks events in your browser
  • Navigate to My Home for sites in different states, especially sites with different intents or that are showing the launchpad in My Home for other reasons
  • Verify that you see a number of calypso_customer_home_card_impression Tracks events, where every event includes both a card and a location property.
  • Also verify that we're not triggering multiple events for any card and location pairs.

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?
  • [N/A] Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • [N/A] Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • [N/A] 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)?

@daledupreez daledupreez added [Feature] Tracks Metrics & Monitoring Capturing analytics about user behavior on WordPress.com. [Feature] My Home The main dashboard for managing a WordPress.com site. [Feature] Launchpad The onboarding Launchpad that guides users through setting up their site and getting it launched. labels May 23, 2024
@daledupreez daledupreez requested a review from a team May 23, 2024 13:16
@daledupreez daledupreez self-assigned this May 23, 2024
@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 May 23, 2024
@matticbot
Copy link
Contributor

matticbot commented May 23, 2024

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

Sections (~155 bytes added 📈 [gzipped])

name  parsed_size           gzip_size
home       +314 B  (+0.0%)     +155 B  (+0.0%)

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

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.

@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

  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug fix/my-home-tracking-for-empty-primary-card on your sandbox.

@daledupreez daledupreez marked this pull request as ready for review May 23, 2024 14:14
Copy link
Contributor

@sixhours sixhours left a comment

Choose a reason for hiding this comment

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

This is working as described! No more null card values.

@daledupreez daledupreez force-pushed the fix/my-home-tracking-for-empty-primary-card branch from b15990b to 8445e0c Compare May 30, 2024 18:21
@daledupreez daledupreez merged commit 458460c into trunk May 31, 2024
11 checks passed
@daledupreez daledupreez deleted the fix/my-home-tracking-for-empty-primary-card branch May 31, 2024 13:34
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Launchpad The onboarding Launchpad that guides users through setting up their site and getting it launched. [Feature] My Home The main dashboard for managing a WordPress.com site. [Feature] Tracks Metrics & Monitoring Capturing analytics about user behavior on WordPress.com.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants