1

I have several .mp3 (they do not have to be .mp3 I can convert them to another format - I just need to be able to play it through a browser) files on my server and I need to track:

  • numbers of start playing
  • the average play time
  • how many times the files was played
  • where the visitor is from (based on IP?)

I need to track without player. Best when someone opens the myweb.com/sample.mp3 to know all this information that I have listed. Is it even possible to do that?

2
  • You can't do that without a player - just count the "downloads" and see the location if the browser submits. Commented Oct 26, 2019 at 10:35
  • apache and nginx, interesting. You could use the server logs for when the file has been called directly.
    – user8034901
    Commented Oct 26, 2019 at 11:24

1 Answer 1

1

I need to track without player. … Is it even possible to do that?

Not really.

All you know from the server end is that the file was accessed. This doesn't tell you whether or not it was played, and for what ranges.

For example, suppose this happens:

  1. User visits page with reference to audio file.
  2. Browser downloads the first 30% of the audio file, in case the user clicks play.
  3. Server tracks this HTTP request and assumes the listener heard the file.
  4. User never clicks play. Audio is never heard, and there's no way for the server to know.

Or, suppose this happens.

  1. User visits page, listens to audio file.
  2. Server tracks that the whole file was downloaded.
  3. Browser caches page and audio file.
  4. User visits page 1,000 more times, but each time it's served from their local cache.
  5. Server has no idea that the file was played more than once.

The only way you can really track this level of detail is to measure it where it's actually being played.

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.