Use Case

Geo-targeting

Show different content, pricing, or calls-to-action to visitors from different countries — entirely client-side, no server required.

The challenge

Showing different content to visitors from different countries typically requires server-side rendering or a CDN with edge logic — both of which add architectural complexity. Static sites, SPAs, and CDN-hosted frontends have no straightforward way to personalise content by country out of the box. The result is a single generic experience for every visitor, regardless of their location.

What you can achieve

  • Country-specific pricing banners, CTAs, or promotional offers
  • Language or regional variant serving based on detected country
  • Conditional redirects to localised versions of your site
  • Country-based tag and pixel firing via GTM without writing code

How it works

VisitorAPI returns the visitor’s countryCode — an ISO 3166-1 alpha-2 code like "GB" or "AU" — from a client-side API call in ~25ms. Your frontend reads the code and conditionally renders the appropriate content. Because the call happens in the browser, it works on any static site, SPA, or CDN-hosted page with no backend changes.

  1. Call the API on page load with your project ID
  2. Read data.countryCode — a two-letter country code, e.g. "GB" or "AU"
  3. Render conditionally — swap banners, prices, CTAs, or redirect to a regional URL

Personalize user experience based on location and device

Start using VisitorAPI today and enhance your website with intelligent visitor detection.