setIp shows Ip as even with setTokenAuth

When I try to set the visitor ip address using the following code, I keep seeing in Piwik.

$tracker = new PiwikTracker( $idSite = 1, '' );
$tracker->setTokenAuth( 'TOKEN' );
$tracker->setIp( 'IP' );

The auth token is correct and the ip address is a string, as expected. I am running Piwik 2.13.1. Why doesn’t it record the correct ip?

Hi there,

it should work indeed. Are you sure the token_auth is correct?