I Have a view that outputs nodes, and also a link to download files that are attached to these nodes. I'd like to know when a user clicks one of these links, so that I can log the event.

All attached files are files in drupal's public file directory, inside a directory at sites/default/files

Is there good approach for detecting a click or file download in this case?

1 Answer 1


Module Track da files (despite its goofy name) tracks both public and private files. Here is a quote about it (from the module's project page):

... enables the possibility to track how much visitors are viewing files on site.

Every link to a file can be configured to be tracked. Then, a record is registered each time a visitor access the file from this specific link.

  • Thanks, track_da_files looks interesting. In this case, I am excluding, then rewriting the link to the file, so I need to look into how I might adjust the view to use the field formatters provided by tdf.
    – Dave Bruns
    Oct 25, 2013 at 22:38
  • Out of curiosity, how/why are you rewriting the link to the file?
    – jonpeck
    Oct 25, 2013 at 23:18
  • These are practice worksheets for lessons, so I'm rewriting the url as a link that always displays "Practice", regardless of the actual file name.
    – Dave Bruns
    Oct 25, 2013 at 23:23
  • Oh, okay, so the path itself isn't changing, just the label?
    – jonpeck
    Oct 25, 2013 at 23:24
  • Right. My saying "rewriting" wasn't really clear, but I was talking about the "rewrite results" feature in views.
    – Dave Bruns
    Oct 25, 2013 at 23:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.