Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Sunshine Lewis 31 posts 139 karma points c-trib
    Sep 08, 2015 @ 21:25
    Sunshine Lewis

    How to Track Downloads by Media folder?

    Hello Umbracians,

    I have a site that has the media organized by work unit. I've been tasked with counting the downloads for each work unit.

    In older incarnations of this site, I would use the iis web logs to count requests for any media in that work unit's folder. In Umbraco, as you know, the physical media paths don't represent the virtual backoffice organization so that doesn't work.

    I have three ideas on how to accomplish this and I'm looking for both critiques/feedback and additional ideas (or actual experiences).

    1. Generate a list of all of the media items in a particular folder and use that list to filter the IIS logs.

    2. Include the work unit in the log file, either via a query parameter or a custom logging column

    3. Create a media handler that writes to a media specific log file each time a media item is requested.

    Method 1 requires that the list be regenerated before each analysis and is very clumsy and slow but it's working for the moment.

    Method 2 seems like the best choice but I'm still relatively new to .Net and Umbraco so I'm not sure where to start. Can I intercept or customize the code that generates when you "Link to File"?

    I'm not even certain Method 3 is possible.

    Can't wait to hear your ideas. Thank you!

  • Alex Lindgren 158 posts 355 karma points
    Sep 08, 2015 @ 21:38
    Alex Lindgren

    Do you use Google Analytics? If so, you can add an event to track the click for the link.

Please Sign in or register to post replies

Write your reply to: