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?
Hi,
Download tracking in Matomo is really simple:
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 https://developer.matomo.org/guides/tracking-javascript-guide#recording-a-click-as-a-download
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.
I am still stuck with this issue… Any idea how to solve it?
Hi,
Did you also add _paq.push(['setDownloadClasses', "download"]);
before the trackPageView
?
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.
Hi I am getting the same issue. Can some one help me out here.