I’m having troubles getting the download tracking to work. I’ve tried everything on this FAQ section with no success: https://developer.matomo.org/guides/tracking-javascript-guide#recording-a-click-as-a-download. Triggering manually with JS results in 403 requests.
What can be the resson for this?
Normaly, it is not neccessary to track a link as a download, when it is a download. The link tracking has this included.
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
consider the order.
HTTP Statuscode 403 - Forbidden
Maybe a htaccess Rule.
I’ve included both settings in the correct order with no effect. This is the only .htaccess rule present:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
This is very special. Maybe this helps:
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
L = Last
and
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} !-d
Addition: By HTTP_AUTHORIZATION
you must send username:password
inside the matomo tracking
var u="https://username:password@www.example.com/matomo/"
consider: username:password
is visible in the sourcecode.
or disable it:
# RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
OK, I finally found the answer. My hosting providers Firewall blocked the requests. I could disable the specific rule that was blocking the download tracking.
Thanks for the effort, melbao!