Forcing a new session or ignoring the IP


I’m trying to track data coming from an app that runs in a museum, as such there is only one IP address that the data comes from… lets say for the sake of argument.

This means sometimes the session hasn’t timed out when a new user starts, even though I’ve shortened the length of the session.

Is there a way of forcing a new session or ending a current session even if it comes from the same IP?

Thanks very much in advance.



There is a config option (you can find it in config/global.ini.php) :

; If set to 1, all requests to piwik.php will be forced to be 'new visitors’
tracker_always_new_visitor = 0

It’s technically a debug option, but this may work for you.

Try setting it in your config/config.ini.php file:

tracker_always_new_visitor = 1

And see if that does the trick.

Thanks very much I’ll try that now. Much appreciated.

PLease don’t use this setting, this is DEBUG only and will create a new visit for EACH page.

Maybe you need to “overwrite” the IP using the Tracking API? Tracking API - Analytics Platform - Matomo

// If you want to force the visitor IP, or force the server date time to a date in the past,
// it is required to authenticate the Tracking request by calling setTokenAuth
// You can pass the Super User token_auth or any user with 'admin' privilege on the website $idSite
$t->setTokenAuth( $token_auth );
$t->setIp( "" );

Hi Matt,

The IP overwrite cracked it.

Many Thanks