I’m trying to do something a bit different with piwik. I have a largish amount of log data of pageviews with reliable id’s (not ip) and I’m trying to insert a few months of history so that I can visualize it using piwik in a setting that most web analytics people are comfortable with.
I’m trying to accomplish this by calling piwik.php directly from my own python script using a library that is cookie efficient and whatnot. I quickly discovered that at the very least I have to set tracking_requests_require_authentication to 0 and trust_visitors_cookies to 1 to get over some internal smartness that piwik does by default.
I’m sending events from first to last as many things in the visit recognition framework assume that events come in order .All’s nice and well on that front and I’m able to fake data and get reasonable and credible resulting visualizations from piwik, but I just can’t seem to make consequent visits by the same person to register as different visits.
I have a unique id of every visitor (a hash, the first 16 characters of which I fake as cid on the query string). I tried faking a cip as well (in the private 10.0.0.0/8 range) and even making the piwik.php calls with a cookie aware http library but nothing seems to work. I’ve read through the code and can’t seem to figure out what the problem is. The dashboard widget reports e.g. 6 visits and 2 unique visitors for a given day, but when I look at the Engagement view i see 6 visits in the “visit number 1” row of the table. Also, in the database every row in piwik_log_visits has visitor_count_visits as 1, so I suspect something in logging the queries doesn’t work when forcing dates in the past.