Force heuristics to fail

I need to force an unique visit in Piwik under a certain condition. I saw this post stating you can do this by changing the visitorId and changing the user’s resolution.

http://forum.piwik.org/read.php?2,84499,84499

I tried this code:

$piwikTracker->setResolution(rand(0,9999),rand(0,9999));
$piwikTracker->setVisitorId(substr(md5(uniqid()),0,16));

but it’s not working. Is there validation on screen resolution sizes, or the truncated md5 is not a valid visitorId?

The post mentioned setting resolution as false. I tried that but could not generate an unique visit. I used the random numbers thinking false, false would equate to a constant 0,0 user resolution.

I did test changing the user’s IP. This did generate a unique visit, so I know my token_auth is setup correctly. I can’t use this as I want to keep those metrics along with browser.

Can you try to also add the following to your config file: How to - Analytics Platform - Matomo

then does it work better?

If not please paste all code to reproduce the issue