Downloads are not reccognised


#1

Hello,
On one of my websites, the downloads are not tracked, or at least they seam considered as page without titles. Anyway, I am not able to find the downloads in the Actions > Download module. This issue appears to be quite recent. Is this a bug? What can I do to investigate the possible causes?

Screenshot_2018-04-05_13-22-52


(Lukas Winkler) #2

Hi,

Download tracking in Matomo is really simple:

https://matomo.org/faq/new-to-piwik/faq_47/

It just checks if the link a visitor clicks on ends with a known file extension (e.g. .pdf) and if so the click gets tracked as a download.

So if you download URL looks like https://example.com/dowloader.php?id=34525 or something like this, Matomo doesn’t know this is a download by default.

You can simply fix this as explained here:

Recording a click as a download

If you want to force Piwik to consider a link as a download, you can add the ‘piwik_download’ css class to the link:

<a href='last.php' class='piwik_download'>Link I want to track as a download</a>

Note: you can customize and rename the CSS class used to force a click to be recorded as a download:

// now all clicks on links with the css class "download" will be counted as downloads
// you can also pass an array of strings
_paq.push(['setDownloadClasses', "download"]);

_paq.push(['trackPageView']);

from JavaScript Tracking Client: Integrate - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3


#3

Thank you for your answer.
I forgot to mention that my URL ends with .pdf and, just to be sure, I tested with the class piwik_download on the link. The error is still hapening.


#4

I am still stuck with this issue… Any idea how to solve it?


(Lukas Winkler) #5

Hi,

Did you also add _paq.push(['setDownloadClasses', "download"]); before the trackPageView?


#6

I tried with the default class piwik_download and a custom class, with and without adding _paq.push(['setDownloadClasses', "download"]);, and the result is the same. The downloads are logged as pages without titles.