Commit 7a1c97473af for woocommerce
commit 7a1c97473aff5ea009be5e3c63297d6845f58643
Author: Chi-Hsuan Huang <chihsuan.tw@gmail.com>
Date: Tue Oct 6 15:53:17 2026 +0800
Fix analytics tracking breaking on a stale cached script after an update (#69423)
* Fix analytics tracking breaking on a stale cached script after an update
* Update packages/php/woocommerce-analytics/changelog/fix-analytics-chunk-cache-busting
Co-authored-by: louwie17 <lourensschep@gmail.com>
---------
Co-authored-by: louwie17 <lourensschep@gmail.com>
diff --git a/packages/php/woocommerce-analytics/changelog/fix-analytics-chunk-cache-busting b/packages/php/woocommerce-analytics/changelog/fix-analytics-chunk-cache-busting
new file mode 100644
index 00000000000..80348173e8c
--- /dev/null
+++ b/packages/php/woocommerce-analytics/changelog/fix-analytics-chunk-cache-busting
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fixed
+
+Add a content hash to lazy-loaded script URLs so a cached copy from an older release no longer breaks analytics after an update.
diff --git a/packages/php/woocommerce-analytics/webpack.config.js b/packages/php/woocommerce-analytics/webpack.config.js
index 8621b870cb0..5c36b913164 100644
--- a/packages/php/woocommerce-analytics/webpack.config.js
+++ b/packages/php/woocommerce-analytics/webpack.config.js
@@ -13,6 +13,7 @@ module.exports = [
output: {
path: path.resolve( './build' ),
filename: '[name].js',
+ chunkFilename: '[name].js?ver=[contenthash]',
},
resolve: {
extensions: [ '.ts', '.tsx', '.js', '.jsx', '.json' ],