Audio player tracking?

Greetings -

In the Piwik Pro tags tab, the HTML5 video tracking tag is referred to as “HTML5 Media tracking” which is what I would expect - that it would track audio and video (even though almost everywhere else it’s referred to as video tracking, including just below that title).

However in trying to use it for audio, it does seem like it only records interaction with a video player, and not an audio-only player. Is this correct?

In this case I should implement a custom tag for an audio player?

Thank you!

Hi @johnny_n,

Would you mind sending the website URL, so I can see the audio player?

It’s possible that the video tracking template doesn’t handle this by default.

Sorry for the delay @anthonybartczak - we’re using Vidstack as the audio player library (used to be Plyr). The player is behind a paywall but I can PM you creds if you’d like.

This is a link to Vidstack: Getting Started: Installation | Vidstack Player

If it’s possible then please do. I just need to inspect the player on a live website.

Had a look at the player and it looks like it doesn’t provide the same events as a HTML5 video player would. Some examples of what our tracking tag will connect to:

element.addEventListener("play", processPlayMediaEvent);
element.addEventListener("timeupdate", processTimeUpdateMediaEvent);
element.addEventListener("pause", processPauseMediaEvent);
element.addEventListener("seeked", processSeekedMediaEvent);
element.addEventListener("ended", processEndedMediaEvent);

Maybe they are there (the events) but I wasn’t able to find them. I have also scrolled through their documentation and couldn’t find some sort of a JS object that you can connect to and listen to events.

In this case you’d probably want to either:

  • set up some custom tags that will track custom events based on player interactions
  • if it’s possible to “hook into” player events directly in your website’s source code - use one of our SDKs to capture the events there

Thank you very much for taking such a detailed look at this, I’m sure you’re correct and that the events don’t exist. I will do custom tags in this case…

One minor suggestion, I had mentioned in my original post that I wasn’t sure if the Media Tracking also supported audio, it’s a bit unclear since mostly it’s referred to as a ‘video tracking’… since it does I think it could perhaps be made more clear and either use ‘Media Tracking’ for the HTML5 version and video for YouTube…

Thank you! :grinning: