1. Shopify authorizes the app
The merchant installs Country Shield through Shopify. OAuth grants the approved Admin API scopes, and Country Shield stores the rotating offline access and refresh tokens encrypted at rest.
2. The merchant saves a policy
The embedded app collects rule mode, countries, paid location or network rules, storefront scope, and action. The server sanitizes the ruleset and removes anything the current plan does not allow before saving it.
- Choose denylist or allowlist mode.
- Add countries and, when entitled, regions or network rules.
- Select block, redirect, or challenge.
- Choose whole store or checkout-only scope.
- Save and run a decision preview.
3. Shopify loads the theme app extension
The merchant enables Country Shield under App embeds in the Shopify theme editor. The extension loads a small storefront script from Shopify's CDN and calls the Country Shield decision endpoint with the permanent shop domain and requested path.
4. Country Shield evaluates the request
The backend resolves the client IP from the trusted proxy path, looks up available geographic and network signals, checks verified crawler status, loads the merchant policy, and evaluates it in a predictable order.
- Verified search bots are allowed first when bot protection is enabled.
- Checkout-only scope allows non-checkout paths.
- Allowlist or denylist country and region logic runs.
- Plan-entitled ASN, IP, or anonymous traffic rules run when data is available.
- The configured action and public response are returned.
5. The storefront enforces the result
An allow result releases the page. A redirect navigates to the merchant URL. Block and challenge results display a full-screen interstitial so the visitor cannot continue interacting with the storefront behind it.
Soft mode
Allowed visitors see the page normally while Country Shield acts only on a deny result.
Strict mode
The page remains hidden until an allow result or a short fail-open timeout. This gives stronger visual enforcement with a small perceived-loading tradeoff.
6. Merchants and operators see the outcome
Merchant analytics use aggregate counts and never expose individual visitor profiles. The protected operations console shows installed stores, setup status, database availability, billing configuration, token health, and open Shopify API errors.
Premium stores may also sync supported rules to Cloudflare. Edge sync errors are recorded without preventing the merchant from saving the core Country Shield policy.