Force tracking downloads without <a- tag or class- parameter



on may pages I don’t use the <a href= - tag for downloads because I’m using javascript/ ajax- functions within a <div- tag. I tried to track downloads with the class=“piwik_download” in the div. But this doesn’t work.

I do not want to use goals or something else to track the downloads. So I’m looking for a solution to track downloads similary to the Piwik-Javascript-Code:

piwikTracker.setDocumentTitle(“DocumentTitle” );
with e.g. ‘pwikiTracker.setDownload(“DownloadTitel” );’ instead of piwikTracker.setDocumentTitle(“DocumentTitle” );[/sub]

Does anyone know a solution?



(Matthieu Aubry) #2

You can call

piwikTracker.trackLink( URL, "download" );

which will record a download for URL


Thank you, matt!

I didn’t realize that trackLink with ‘download’ ist counted as a download. I thought it is tracked as a download- link.

But in addition there is something strange: The URL is only tracked as a download (in the dashboard -> Visitors -> Visitor log) if I use the form Only /download.pdf is not tracked. And furthermore it is not tracked in the dashboard -> actions -> downloads (although it is shown the download-symbol in the visitors log). Or I’m wrong?

(vipsoft) #4

Piwik filters urls that don’t begin with “http”, so this is the expected behaviour



But can anybody explain me, why this download is not counted in the dashboard -> actions -> downloads (although it is marked with the download-symbol in the dashboard -> Visitors -> Visitor log) ?

(Matthieu Aubry) #6

It should be counted in ACtions > Downloads. Are you sure it is not there?


I checked it again: It isn’t there!
Maybe you could check it with your installation?