Download tracking but no outlink tracking


I am a newbie with piwik.
I have installed piwik for having basic statistics on my web site (a photo blog).

as said in the title, I wish to have download tracking but no outlink tracking (in fact, I have published some theme for the CMS zenphoto and I wish to have specifics stats of downloading).

how can i do ?

  • disable the download & outlink tracking and force a click on a link to be recorded as a download in Piwik ?

so the tracking code will look like


with this class on the relevant links


I am OK ?


I disabled the monitoring of outlink and set the class ‘piwik_download’ to forcetracking of specific downloads.
but the results are not good: I do not see any specific downloads.

info: currently, I use phpMyVisit (version installed by default by my ISP Free) and piwik.
I test the correct configuration of Piwik and the proper integration on my site before migrating all on a new hoster.

there is the code of my footer

<!-- phpmyvisites -->
<a href="" title="phpMyVisites | Open source web analytics"
onclick = "; return(false);"><script type="text/javascript">
var a_vars = Array();
var pagename = 'zpArdoise 1.4';

var phpmyvisitesSite = 204639;
var phpmyvisitesURL = "";
<script language="javascript" src="" type="text/javascript"></script>
<object><noscript><p>phpMyVisites | Open source web analytics
<img src="" alt="Statistics" style="border:0" />
<!-- /phpmyvisites -->

<!-- Piwik Tracking Code -->
<script type="text/javascript">
var pkBaseURL = (("https:" == document.location.protocol) ? "" : "");
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
</script><script type="text/javascript">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 1);
piwikTracker.setDocumentTitle("zpArdoise 1.4");
} catch( err ) {}
</script><noscript><p><img src="" style="border:0" alt="" /></p></noscript>
<!-- End Piwik Tracking Code -->

and there is the link to track :

<a class="piwik_download" title="zpArdoise 1.4" href="" target="_blank"><img style="float: left; margin-top: -20px; margin-right: 10px;" title="zpArdoise 1.4" src="" alt="zpArdoise 1.4" />zpArdoise</a>

please, could you help me ?
thanks in advance

You need to leave piwikTracker.enableLinkTracking(); to track downloads.
It will also track outlinks but it should be fine, even if you don’t need the data?


thanks for your reply

ok, whith i will follow outlinks, even if I don’t need the data.

but, my tests between phpMyVisit and piwik are not concluant : I am unable to follow the download of specific files with piwik.
I want only tracking specific downloads and I don’t want to follow other download (I do not mix - or walnut - the results supplied)

for my needs, should I do like that :
1/ configure the script : piwikTracker.setDownloadExtensions("") (-> no file extention to follow)
2/ add class=“piwik_download” on my specifics links to follow as a download ?

thanks for your help.

vincent3569, I think your proposal will work .setDownloadExtensions("")

please test it and report here if it works :slight_smile:


After some test, unfortunately, this does not work.

there a link to anonymous report :
and there, a link of my website (i want to track the dowload of the zip file) :

the specific links are shown as outlink but not as download.

can you help me to configure piwik for doing what i want to do ?

This is by design, if the files are not on the same domain as your website, then it will be counted as outlinks…

the files to track are is on the same domain as my website (

but the link is a “composite one” : it allows to phpMyVisit to tack those files.
that’s why I added the class=“piwik_download” to force tracking.


it is a temporary solution, and to compare piwik and phpMyVisit before switching to piwik.
do you have any solution for me ?

Switch to Piwik directly, Phpmyvisites is not supported anymore and I can promise you that Piwik is a lot better :slight_smile: