Introduce "real" hook to force set the visitor IP from a plugin #20054
Labels
Enhancement
For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Milestone
For quite some use cases, I'd like to be able to set the visitor's IP address, exactly like the "cip" parameter does. The current hook "Tracker.setVisitorIp" is mainly used for anonymizing the IP address in the PrivacyManager, which is set too late in the request workflow (afterRequestProcessed).
An potential use case is VAST tracking - the client IP address can be delivered by X-Forwarded-For, or X-Device-IP or X-Client-IP. In some cases, there will be IP addresses in all of those headers and you'll have to run this through plugin business logic to set the correct one.
Summary
Introduce a hook to set the client IP address early in the request workflow (just like the cip parameter). Perhaps, we can also rename the "Tracker.setVisitorIp" because the name implies, that this method is not only for saving a certain IP address, but also for setting the IP before it gets processed by e.g. fingerprinting, visitor recognition, geolocation, etc.
The text was updated successfully, but these errors were encountered: