Drupal 8 track files download






















With the system I'm migrating from, I parse the server logs with a python script, and then reconstructing information about publication type, etc. Google analytics doesn't work because a lot of the file downloads come from direct requests to the file, not via the page itself.

My hope is that with drupal's private file system, the system should know about and be able to send to google analytics or some other counter failing that , information about all file downloads in that private file system.

Ideally it would carry with it information on the node that the file is attached to, making it much easier to look at, for example, the number of journal article downloads for material published in FY I'm fairly new to drupal, and honestly I'm so tied up with other parts of the build that I haven't been able to do much to dig into this yet, beyond searching here and on google a number of times.

My searches so far have been fruitless, so I'm trying to find out whether I need to try to make sure enough detail is implicit in the file system to allow me to parse the log files better. Can anyone help me figure out how counting file download statistics can be accomplished without relying on server logs?

I'm happy to explore modules, my initial thought was that the google analytics module might take care of that on its own, but I realized it still relies on someone clicking a link. An API for tracking file downloads. Basically the difference between this and other file download tracking modules is this module does not intend to track every single time the file is viewed. It only wants to track when a file is actually triggered for download. It is up to the site to implement links to the file download URL.

This module uses AJAX to count file downloads. It's optimized for medium to large sites such as my own site, OpenGameArt. Using this module has some advantages and some limitations versus other methods of counting downloads:. Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. How can I track download statistics for private files?

Ask Question. Asked 5 years, 9 months ago. Active 4 years, 8 months ago. Viewed 2k times. Improve this question. UltraBob UltraBob 1, 8 8 silver badges 29 29 bronze badges.

Question's title and body doesn't quite match. Title is primarily opinion based each have his own definition of "good" , and in body you didn't say what have you tried so far and what's your exact problem.

Thanks Molot, will revise, I was trying to keep the question brief — UltraBob. Brief is good, but consistent and complete is way better. You wouldn't want people to give you answers you've already tried and found not suited for your situation.

Waste of time for you and for them. I have to pass the dynamic download link to the formatter template file twig so that user can download the mp3 file by clicking the link. I am assuming the field you are adding the formatter is a field that allows uploading of files e. Make sure your formatter class extends from FileFormatterBase.

Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. How to create file download link in drupal 8 Ask Question. Asked 6 years, 2 months ago. Active 5 years, 1 month ago. Viewed 7k times. Add a comment. Active Oldest Votes. VJamie 3 3 silver badges 14 14 bronze badges.

Bon Kim Bon Kim 11 2 2 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password.



0コメント

  • 1000 / 1000