Block countries
The country block list rejects events when the visitor's geolocated country matches a listed code. Useful when a bot wave originates from a specific country, when your audience is local and foreign traffic is almost certainly junk, or when compliance requires you to refuse data from certain regions. Add rules from /<domain>/settings/tracking-rules.
When to use it
- Local-only sites. A regional bakery, a German doctor's practice, a UK MOT garage. Foreign visitors are almost entirely bots, scrapers, or aggregators. Blocking everything except a small set of relevant countries cleans the analytics significantly.
- Scraper farms. If you keep seeing residential-proxy waves from one country and bot detection isn't catching them fast enough, blocking the country is the bluntest possible defense.
- Anonymous proxies. The special code
A1matches traffic that MaxMind classifies as an anonymizing network (commercial VPNs, Tor exits, anonymous proxies). Most legitimate visitors don't use these; most scrapers do.
Adding a country rule
Open Settings → Tracking rules, find the Countries card, and click Add. The modal opens a searchable dropdown of all 249 ISO-3166-1 alpha-2 codes plus the special A1 entry. Type to filter by country name or code. Each row shows the flag, name, and code.
Click a country to select it. The Description field is optional. Save the rule and it takes effect within seconds.
Where the country comes from
Clickport uses MaxMind GeoLite2-City, refreshed weekly. When a tracker event arrives, the server resolves the visitor's IP against the database and pulls the alpha-2 country code. The country block check runs against that resolved code.
Geolocation is fast (microseconds per lookup) but not free, so the country check runs after the cheaper hostname, page, and IP checks. If any of those three drops the event first, geolocation never happens. The check order is intentional: hostname > page > IP > country.
Country codes reference
Codes are two uppercase letters. Common ones:
DEGermany,ATAustria,CHSwitzerlandUSUnited States,CACanada,MXMexicoGBUnited Kingdom,IEIrelandFRFrance,ESSpain,ITItaly,NLNetherlandsRURussia,CNChina,INIndiaBRBrazil,ARArgentinaJPJapan,KRSouth Korea,VNVietnamA1Anonymous proxies and VPNs (Clickport-specific, mapped from MaxMind anonymizer flags)
The full ISO-3166-1 alpha-2 list (249 countries) is searchable in the picker.
How matching works
Country lookup is a single Set lookup against the resolved code. There is no fuzzy matching, no inheritance (blocking GB does not block JE Jersey or GG Guernsey even though they're British territories), and no wildcards. One rule, one country.
If geolocation fails (private IP, unmapped range, or MaxMind doesn't know the IP), the country code comes back empty. Empty codes are never matched by a rule, so failed geolocation lets events through. This is intentional: false negatives are better than false positives here.
Limits
- 250 rules per site. The cap is generous because the picker covers 250 entries; the limit exists to prevent runaway lists, not to constrain real use.
- One country per rule. No ranges, no continents. Add each country separately.
Troubleshooting
I blocked Russia but Russian traffic still appears
Check whether the events are tagged with country RU in the dashboard. If they say RU, the rule should be catching them. If the dashboard country is empty or A1, MaxMind classifies the IP as anonymous (probably a VPN exit) rather than Russian. Add A1 as a separate rule to cover that case.
Legitimate visitors are complaining their traffic isn't counted
Country blocking is blunt by design. If real users in a blocked country are unhappy, the only fix is removing the rule. Consider whether a tighter bot detection signal (specific UA pattern, IP range, page path) would solve the same problem without affecting real users.
I want to allow only specific countries, not block
There is no country allow-list in v1. If you want to whitelist a small set of countries, you'd need to add every other country as a block rule. That's awkward but the cap (250) is enough to do it. We'll add an allow-list mode if customers ask.
The A1 code is showing up a lot
A1 is "anonymous proxies and VPNs" per MaxMind. It usually correlates with bot traffic but not always. Some legitimate users use VPNs for privacy. Decide whether the cost of losing those visitors is worth the noise reduction.