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

Stats: Apply the newly introduced location views API to the Locations module #95031

Closed
wants to merge 6 commits into from

Conversation

dognose24
Copy link
Contributor

@dognose24 dognose24 commented Sep 30, 2024

Related to p1727106755052629-slack-C82FZ5T4G, panfyZ-41e-p2#comment-10163

Proposed Changes

  • Replace the legacy stats/country-views API endpoint with the newly introduced stats/location-views/country one, which would keep existing response data properties and eliminate unknown visit locations.

Why are these changes being made?

  • Some users reported unknown location sources, which do not correspond with our support guide. We have a newly introduced API endpoint compatible with legacy data tables, which ignores unknown locations.

Testing Instructions

  • Spin this change up with the Calypso Live branch.
  • Navigate to Stats > Traffic page.
  • Scroll to the Locations module.
  • Ensure the country map and list work well but do not have unknown sources.

Note: The data between the two endpoints would differ because they use different mechanisms to check the source location. Google translated the screenshots above, so some words might be incorrect.

Before After
截圖 2024-10-01 上午12 58 05 截圖 2024-10-01 上午1 02 13

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

@dognose24 dognose24 added the [Feature] Stats Everything related to our analytics product at /stats/ label Sep 30, 2024
@dognose24 dognose24 requested review from lovemeblender, sotirispl and a team September 30, 2024 17:07
@dognose24 dognose24 self-assigned this Sep 30, 2024
@matticbot matticbot added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Sep 30, 2024
@matticbot
Copy link
Contributor

matticbot commented Sep 30, 2024

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

Sections (~369 bytes added 📈 [gzipped])

name                               parsed_size           gzip_size
woocommerce-installation                +100 B  (+0.0%)      +33 B  (+0.0%)
woocommerce                             +100 B  (+0.0%)      +33 B  (+0.0%)
themes                                  +100 B  (+0.0%)      +30 B  (+0.0%)
theme                                   +100 B  (+0.0%)      +30 B  (+0.0%)
subscribers                             +100 B  (+0.0%)      +34 B  (+0.0%)
stats                                   +100 B  (+0.0%)      +34 B  (+0.0%)
staging-site                            +100 B  (+0.0%)      +34 B  (+0.0%)
sites-dashboard                         +100 B  (+0.0%)      +34 B  (+0.0%)
site-purchases                          +100 B  (+0.0%)      +29 B  (+0.0%)
site-performance                        +100 B  (+0.0%)      +34 B  (+0.0%)
site-monitoring                         +100 B  (+0.0%)      +34 B  (+0.0%)
site-logs                               +100 B  (+0.0%)      +34 B  (+0.0%)
settings-writing                        +100 B  (+0.0%)      +33 B  (+0.0%)
settings-security                       +100 B  (+0.0%)      +33 B  (+0.0%)
settings-reading                        +100 B  (+0.0%)      +33 B  (+0.0%)
settings-podcast                        +100 B  (+0.0%)      +33 B  (+0.0%)
settings-performance                    +100 B  (+0.0%)      +33 B  (+0.0%)
settings-newsletter                     +100 B  (+0.0%)      +33 B  (+0.0%)
settings-jetpack                        +100 B  (+0.0%)      +33 B  (+0.0%)
settings-discussion                     +100 B  (+0.0%)      +33 B  (+0.0%)
settings                                +100 B  (+0.0%)      +29 B  (+0.0%)
scan                                    +100 B  (+0.0%)      +33 B  (+0.0%)
purchases                               +100 B  (+0.0%)      +29 B  (+0.0%)
promote-post-i2                         +100 B  (+0.0%)      +33 B  (+0.0%)
preview                                 +100 B  (+0.0%)      +33 B  (+0.0%)
posts-custom                            +100 B  (+0.0%)      +33 B  (+0.0%)
posts                                   +100 B  (+0.0%)      +33 B  (+0.0%)
plugins                                 +100 B  (+0.0%)      +34 B  (+0.0%)
plans                                   +100 B  (+0.0%)      +40 B  (+0.0%)
people                                  +100 B  (+0.0%)      +33 B  (+0.0%)
pages                                   +100 B  (+0.0%)      +33 B  (+0.0%)
migrate                                 +100 B  (+0.0%)      +33 B  (+0.0%)
media                                   +100 B  (+0.0%)      +34 B  (+0.0%)
marketplace                             +100 B  (+0.0%)      +37 B  (+0.0%)
marketing                               +100 B  (+0.0%)      +33 B  (+0.0%)
jetpack-social                          +100 B  (+0.0%)      +33 B  (+0.0%)
jetpack-search                          +100 B  (+0.0%)      +33 B  (+0.0%)
jetpack-connect                         +100 B  (+0.0%)      +32 B  (+0.0%)
jetpack-cloud-settings                  +100 B  (+0.0%)      +33 B  (+0.0%)
jetpack-cloud-pricing                   +100 B  (+0.0%)      +33 B  (+0.0%)
jetpack-cloud-plugin-management         +100 B  (+0.0%)      +34 B  (+0.0%)
jetpack-cloud-overview                  +100 B  (+0.0%)      +30 B  (+0.0%)
jetpack-cloud-features-comparison       +100 B  (+0.0%)      +33 B  (+0.0%)
jetpack-cloud                           +100 B  (+0.0%)      +33 B  (+0.0%)
import                                  +100 B  (+0.0%)      +40 B  (+0.0%)
hosting-features                        +100 B  (+0.0%)      +34 B  (+0.0%)
hosting                                 +100 B  (+0.0%)      +34 B  (+0.0%)
home                                    +100 B  (+0.0%)      +30 B  (+0.0%)
gutenberg-editor                        +100 B  (+0.0%)      +33 B  (+0.0%)
google-my-business                      +100 B  (+0.0%)      +33 B  (+0.0%)
github-deployments                      +100 B  (+0.0%)      +34 B  (+0.0%)
export                                  +100 B  (+0.0%)      +33 B  (+0.0%)
email                                   +100 B  (+0.0%)      +33 B  (+0.0%)
earn                                    +100 B  (+0.0%)      +34 B  (+0.0%)
domains                                 +100 B  (+0.0%)      +29 B  (+0.0%)
customize                               +100 B  (+0.0%)      +33 B  (+0.0%)
concierge                               +100 B  (+0.0%)      +33 B  (+0.0%)
comments                                +100 B  (+0.0%)      +33 B  (+0.0%)
checkout                                +100 B  (+0.0%)      +30 B  (+0.0%)
backup                                  +100 B  (+0.0%)      +36 B  (+0.0%)
add-ons                                 +100 B  (+0.0%)      +33 B  (+0.0%)
activity                                +100 B  (+0.0%)      +33 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.

Copy link
Contributor

@kangzj kangzj left a comment

Choose a reason for hiding this comment

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

Works well for me, but we might need to fix the unit test before merging 😄

Thanks for fixing this @dognose24! And kudos to @Automattic/jetpack-data-team 👍

@matticbot
Copy link
Contributor

matticbot commented Oct 1, 2024

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • blaze-dashboard
  • command-palette-wp-admin
  • help-center
  • notifications
  • odyssey-stats
  • whats-new
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug update/stats_location_views_alter_endpoint on your sandbox.

Copy link
Contributor

@sotirispl sotirispl left a comment

Choose a reason for hiding this comment

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

LGTM

@dognose24
Copy link
Contributor Author

I will filter the unknown locations first and ensure this change works well on Jetpack.

@kangzj
Copy link
Contributor

kangzj commented Oct 7, 2024

Hi @dognose24 do you have any blockers for this one?

@kangzj
Copy link
Contributor

kangzj commented Oct 9, 2024

Closing per discussion pejTkB-1Ic-p2

@kangzj kangzj closed this Oct 9, 2024
@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 Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DO NOT MERGE [Feature] Stats Everything related to our analytics product at /stats/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants