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


#1

Hi,

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:

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

Does anyone know a solution?

Thanks!

Tom


(Matthieu Aubry) #2

You can call


piwikTracker.trackLink( URL, "download" );

which will record a download for URL


#3

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 http://domain.com/download.pdf. 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


#5

O.k.

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?


#7

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