Repository navigation
WooCommerce Stats: Stop store tracking wherever the WooCommerce tab is unavailable - #55483
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: The Jetpack plugin has different release cadences depending on the platform:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Premium Analytics plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
fed3a35 to
3c47a83
Compare
…ed' into change/wooa7s-2538-disable-woo-tracking-self-hosted # Conflicts: # projects/packages/woocommerce-stats/README.md # projects/packages/woocommerce-stats/src/class-woocommerce-analytics-tracker.php
There was a problem hiding this comment.
Looks good! I spun up a couple of JN stores to check. Tracking is on with trunk and off with this branch, so it does what it says.
Also checked the requests in the browser. No w.gif and no session events on this branch, and cart_view still goes out on t.gif.
Fixes WOOA7S-2538
Proposed changes
Stop Stats v2 from tracking shoppers on stores where the WooCommerce tab is hidden, so we never collect store data the owner cannot see. By default that is every store not hosted on WordPress.com, where wpcomsh turns the tab on (#55498).
jetpack-woocommerce-statsfeature flag. The store tracking filter can no longer turn it on while the flag is off.WordPress.com stores are unchanged.
Related product discussion/links
Does this pull request change what data or activity we track or use?
Yes, it tracks less. On self-hosted stores Stats v2 no longer sends ClickHouse or session events. The Jetpack WooCommerce Analytics module still sends the events it sent before Stats v2. No new data is collected.
Testing instructions
Setup: a self-hosted, Jetpack-connected site with WooCommerce active, the WooCommerce Analytics module on, and Stats v2 turned on. Build Jetpack from this branch.
Jetpack store
window.wcAnalytics.features.chandsessionTrackingarefalse(both aretrueon trunk), andwindow._wcais still set.Without the Jetpack plugin
window._wcaand nowcAnalyticsscript (both are there on trunk).Filters, on the same site
add_filter( 'jetpack_woocommerce_stats_store_tracking_enabled', '__return_true', 99 );and reload. Confirm there is still nowindow._wca. Remove the MU-plugin.add_filter( 'jetpack_feature_flag_enabled_jetpack-woocommerce-stats', '__return_true' );and reload. Confirmwindow._wcais back andfeatures.chistrue. Remove the MU-plugin.WordPress.com Atomic
features.chistrue, as on trunk.