Skip to main content

How markets are detected

How Shopify determines a visitor’s market

Shopify assigns each visitor to a market experience using signals like IP address (approximate location), browser and device information, and the merchant’s Shopify Markets configuration and rules.

Based on these signals, Shopify selects the most relevant market (for example US, UK, EU) and serves the matching storefront experience such as currency, language, pricing, and domain.

Why we don’t rely on Shopify webhooks for market detection

Shopify webhooks are not market-aware. For example, the order webhook doesn’t include which market the order belongs to. The same limitation applies to other webhook events (checkout, customer, etc.).

Because webhooks don’t tell us the market, we determine market context from the storefront session, where Shopify has already selected the market for the visitor. This is why market detection depends on our tracking script, not backend events.

How Littledata detects the market

  1. On the storefront, Shopify exposes the currently selected market in its storefront context.

  2. Littledata tracker reads that value directly from the storefront.

  3. Littledata tracker sets the market in the Littledata data layer, for example:

LittledataLayer.market = { id: 886112389, handle: "us" }

This represents the market Shopify has assigned to the visitor’s current session.

How market data flows through our system

After we detect the market, we add it to the visitor’s journey together with key identifiers (such as the cart token) and standard attribution data. We then include the market in the event payload that gets sent to our servers. In addition, we persist the market on the Shopify order as a note_attribute under ld_attr.

This setup allows us to connect the full customer journey to a specific market and to attribute downstream events (such as checkout and purchase) to the correct market.

How we use market data internally

When we process events, we first determine which Shopify Markets are currently active, in draft, or disabled based on our Shopify sync. We then apply the customer’s Littledata configuration, including any per-market settings and destination-specific rules for tools like GA4 and Meta. Using those rules, we decide whether the event should be sent at all and, if it is sent, which destinations should receive it.

This allows customers to run different tracking behavior per market while keeping a single Shopify store.