wp-calypso icon indicating copy to clipboard operation
wp-calypso copied to clipboard

Stats: Introduce the top-level UTM metrics state to StatsModuleUTM

Open dognose24 opened this issue 1 year ago • 2 comments

Related to #87567

Proposed Changes

  • Introduce the UTM metrics state.
  • Apply the UTM metrics query to StatsModuleUTM.

Testing Instructions

  • Browse a blog post with UTM params: {site-slug}/{post-slug}?utm_source=google&utm_medium=cpc.
  • Spin this change with the Calypso Live branch.
  • Navigate to the Stats > Traffic page with the feature flag: /stats/day/{site-slug}?flags=stats/utm-module.
  • Scroll down to the UTM module section and ensure the top-level metrics work well.
截圖 2024-02-23 上午7 43 42

Pre-merge Checklist

  • [ ] Has the general commit checklist been followed? (PCYsg-hS-p2)
  • [ ] https://wpcalypso.wordpress.com/devdocs/docs/testing/index.md 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 avatar Feb 22 '24 23:02 dognose24

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

App Entrypoints (~76 bytes added 📈 [gzipped])

name                 parsed_size           gzip_size
entry-subscriptions        +84 B  (+0.0%)      +39 B  (+0.0%)
entry-stepper              +84 B  (+0.0%)      +41 B  (+0.0%)
entry-main                 +84 B  (+0.0%)      +41 B  (+0.0%)
entry-login                +84 B  (+0.0%)      +41 B  (+0.0%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~220 bytes added 📈 [gzipped])

name                               parsed_size           gzip_size
stats                                   +629 B  (+0.1%)     +220 B  (+0.1%)
woocommerce-installation                +588 B  (+0.2%)     +161 B  (+0.1%)
woocommerce                             +588 B  (+0.2%)     +161 B  (+0.2%)
themes                                  +588 B  (+0.1%)     +161 B  (+0.0%)
theme                                   +588 B  (+0.1%)     +161 B  (+0.1%)
subscribers                             +588 B  (+0.1%)     +161 B  (+0.1%)
sites-dashboard                         +588 B  (+0.1%)     +161 B  (+0.1%)
site-purchases                          +588 B  (+0.0%)     +161 B  (+0.0%)
site-monitoring                         +588 B  (+0.1%)     +161 B  (+0.1%)
settings-writing                        +588 B  (+0.1%)     +161 B  (+0.1%)
settings-security                       +588 B  (+0.1%)     +161 B  (+0.1%)
settings-reading                        +588 B  (+0.1%)     +161 B  (+0.1%)
settings-podcast                        +588 B  (+0.1%)     +161 B  (+0.1%)
settings-performance                    +588 B  (+0.1%)     +161 B  (+0.1%)
settings-newsletter                     +588 B  (+0.1%)     +161 B  (+0.1%)
settings-jetpack                        +588 B  (+0.1%)     +161 B  (+0.1%)
settings-discussion                     +588 B  (+0.1%)     +161 B  (+0.1%)
settings                                +588 B  (+0.1%)     +161 B  (+0.1%)
scan                                    +588 B  (+0.1%)     +161 B  (+0.1%)
purchases                               +588 B  (+0.0%)     +161 B  (+0.0%)
promote-post-i2                         +588 B  (+0.1%)     +161 B  (+0.1%)
preview                                 +588 B  (+0.2%)     +161 B  (+0.2%)
posts-custom                            +588 B  (+0.1%)     +161 B  (+0.1%)
posts                                   +588 B  (+0.1%)     +161 B  (+0.1%)
plugins                                 +588 B  (+0.0%)     +161 B  (+0.0%)
plans                                   +588 B  (+0.0%)     +161 B  (+0.0%)
people                                  +588 B  (+0.1%)     +161 B  (+0.1%)
pages                                   +588 B  (+0.1%)     +161 B  (+0.1%)
migrate                                 +588 B  (+0.2%)     +161 B  (+0.1%)
media                                   +588 B  (+0.0%)     +161 B  (+0.0%)
marketplace                             +588 B  (+0.1%)     +161 B  (+0.1%)
marketing                               +588 B  (+0.1%)     +161 B  (+0.1%)
jetpack-social                          +588 B  (+0.1%)     +161 B  (+0.1%)
jetpack-search                          +588 B  (+0.1%)     +161 B  (+0.1%)
jetpack-connect                         +588 B  (+0.0%)     +161 B  (+0.0%)
jetpack-cloud-settings                  +588 B  (+0.1%)     +161 B  (+0.1%)
jetpack-cloud-pricing                   +588 B  (+0.1%)     +161 B  (+0.1%)
jetpack-cloud-plugin-management         +588 B  (+0.0%)     +161 B  (+0.0%)
jetpack-cloud-overview                  +588 B  (+0.1%)     +161 B  (+0.1%)
jetpack-cloud-features-comparison       +588 B  (+0.1%)     +161 B  (+0.1%)
jetpack-cloud                           +588 B  (+0.1%)     +161 B  (+0.1%)
import-hosted-site-flow                 +588 B  (+0.1%)     +161 B  (+0.1%)
import-flow                             +588 B  (+0.0%)     +161 B  (+0.0%)
import                                  +588 B  (+0.1%)     +161 B  (+0.1%)
hosting                                 +588 B  (+0.1%)     +161 B  (+0.1%)
home                                    +588 B  (+0.0%)     +161 B  (+0.0%)
gutenberg-editor                        +588 B  (+0.1%)     +161 B  (+0.1%)
google-my-business                      +588 B  (+0.1%)     +161 B  (+0.1%)
github-deployments                      +588 B  (+0.1%)     +161 B  (+0.1%)
export                                  +588 B  (+0.2%)     +161 B  (+0.1%)
email                                   +588 B  (+0.1%)     +161 B  (+0.1%)
earn                                    +588 B  (+0.1%)     +161 B  (+0.1%)
domains                                 +588 B  (+0.0%)     +161 B  (+0.0%)
customize                               +588 B  (+0.2%)     +161 B  (+0.1%)
concierge                               +588 B  (+0.1%)     +161 B  (+0.1%)
comments                                +588 B  (+0.1%)     +161 B  (+0.1%)
checkout                                +588 B  (+0.0%)     +161 B  (+0.0%)
backup                                  +588 B  (+0.1%)     +161 B  (+0.1%)
add-ons                                 +588 B  (+0.2%)     +161 B  (+0.1%)
activity                                +588 B  (+0.1%)     +161 B  (+0.1%)

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

Async-loaded Components (~161 bytes added 📈 [gzipped])

name               parsed_size           gzip_size
async-load-design       +588 B  (+0.0%)     +161 B  (+0.0%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

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 avatar Feb 22 '24 23:02 matticbot

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

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

  • editing-toolkit
  • odyssey-stats
  • wpcom-block-editor

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

matticbot avatar Feb 25 '24 23:02 matticbot