DDT makes the web analytics tracking of “direct downloads” possible.
DDT is an answer to that question.
Download the archive file by clicking the Download button.
Uncompress it in a folder (we'll call it root_folder) on your web server.
Edit if necessary the paths in the two require_once lines in the file download.php.
Edit the file piwik_direct_downloads_config.inc and fill in appropriate values of $token_auth and $siteName.
Edit the other values in the file to ones that suit you.
The counting of the number of times each direct download link has been triggered is disabled. To active it, you will need to:
Create a MySQL database. A model is provided in the ZIP archive.
Create a database user with rights on the newly created table.
Provide in piwik_direct_downloads_config.inc the parameters necessary for DDT to access and update the table.
In order to use DDT, you just need to convert URLs that point to your content to equivalent links that not only provide the content you intended to provide, but that also let Piwik know that the download has occurred.
For instance, if the link to convert is http://www.mydomain.com/files/document.pdf and the file download.php has been installed in the folder files of root_folder (the root folder of your web server), the new link would be http://www.mydomain.com/files/download.php?file=document.pdf.
However, in case download.php has been installed at the root of the web server (i.e. instead of being installed in files folder) the new link would be http://www.mydomain.com/download.php?file=document.pdf.
In all cases, the new link must match the root_folder path that you will have specified when following the instructions in the Installation section of this webpage. Both the path to download.php and the path to the file to be downloaded must be correct.
DDT for Piwik is published as Public Domain for the portions of code originally developed by Khalemy. Other portions of code remain the property of their original authors and they remain under their respective license.