1

I have audio files (.mp3 and .wav format) saved on my server. They're normally supposed to be played through a webpage and I can track how often that page is opened.

But people can now refer directly to that sound file's link on my server and play it. How do I track the number of times these audio files are played?

An example: Normally user access the recording through this page, https://namedrop.io/keshavmalani But now a person may choose to integrate their NameDrop recording into something else using the direct recording link: https://namedrop.io/profile/audio/km.mp3 and ideally I want to be able to track it.

I don't have a redirect to the audio file setup. Recommendation on how I would implement this without causing slowdown? I'm a beginner - intermediate coder.

credizian
  • 469
  • 5
  • 20
  • Can you put code when user click on songs link? – SarangaR Feb 15 '16 at 07:06
  • 3
    This all depends on your current code structure and method. You could have a url which increments a number and have it redirect to the audio file. Without better information and a code example, we can't really help you. – Rein Feb 15 '16 at 07:27
  • Updated question with example – credizian Feb 15 '16 at 17:54
  • Without knowing some minimal information about your application, it's going to be impossible to give a specific and helpful answer to this question. Try adding your server (Apache? Nginx?), operating system (Linux? Windows) and programming language/application framework (PHP and Wordpress? Ruby on Rails?) to your question and you'll have better luck. – RickyTomatoes Feb 15 '16 at 18:07
  • 1
    I believe basic search on StackOverflow will provide with an answer like this one - http://stackoverflow.com/questions/146/how-do-i-track-file-downloads – Daniel Protopopov Feb 15 '16 at 18:39
  • @DanielProtopopov that looks like it would work. Ty! BTW how do I mark this as an answer? – credizian Feb 15 '16 at 19:35
  • You can mark the answer in the link I provided - I believe that will be fair to its author - I was just a re-translating it. :) – Daniel Protopopov Feb 16 '16 at 06:36

1 Answers1

1

Answer is here: How do I track file downloads

By: @w-ll (https://stackoverflow.com/users/146637/w-ll)

Thanks to @DanielProtopopov for pointing it out

Community
  • 1
  • 1
credizian
  • 469
  • 5
  • 20