Independent Analytics uses the visitor’s IP address to get their geolocation and create a unique, anonymous ID to recognize repeat visits.
The following headers are checked to get the IP address from the client:
$headers = [
'HTTP_X_FORWARDED_FOR',
'HTTP_X_FORWARDED',
'HTTP_FORWARDED_FOR',
'HTTP_FORWARDED',
'REMOTE_ADDR',
'HTTP_CF_CONNECTING_IP',
'HTTP_CLIENT_IP',
'HTTP_INCAP_CLIENT_IP',
'HTTP_CF_CONNECTING_IP'
];
While unusual, some hosting configurations may not share the IP address in any of these headers. If your site shares the IP address in a unique header, you can add it to the list of headers checked using this filter function:
add_filter('iawp_header_with_ip_address', function () {
return 'CUSTOM_HEADER_NAME';
});
Replace “CUSTOM_HEADER_NAME” with the name of the header that contains the visitor’s IP, and Independent Analytics will then be able to recognize their geolocation and create an anonymous ID.