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

GeoIP2 #10431

Closed
wants to merge 3 commits into from
Closed

GeoIP2 #10431

wants to merge 3 commits into from

Conversation

diabl0
Copy link

@diabl0 diabl0 commented Aug 23, 2016

MaxMind GeoIP2 location provider for UserCountry plugin.

Requires geoip2/geoip2 package and provides support for GeoIP2 mmdb files.
Requires present one of files in misc directory:

  • GeoIP2-City.mmdb
  • GeoLite2-City.mmdb
  • GeoIP2-Country.mmdb
  • GeoLite2-Country.mmdb

Also added ISO-3166-2 region codes to FIPS 10.2 conversion

Unfortunately i don't have access to other databases so no support for them.

use ISO codes for US and CA,
use uppercase for continent, country and region codes.
@sgiehl
Copy link
Member

sgiehl commented Sep 19, 2016

Thanks for the PR. Haven't tested it, but wouldn't it be possible to move this integration into a new plugin? Maybe we need to make some tweeks in current code to handle that easier...
You might need to include the vendor requirements in your plugin directly then, but that shouldn't be a problem I guess.

@mattab
Copy link
Member

mattab commented Sep 23, 2016

Thank you @diabl0 for your contribution!

Stefan improved a bit the platform in #10523 so that you can now define Location providers in plugins. This lets you add your useful GeoIP2 support in a plugin which would be available on the marketplace.

  • You can create a plugin very easily, see: http://developer.piwik.org/guides/getting-started-part-1#create-a-plugin - your plugin should require Piwik >=3.0.0-a1 as we only improved this in 3.x-dev branch
  • Then put your GeoIp2.php file into a folder LocationProvider in your plugin
  • As soon as your plugin is enabled, the GeoIP2 location provider will be detected automatically and appear in the list.

Unfortunately i don't have access to other databases so no support for them.

Could we maybe help you with this? For example, we can buy the database and send them to you... It is very awesome feature that many users will love and if we can help in this way it would be a pleasure!

Let us know what you think. Thanks

@mattab
Copy link
Member

mattab commented Sep 23, 2016

You may need to use Piwik 3 from git 3.x-dev branch until we release a first alpha/beta version (our goal is to release it by next week)

@diabl0
Copy link
Author

diabl0 commented Sep 23, 2016

It wasn't documented when i wrote it that's why I made this changes. I will try to look at this sometime next week and convert into plugin.

@mattab
Copy link
Member

mattab commented Sep 23, 2016

@diabl0 it wasn't actually implemented, and your pull request made us realise about it. So that's all good! Thanks for trying to convert to a plugin. Let us know if you have any trouble

@mattab
Copy link
Member

mattab commented Sep 23, 2016

Closing the pull request for now, as @diabl0 will try to create a plugin on the marketplace for this nice improvement.

@mattab mattab closed this Sep 23, 2016
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

3 participants