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

Make geoip2 server modules usable with log import and usercountry:attribute #12814

Open
diosmosis opened this issue May 3, 2018 · 0 comments
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.

Comments

@diosmosis
Copy link
Member

The log importer and the usercountry:attribute command currently do not work with geoip2 server modules, since they require geolocating specific IP addresses, rather than the current one. However, it's possible to "trick" the server module into geolocating any ip address, by sending a request to the server with the X-Forwarded-For header. We can use this to make log importing & the usercountry:attribute geolocate with the server module.

Possible implementations:

  • usercountry:attribute: for this command we would simply send a http request to localhost server side w/ X-Forwarded-For set.
  • log importer: we could change the tracker and make it geolocate via an http request to localhost if cip is set and is different from MMDB_ADDR. Not sure if this would have a large impact on performance.

The endpoint used to return back geoip data should be minimal. Like a php file that simply return $_SERVER[...] vars. We don't want to make a another request to Piwik during tracking.

@Findus23 Findus23 added the Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. label May 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

No branches or pull requests

3 participants