Hello,
I’m trying to track the number of downloads of pdf files on a website (a Nextcloud instance), based on the Apache logs + the import_logs.py script. When running the import script with the default configuration:
./import_logs.py --url=http://myserver/piwik/ --token-auth=mytoken --idsite=20 --recorders=4 --enable-static /var/log/httpd/oc-access_log
It imports all the data successfully, but when going to the “Behaviour > Downloads” tab it is cluttered with .js, .css, .png etc etc…files and the .pdf files are not really visible.
So the help of import_logs.py tells us to use this:
–download-extensions DOWNLOAD_EXTENSIONS
By default Matomo tracks as Downloads the most popular file extensions. If you set this parameter (format: pdf,doc,…) then files with an extension found in the list will be imported as Downloads, other file extensions downloads will be skipped.
So let’s try the same command as previously, with the addition of the download-extensions flag (on a new empty Site ID)
./import_logs.py --url=http://myserver/piwik/ --token-auth=mytoken --idsite=21 --recorders=4 --enable-static --download-extensions=pdf /var/log/httpd/oc-access_log
…and it produces the same result I was expecting only the .pdf files to be displayed in the “Behaviour > Downloads” tab.
Am I missing something?