Do not track downloads?

Hello,

I have a site that allows you to download files, and each file has a different link because there is a token that is generated for each download (for certain needs) example blabla.com/files/file.txt?token=blablabla.

The problem is that I end up with tens of thousands of different links in the Downloads category. Is it possible to make it count only as a link, or in the worst case not track the downloads anymore? (in addition to the parameter token, the download links are located in subdomains of the main domain)

Also, before accessing the download link, the user accesses a download page which also contains a token in parameter. For this page, if I understand correctly I only have to add the name of the parameter (example “token”) in the “global list of query url parameters to exclure”?
Therefore, visitors who visit the page with different tokens will be considered as if it were the same page without parameters in the url, right?

Thank you

I finally did it by deleting the line “_paq.push([‘enableLinkTracking’]);” in the tracking code.

Hallo Outline, yes, the _paq.push([‘enableLinkTracking’]); is also for tracking downloads. But by this, the tracking of all link clicking is disabled. See here:
scroll to

Download and Outlink tracking

https://developer.matomo.org/guides/tracking-javascript-guide

The matter ist, downloads are also links. For a solution, you can create a JavaScript function with a span element for downloads like (with enableLinkTracking and don’t track downloads):

<span onclick="window.open('https://www.example.com/path/to/file.zip');">Download</span>

For another reason you can disable link and download tracking global and track links separatelly like:

<a href="https://www.example.com/" onclick="_paq.push(['trackLink', this.href, 'link']);">Download</a>

All not tested. No warranty.

PS: deleting is not required. You can it comment out like

_paq.push(['trackPageView']);
// _paq.push([‘enableLinkTracking’]);
2 Likes