Hi everyone,
We have an app that sorts products within collections using merchant-defined strategies. We want to support different sorting strategies for different markets.
For example, the same collection could use one strategy for Market A and another for Market B. Strategies can use revenue, price, or inventory. For revenue-based sorting, we want to rank products using sales relevant to the market being targeted, rather than store-wide sales.
My main question is how to determine the market attribution of an order when markets overlap.
The Markets inheritance documentation gives this example:
Market A includes Canada and the US.
Market B includes Canada and Mexico.
No parentage is inferred between them.
A Canadian buyer matches both markets. I was considering mapping an order’s country code to a market, but that doesn’t uniquely identify a market in this example.
I understand that multiple matching markets can contribute settings to one shopping experience. What I need to establish is whether Shopify exposes a market attribution on historical orders that apps can use for this purpose.
Is there a supported API field or reporting resource for this attribution? If Shopify does not assign one exclusive market to each order, what is the recommended approach for calculating market-specific product revenue without double-counting sales?
As a related question, if these overlapping markets have different storefront URLs, how is the customer’s URL selected? Does that selection have any relationship to sales attribution?
I’ve reviewed the alphabetical domain-selection rule for submarkets with multiple parent markets, but I’m looking for guidance specifically about overlapping peer markets.
Relevant example:
shopify.dev/docs/apps/build/markets/market-inheritance
Any documentation or guidance on the supported data model would be appreciated. Thank you!