Location
Match visitors based on their detected country, using a public IP-geolocation lookup.
Location matches a visitor based on their detected country. It's useful for restricting content by geography — for example, only showing a promotion to visitors in a specific country, or blocking a product page in a country you don't ship to.
How country is detected — and its limits. The app detects a visitor's country using a public IP-geolocation lookup on their current IP address — it does not look at the customer's saved shipping or billing address, and it doesn't require the visitor to be signed in. This means the detected country reflects where the visitor's internet connection currently appears to be, which is usually accurate but isn't guaranteed: a visitor using a VPN or proxy can appear to be browsing from a different country than they're physically in, which will change what this rule sees. Keep that in mind if you notice the rule behaving unexpectedly for a specific visitor.
Like most access rules (aside from the action-based ones such as Passcode, Secret link, Subscribe, and Confirmation prompt), Location can be set to match If the visitor's detected country is one of your selected countries, or Unless it is — inverting it to match every other country instead. See Combining rules.
Add the rule
Open Locks and create a new lock, or open an existing one to edit it.
Choose the content you want to protect. See Access rules overview for how rules fit into a lock.
Click the Unlock rules tab, then in the Condition type dropdown, select Location.

Search for and select one or more countries to match against.

Choose If or Unless.
Click Save.
Shopper-facing copy
When a Location rule denies a visitor and the lock shows a message rather than redirecting, the default text is:
"This content is not available in your country."
This is editable per lock and per storefront language. See Translate lock messages.
Example: Make a product available only in the United States and Canada
Suppose a product can only be offered to visitors whose detected country is the United States or Canada.
Select the product you want to protect.

Add Location, choose If, then pick United States and Canada from the Countries field. Each choice becomes a removable chip.

Leave the rule's Redirect URL empty.
Set the Location denied message to:
This product is only available to visitors in the United States and Canada.

Click Save.
Result on the storefront
A visitor detected in either selected country can view the product normally. A visitor detected anywhere else sees the locked content and the message above. The result is based on IP geolocation, not the customer's shipping address.

Related docs
Last updated
Was this helpful?