Add support for pulling geolocation data from headers #984
Replies: 4 comments 5 replies
-
This is exactly what I was wondering ! |
Beta Was this translation helpful? Give feedback.
-
It's only relevant for custom domains as far as I'm aware. If your customers' sites are using the Cloudflare CDN there should be no issues with installing Plausible on it. What's your setup? Are you self-hosting Plausible or using the SaaS? Are you actually running into any problems? I've looked at the docs and I think we need to clarify a bit when using a CF proxy is a problem and when it isn't. |
Beta Was this translation helpful? Give feedback.
-
I implemented this in my fork a few months ago: master...wavy:wavy (can be pulled and tested using the Essentially, it looks for a If this is something that looks acceptable by the Plausible team, I can open a pull-request. If not, feel free to use my image; I'm updating it on every release. |
Beta Was this translation helpful? Give feedback.
-
I thought I'd chime in here. The major benefit is really down to resources - So by using CF, we drop the requirement of having MMDB, decrease resource usage on the servers as well as increase the performance available from plausible. In the case of cloud hosted plausible, you guys aren't using CF for the injestation of events - so MMDB is better suited, however for anyone self hosting, or maybe in the future if you use CF - it would lower resource requirements thus lowering cost. |
Beta Was this translation helpful? Give feedback.
-
EDIT: We've recently moved from Cloudflare to Bunny.net. They use different headers to provide the country code so this issue isn't relevant for me any more. If this feature were to be implemented, it should be CDN-agnostic. I.e. allow us to choose which headers the geoip data is pulled from.
Hi guys,
A couple of questions. I read in your docs that tracking may not work correctly for sites proxies by Cloudflare. Is that still the case? All of my clients' sites use Cloudflare for CDN + WAF so bypassing it isn't an option for us. I imagine a lot of people are in the same situation...
Cloudflare provides all the necessary visitor info for tracking as headers (real IP address, country code etc): https://support.cloudflare.com/hc/de/articles/200170986
Would it be possible to add support for this?
An option to use the geolocation header instead of MaxMind would be awesome. Here's some more info on CF geolocation: https://support.cloudflare.com/hc/en-us/articles/200168236-Configuring-Cloudflare-IP-Geolocation
This would mean faster performance for Cloudflare users since visitors' countries would be obtained from the header. No db lookup required. And more importantly, it would make sure visits are tracked correctly without needing to disable the CDN.
Beta Was this translation helpful? Give feedback.
All reactions