Unable to Track Mp3 Downloads


I think I tried all possible ways so far and I cannot do it. I can track images etc fine, but not mp3s… how weird.

I cannot track link clicks on mp3 files neither direct links to an mp3. I am not using a special software for the mp3 downloads, they are just <a href="… links to files in a specific directory.

I tried to “Force a click on a link to be recorded as a download in Piwik” with no success. I tried the following classes:

<a class=‘piwik_download’ href=…
<a class=“piwik_download” href=…
<a class=“download” href=…

I also tried creating a goal with all possible settings and I cannot do it.

Is it something simple that I am not doing or do I really need to pass the downloads through some software with php code ? I used a software like this in the past and removed it for better… (supposed)…

any help on this appreciated,… would be damn excellent to track downloads.

On the same page as your mp3, other “downloads” like .exe .avi etc. work fine, but not mp3?

hi matt,… yes I can track when someone zooms an image on the page I will show you, but not when downloading an mp3


same happens on any other page on this site that has mp3s (also tested mp3 plays)

I am able to track video plays using a code.

but no success with mp3 downloads or plays

This should work, but I see your page also uses Mootools, so perhaps there’s an interaction here that we’re not aware of.

Please try moving your Piwik tracking code out of the , and closer to the (but before Google Analytics)?

something even more weird…

just noticed a visit (maybe you) with linux from usa, entering the page I gave and indeed showed that clicked on the mp3, and the goal worked too.

So I tested further and I found out that I can only see the mp3 download clicks and mp3 goal when using Firefox or IE, and not when using Google Chrome, Opera or Safari.

any idea of this ?

thanks Anthon, let me try this

ok I moved the piwik code right before the and removed the google analytics code to test.

Still same results.

I can track mp3 downloads with FF and IE, but not with Google Chrome, Opera and Safari. :slight_smile:

The problem with Chrome and Safari is a webkit bug. The “fix” is to add a target=’_blank’ attribute.

thanks so much Anthon again, I will try this and get back to ya

yes target="_blank" made tracking from those browsers possible now. thanks for this tip !

I suppose hitting the mp3 url directly will never give stats unless using a download software on the site right ?

Just a little more help from u please with regular expressions. I wanna have 2 different goals for “mp3” and “avi” downloads. I tried these expressions but I think I write them wrong…

goal Mp3 Downloads:

goal Video Downloads:


thanks !

found it… I was missing the * after the dot :slight_smile:
thanks for your great help guys
this topic is fully SOLVED I guess

yes, in a regular expression,


matches zero-or-more characters.

you do excellent work guys :slight_smile: you the forum has great support bravo