We are trying to use Piwik to display usage stats for mobiles apps we’ve developed. We are storing page views in a proprietary database and was hoping to use the Tracker API to get the statistics into Piwik.
By default, it seems like the date/time and IP address are taken from the API request. But it appears that the Piwik_Tracker class does have methods to force the date and time and IP address. I am doing something similar to the proxy here:
http://dev.piwik.org/trac/browser/trunk/tests/integration/proxy-piwik.php
This is the proxy we are trying to use so we can force the date/time and IP.
<?php
include_once 'core/Common.php';
include_once 'core/Tracker.php';
// Custom IP to use for this visitor
$customIp = Piwik_Common::getRequestVar('cip', false);
if(!empty($customIp))
{
Piwik_Tracker::setForceIp($customIp);
}
// Custom server date time to use
$customDatetime = Piwik_Common::getRequestVar('cdt', false);
if(!empty($customDatetime))
{
Piwik_Tracker::setForceDateTime($customDatetime);
}
include 'piwik.php';
?>
This proxy to set the date/time and IP address does not seem to be working fully. The odd thing is that I can see the hits show up in the “Real Visitors Log” widget. But the hits are not shown in any other Visit graph widgets.
I would appreciate any help on getting Piwik to log our historic data.
Thanks!
Jeff