Another viable way to detect visitor's country?


#1

Hi, I was going through the process of setting up the ip_lookups enrichment. Even though I’ll end up subscribing to maxmind but just for fun I wondered if there was another way to do it using AWS Cloudfront’s CloudFront-Viewer-Country header that gets forwarded by the edge server. I only need country level detection.

http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/header-caching.html#header-caching-web-location

You’d have to put the collector behind CloudFront and make sure to pass all traffic through. It might not be necessary to enable all edge locations. Then I suppose use the HTTP Header enrichment to extract the header.

What do you think?


#2

That’s…really interesting. I’d considered using edge node location before but it has the problem of not being accurate enough because of network considerations and the fact that there’s just not enough edge nodes to reliably locate down to the country level.

The header solution sounds neat as a bit of fun but I suspect it’s only as accurate as Maxmind which sounds like what AWS is using.

http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/georestrictions.html

https://support.maxmind.com/geoip-faq/geoip2-and-geoip-legacy-databases/how-accurate-are-your-geoip2-and-geoip-legacy-databases/