Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CloudFlare location provider #90

Conversation

gabrielbauman
Copy link

Hi there,

This pull request adds a CloudFlare location provider to the UserCountry plugin.

If Piwik is behind a CloudFlare proxy, all requests have a HTTP_CF_IPCOUNTRY header containing the country code of the visitor as looked up by CloudFlare. This LocationProvider simply uses that value.

I am not sure how to get things set up for internationalization or what your requirements are on that front, so I have just hardcoded English strings for now. If you let me know what needs to be done, I will do it.

@mattab
Copy link
Member

mattab commented Jul 29, 2013

Thanks for the PR!

I don't think we want to add CloudFlare support since it only reports the "Country" which is too limited. I would recommend CF users to setup Maxmind for better accuracy.
PS: also got a NOTICE warning on the admin page

@mattab mattab closed this Jul 29, 2013
@gabrielbauman
Copy link
Author

I get that it's not as accurate as GeoIP, but it's still a good deal better than the default 'browser language' provider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants