Geo-Location Targeting
Introduction
Geo-location targeting allows you to display the cookie consent banner only to visitors from specific countries or regions. This is particularly useful when GDPR compliance is primarily required for EU visitors, while visitors from other regions may not need to see the banner.
This advanced feature helps optimize user experience by showing the cookie notice only where legally required, while reducing banner fatigue for visitors from regions without strict cookie consent laws.
Why Use Geo-Location Targeting?
Legal Requirements Vary by Region
- EU Countries: Strict GDPR requirements mandate cookie consent
- UK: UK GDPR and PECR require consent
- California: CCPA has specific requirements
- Other US States: Varying privacy laws (Virginia, Colorado, etc.)
- Brazil: LGPD privacy requirements
- Canada: PIPEDA and provincial laws
Benefits of Geo-Targeting
- Improved UX: Don’t show banner to regions where not required
- Focused Compliance: Meet requirements where legally necessary
- Reduced Banner Fatigue: Fewer visitors see the notice
- Optimized Performance: Less banner loading for non-targeted regions
- Flexible Compliance: Different approaches for different markets
Even if showing banner only to EU visitors, you should still handle data privacy responsibly for all visitors and maintain compliance with applicable local laws.
How Geo-Location Detection Works
Detection Methods
The plugin can determine visitor location through:
1. IP Address Geolocation
- Method: Looks up visitor’s IP address in geolocation database
- Accuracy: Country level ~99%, City level ~75-90%
- Privacy: IP address processed server-side, not stored
- Performance: Fast lookup, minimal overhead
2. Third-Party Services
- MaxMind GeoIP2 database (most popular)
- IP2Location databases
- CloudFlare geolocation (if using CloudFlare)
- Server-level geolocation modules
3. Browser/JavaScript Detection
- Geolocation API (requires user permission)
- Less reliable for cookie consent purposes
- Not recommended as primary method
IP-based geolocation is accurate for country detection but not perfect. VPNs, proxies, and mobile networks can affect accuracy. Consider showing banner by default if detection fails.
Configuring Geo-Location Targeting
Access Geo-Location Settings
- Go to Settings → PureDevs GDPR compliance
- Click the Geo Location tab
- Configure your targeting preferences
- Click Save Changes
Configuration Options
Enable Geo-Targeting
- Enabled: Banner shown only to selected countries
- Disabled: Banner shown to all visitors (default)
Targeting Mode
Include Mode (Show Only To):
- Banner appears ONLY for selected countries
- All other countries don’t see banner
- Best for EU-only compliance
Exclude Mode (Hide From):
- Banner appears for ALL countries EXCEPT selected ones
- Selected countries don’t see banner
- Less common use case
Country Selection
- Multi-select dropdown with all countries
- Search functionality for quick finding
- Select multiple countries
- Common presets available (EU countries, EEA, etc.)
Fallback Behavior
What happens if location cannot be determined:
- Show Banner: Display banner by default (recommended)
- Hide Banner: Don’t show if location unknown
- Use Cookie: Remember last known location
Common Geo-Targeting Configurations
1. EU/EEA Countries Only
Use Case: Your main audience is outside EU but you have some EU visitors
Configuration:
- Mode: Include Mode
- Countries: All 27 EU member states + EEA (Iceland, Liechtenstein, Norway)
- Fallback: Show banner (safer for compliance)
EU Countries to Select:
Austria, Belgium, Bulgaria, Croatia, Cyprus, Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece, Hungary, Ireland, Italy, Latvia, Lithuania, Luxembourg, Malta, Netherlands, Poland, Portugal, Romania, Slovakia, Slovenia, Spain, Sweden
2. EU + UK + California
Use Case: Comply with major privacy regulations
Configuration:
- Mode: Include Mode
- Countries: EU countries + United Kingdom + United States (note: can’t target specific US states)
- Note: Shows to ALL US visitors, not just California
3. Worldwide Except Specific Countries
Use Case: Show banner globally except certain regions
Configuration:
- Mode: Exclude Mode
- Countries: Countries to exclude
- Fallback: Show banner
4. GDPR + LGPD + PIPEDA
Use Case: Major international privacy laws
Configuration:
- Mode: Include Mode
- Countries: EU countries + Brazil + Canada
- Covers: GDPR, LGPD, and PIPEDA requirements
Geo-Targeting Best Practices
Legal Considerations
- Consult Legal Counsel: Verify which regions require cookie consent
- Stay Updated: Privacy laws change; review targeting periodically
- Document Decision: Record why you target specific regions
- Err on Side of Caution: When in doubt, show the banner
Technical Best Practices
- Test Thoroughly: Use VPN to test from different countries
- Monitor Performance: Ensure geolocation doesn’t slow page load
- Fallback to Show: Better to show unnecessary banner than miss required one
- Keep Database Updated: If using local GeoIP, update regularly
User Experience Tips
- Don’t Block Access: Never block non-EU visitors differently
- Consistent Policy: Have same privacy policy for all regions
- Alternative Access: Provide privacy settings page for non-targeted visitors
- Clear Communication: Explain in privacy policy how you use geolocation
If using geolocation targeting, mention in your privacy policy that you detect visitor location for compliance purposes. Be transparent about how this data is used.
Limitations and Considerations
IP Address Limitations
- VPNs: Users with VPNs may appear from different countries
- Proxies: Proxy servers can mask real location
- Mobile Networks: Some mobile IPs are geolocated incorrectly
- Corporate Networks: Large companies may route through central location
- Privacy Browsers: Tor and similar browsers hide real location
Legal Limitations
- Can’t Target US States: IP geolocation not accurate enough for state-level
- Data Still Collected: Hiding banner doesn’t exempt you from data protection laws
- Not a Substitute: Geo-targeting doesn’t replace proper privacy practices
- EU Citizens Abroad: EU citizens traveling outside EU still have GDPR rights
Technical Limitations
- Database Accuracy: GeoIP databases are 95-99% accurate for countries
- Update Frequency: IP assignments change; databases need updates
- Performance Impact: Small overhead for location lookup
- Dependency: Relies on third-party geolocation data
Testing Geo-Location Targeting
Testing Methods
1. VPN Testing
- Install VPN service (NordVPN, ExpressVPN, etc.)
- Connect to server in target country (e.g., Germany for EU)
- Clear browser cookies
- Visit your site in private/incognito mode
- Verify banner appears
- Switch to non-targeted country (e.g., USA if EU-only)
- Verify banner doesn’t appear
2. Proxy Testing
- Use web-based proxy services
- Select proxies from different countries
- Test banner visibility
- Less reliable than VPN but faster
3. Development/Test Mode
- Some plugins offer test mode
- Manually set test location
- Override detection for testing
- Check plugin documentation
4. Browser Extensions
- Location Guard (Firefox/Chrome)
- Manually set geolocation
- Test different scenarios
Testing Checklist
- ☐ Banner appears from target countries
- ☐ Banner doesn’t appear from non-target countries
- ☐ Fallback behavior works when location unknown
- ☐ No JavaScript errors in console
- ☐ Page load time acceptable
- ☐ Mobile devices work correctly
- ☐ Cached pages respect geo-targeting
Caching and CDN Considerations
Caching Challenges
Geo-targeting can conflict with page caching:
- Static Caches: Serve same cached page to all visitors
- CDNs: Cache content at edge locations
- Browser Cache: User’s local cache doesn’t know location
Solutions
1. JavaScript-Based Detection
- Detect location client-side after page load
- Works with any caching setup
- Small delay before banner appears
- Recommended for most sites
2. Vary By Country
- Cache separate versions per country
- Requires CDN support (CloudFlare, etc.)
- Best performance but more complex
3. Exclude Banner from Cache
- Don’t cache banner component
- Load banner dynamically via AJAX
- Rest of page can be cached normally
4. Server-Side Detection
- Detect before caching occurs
- May require hosting configuration
- Works with Varnish, Nginx, etc.
Alternatives to Geo-Targeting
Show Banner to Everyone
Pros:
- Simpler implementation
- No accuracy concerns
- Consistent experience globally
- No privacy concerns from geolocation
Cons:
- Banner fatigue for non-EU visitors
- Potentially unnecessary for some regions
Manual Opt-In Link
- Provide privacy settings link in footer
- Don’t auto-show banner
- Let users manage cookies proactively
- Works for privacy-conscious users globally
Separate Websites
- Different site versions for different regions
- example.eu for European visitors
- example.com for global
- Most complex but offers maximum control
Was this article helpful?
Help us improve our documentation by providing feedback