Make geoip2 server modules usable with log import and usercountry:attribute #12814
Labels
Enhancement
For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Milestone
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 & theusercountry: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.cip
is set and is different fromMMDB_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.The text was updated successfully, but these errors were encountered: