[Piwik-trac] [Piwik] #134: API to push data into Piwik without using the javascript tag
Piwik
trac at piwik.org
Mon Mar 10 11:48:51 CET 2008
#134: API to push data into Piwik without using the javascript tag
-------------------+--------------------------------------------------------
Reporter: matt | Owner:
Type: Bug | Status: new
Priority: major | Milestone: Stable release
Component: Core | Version:
Keywords: |
-------------------+--------------------------------------------------------
Currently data can be pushed in the database using the piwik.php script,
called from the piwik.js tag.
However in some cases we want to push statistics from within PHP or other
languages. For example, if we want to count all hits on a given file (for
example http://piwik.org/last.zip) this file could instead be a script
issuing a request to record a new download, and then redirect the user to
the actual file requested.
In php the file last.zip could be a PHP file with the content:
{{{
<?php
// this file will record the download and then redirect the user to the
file
// we first call the PIWIK push API in order to record this download
Piwik_LogStats_API::logNewDownload('last.zip');
// we load the requested file so the user can download it
readfile('files/last.zip'); // see php.net/readfile
?>
}}}
--
Ticket URL: <http://dev.piwik.org/trac/ticket/134>
Piwik <http://piwik.org>
Piwik, open source web analytics software
More information about the Piwik-trac
mailing list