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

Analytics: Fix circular references in ad tracking debug #98326

Merged
merged 1 commit into from
Jan 14, 2025

Conversation

tyxla
Copy link
Member

@tyxla tyxla commented Jan 14, 2025

Proposed Changes

Fixes circular references in JSON.stringify() when calling debug in analytics ad tracking.

Why are these changes being made?

To fix errors like this: https://a8c.sentry.io/issues/3230674634/?project=6313676&referrer=project-issue-stream

Testing Instructions

  • Enable verbose messages in your dev console
  • Set localStorage.setItem('debug', 'calypso:analytics:ad-tracking')
  • Verify http://calypso.localhost:3000/read/subscriptions/comments still logs something. Will likely be undefined if testing locally.

@tyxla tyxla added [Type] Enhancement [Feature] Tracks Metrics & Monitoring Capturing analytics about user behavior on WordPress.com. labels Jan 14, 2025
@tyxla tyxla self-assigned this Jan 14, 2025
@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

  • blaze-dashboard
  • notifications
  • odyssey-stats
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug fix/analytics-retarget-debug-json-circular on your sandbox.

@matticbot
Copy link
Contributor

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

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

name                 parsed_size           gzip_size
entry-subscriptions       +293 B  (+0.0%)     +106 B  (+0.0%)
entry-stepper             +293 B  (+0.0%)     +106 B  (+0.0%)
entry-main                +293 B  (+0.0%)     +106 B  (+0.0%)
entry-login               +293 B  (+0.0%)     +106 B  (+0.0%)

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

Sections (~12 bytes added 📈 [gzipped])

name                           parsed_size           gzip_size
checkout                             +72 B  (+0.0%)       +0 B
write-flow                           +20 B  (+0.0%)       +1 B  (+0.0%)
update-design-flow                   +20 B  (+0.0%)       +1 B  (+0.0%)
transferring-hosted-site-flow        +20 B  (+0.0%)       -1 B  (-0.0%)
stepper-user-step                    +20 B  (+0.0%)       -6 B  (-0.0%)
signup                               +20 B  (+0.0%)       -6 B  (-0.0%)
plugin-bundle-flow                   +20 B  (+0.0%)       +3 B  (+0.0%)
onboarding-flow                      +20 B  (+0.1%)       +4 B  (+0.1%)
link-in-bio-tld-flow                 +20 B  (+0.0%)       -3 B  (-0.0%)
jetpack-connect                      +20 B  (+0.0%)       +6 B  (+0.0%)
import-hosted-site-flow              +20 B  (+0.0%)      +10 B  (+0.0%)
copy-site-flow                       +20 B  (+0.0%)       -2 B  (-0.0%)
build-flow                           +20 B  (+0.0%)       -1 B  (-0.0%)
accept-invite                        +20 B  (+0.0%)       -6 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 (~9 bytes added 📈 [gzipped])

name                                                                              parsed_size           gzip_size
async-load-calypso-my-sites-checkout-modal                                              +72 B  (+0.0%)       +0 B
async-load-calypso-blocks-editor-checkout-modal                                         +72 B  (+0.0%)       +0 B
async-load-signup-steps-page-picker                                                     +35 B  (+0.0%)       -3 B  (-0.0%)
async-load-purchase-modal-wrapper                                                       +35 B  (+0.0%)       -3 B  (-0.0%)
async-load-my-sites-checkout-purchase-modal-is-eligible-for-one-click-checkou...        +35 B  (+0.0%)       -3 B  (-0.0%)
async-load-calypso-lib-analytics-signup                                                 +20 B  (+0.2%)       +9 B  (+0.2%)

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.

@tyxla tyxla merged commit 63ab526 into trunk Jan 14, 2025
13 checks passed
@tyxla tyxla deleted the fix/analytics-retarget-debug-json-circular branch January 14, 2025 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Tracks Metrics & Monitoring Capturing analytics about user behavior on WordPress.com. [Type] Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants