Commit 245a10e8018 for woocommerce
commit 245a10e80184cc4e0816c0a77d74827c9d1e110b
Author: Taha Paksu <3295+tpaksu@users.noreply.github.com>
Date: Fri Apr 17 10:44:14 2026 +0300
Fix core profiler shipping_partner_impression tracking wrong country (#64133)
* Fix core profiler shipping_partner_impression tracking reporting wrong country
The shipping_partner_impression event in the core profiler derives the
country from context.businessInfo.location, which defaults to 'US:CA'.
This value is only populated from the DB when the user goes through the
businessInfo step. When the plugins step is reached via page refresh,
direct URL navigation, or browser back/forward, the default sticks,
inflating US tracking numbers and misattributing non-US shipping partner
impressions (e.g., Packlink shown to DE merchants tracked as US).
Fetch the store country from woocommerce_default_country in the
prePlugins state, using the existing getStoreCountryOption actor and
handleStoreCountryOption action, so the context always reflects the
actual DB country before the tracking event fires.
* Add changefile(s) from automation for the following project(s): woocommerce, woocommerce/client/admin
---------
Co-authored-by: woocommercebot <woocommercebot@users.noreply.github.com>
Co-authored-by: Ayush Pahwa <ayush.pahwa@automattic.com>
diff --git a/plugins/woocommerce/changelog/64133-fix-wooplug-6541-core-profiler-tracking-country b/plugins/woocommerce/changelog/64133-fix-wooplug-6541-core-profiler-tracking-country
new file mode 100644
index 00000000000..70398186235
--- /dev/null
+++ b/plugins/woocommerce/changelog/64133-fix-wooplug-6541-core-profiler-tracking-country
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Fix core profiler shipping_partner_impression tracking event reporting wrong country when plugins step is reached via direct navigation or page refresh.
\ No newline at end of file
diff --git a/plugins/woocommerce/client/admin/client/core-profiler/index.tsx b/plugins/woocommerce/client/admin/client/core-profiler/index.tsx
index 4dcae692b42..11d5fa2e58e 100644
--- a/plugins/woocommerce/client/admin/client/core-profiler/index.tsx
+++ b/plugins/woocommerce/client/admin/client/core-profiler/index.tsx
@@ -1444,6 +1444,12 @@ export const coreProfilerStateMachineDefinition = createMachine( {
actions: [ 'assignCurrentUser' ],
},
},
+ {
+ src: 'getStoreCountryOption',
+ onDone: {
+ actions: [ 'handleStoreCountryOption' ],
+ },
+ },
],
meta: {
progress: 70,