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

Remove unused GA3 UA code

Open briowill opened this issue 1 year ago • 3 comments

Related to #https://github.com/Automattic/martech/issues/2318

Proposed Changes

Google Universal Analytics (GA3 UA) has been deprecated and we have updated to Google Analytics 4. This PR Removes unused GA3 UA code.

Testing Instructions

  1. Checkout branch TBD

briowill avatar May 09 '24 06:05 briowill

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
  • editing-toolkit
  • odyssey-stats
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug update/remove-unused-ga3-universal-analytics-code on your sandbox.

matticbot avatar May 09 '24 06:05 matticbot

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

App Entrypoints (~356 bytes removed 📉 [gzipped])

name                 parsed_size           gzip_size
entry-subscriptions       -841 B  (-0.1%)     -178 B  (-0.0%)
entry-stepper             -828 B  (-0.0%)     -179 B  (-0.0%)
entry-main                -828 B  (-0.0%)     -179 B  (-0.0%)
entry-login               -828 B  (-0.1%)     -179 B  (-0.0%)

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

Sections (~89 bytes removed 📉 [gzipped])

name      parsed_size           gzip_size
checkout       -936 B  (-0.1%)      -89 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.

Async-loaded Components (~89 bytes removed 📉 [gzipped])

name                                                                              parsed_size           gzip_size
async-load-signup-steps-page-picker                                                    -936 B  (-0.3%)      -89 B  (-0.1%)
async-load-purchase-modal-wrapper                                                      -936 B  (-0.3%)      -89 B  (-0.1%)
async-load-my-sites-checkout-purchase-modal-is-eligible-for-one-click-checkou...       -936 B  (-0.3%)      -89 B  (-0.1%)
async-load-calypso-my-sites-checkout-modal                                             -936 B  (-0.1%)      -89 B  (-0.0%)
async-load-calypso-blocks-editor-checkout-modal                                        -936 B  (-0.1%)      -89 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 May 09 '24 06:05 matticbot

These are some notes I've taken when looking through the code:

  • We should also get rid of GA Enhanced Ecommerce
  • We can remove unit tests under test/google-analytics
  • We could make the cleanup "cleaner" by removing ad-tracking/google-analytics and refactoring code to refer to ad-tracking/google-analytics-4

I looked through the code and will be handling the "cleaner" cleanup in a different PR. It involves more changes that I initially anticipated.

briowill avatar Jun 05 '24 08:06 briowill

I think it might be good to remove Unit tests in this PR. Other than this code looks ok and doesn't impact Jetpack/Akismet.

robertsreberski avatar Jun 05 '24 08:06 robertsreberski

These are some notes I've taken when looking through the code:

  • We should also get rid of GA Enhanced Ecommerce
  • We can remove unit tests under test/google-analytics
  • We could make the cleanup "cleaner" by removing ad-tracking/google-analytics and refactoring code to refer to ad-tracking/google-analytics-4

The PR looks good from the point of Jetpack/Akismet!

New Issue tracking changes https://github.com/orgs/Automattic/projects/388/views/1?pane=issue&itemId=66622673

briowill avatar Jun 08 '24 00:06 briowill

Follow up PR https://github.com/Automattic/wp-calypso/pull/91857

briowill avatar Jun 17 '24 23:06 briowill