Important notes about the country key:

  1. The country key is a server key, and is subject to all of the pros and cons noted here: Server Keys
  2. Because the country key is a server key, it is only evaluated when the customer reaches the locked page, whether that's a page, collection, or individual product. Whatever you've locked will default to locked, and access won't be permitted unless the customer reaches it directly. (See below for ways to handle this.)

Protecting your entire shop: 

Create a shop lock using the link below the search bar in Locksmith and create the key "permit if the customer is visiting from a certain country". Then choose the country that should see your shop. Only that country will be allowed access. Add additional countries by clicking the "and" next to the key and creating additional country conditions.

If you want stop a specific country from seeing the locked resource, add the country key, choosing the blocked country, and then click on the "if" in the key. That "if" will turn into "unless" and restrict visitors from that country.  

For example:

Restricting products and collections by country:


When locking collections and individual products, keep in mind that they will not show up for anyone if they are completely hidden. 

The customer must reach the actual product or collection page in order for Locksmith to evaluate what country they're visiting from.

The key to getting this working is by using one of two option (or both!). 


Option 1: Create a navigation link to the resource, and don't hide the navigation link. 

Once you have a navigation item pointing to the locked resource, the customer can click there to find what they're looking for. Anyone can click on it, but only customers from a permitted country will be able to see the page. 

When using this method, make sure Locksmith is not hiding navigation items for that lock. That means this setting must remain disabled:

Option 2: Leave the products in the collection or the individual products, visible in collection lists around your shop. 

To use this method, you'll head into the lock and make sure this lock setting remains disabled:


When you do this, those products will still be visible around your shop in collection lists (like collections/all) and search results, but when a customer tries to reach the collection page they'll be permitted or denied access based on their country. :)

Did this answer your question?