elan-ev / tobira

Video portal for Opencast
https://elan-ev.github.io/tobira/
Apache License 2.0
20 stars 15 forks source link

Event title information is not sent to Matomo Media Analytics plugin #1200

Open snoesberger opened 5 days ago

snoesberger commented 5 days ago

In order for the Matomo Media Analytics plugin to work correctly, the paella player user tracking plugin needs to send a video title information. Without this information, all statistics within the Matomo Media Analytics plugin will be combined under a video with the title "unknown". At the moment there is no information about the title being sent from Tobira to Matomo at all. According to this documentation the title information is extracted from one of these sources:

Media Analytics will detect the media title by searching for the following pieces of information:

  • firstly, the data-matomo-title HTML attribute.
  • next, the data-piwik-title HTML attribute.
  • Media title from YouTube / Vimeo player.
  • title HTML attribute.
  • finally, the alt HTML attribute.

Would it be possible to add the Opencast event-ID with the mentioned HTML attribute to the paella player within Tobira? (I'd prefer to use the event ID instead of the event title to be sure to have a unique identifier.)

LukasKalbertodt commented 5 days ago

All the attributes mentioned need to be set on the <video> element it seems? Then Paella would need to do that, as it is controlling that element, not Tobira. Or can it be set on any node? Probably not?

Also, you asked for using the Opencast event ID as a title, but it seems like this title function is actually just for convenience in the dashboard. From the docs:

When analyzing your media reports in Matomo, media titles are often more useful than the Media HTTP URLs (which may contain only random numbers and letters).

To me this sounds like we should actually use the title, as the "uniqueness" of reports is ensured another way.

snoesberger commented 4 days ago

All the attributes mentioned need to be set on the <video> element it seems? Then Paella would need to do that, as it is controlling that element, not Tobira. Or can it be set on any node? Probably not?

I'm not sure if the attribute needs to be set on the videoelement or if it can be set on another surrounding element. I know that @luniki is also working on the same problem for Opencast. You might want to talk to him about this.

Also, you asked for using the Opencast event ID as a title, but it seems like this title function is actually just for convenience in the dashboard. From the docs:

When analyzing your media reports in Matomo, media titles are often more useful than the Media HTTP URLs (which may contain only random numbers and letters).

To me this sounds like we should actually use the title, as the "uniqueness" of reports is ensured another way.

Unfortunately, in the context of Matomo, the video title is the only way to identify a video. There is no other way in Matomo to determine which Opencast event ID is behind the video title. As the video title is not unique in Opencast, Matomo aggregates all statistics for videos with the same title. In order to get accurate statistics from the Media Analytics plugin, it is therefore important to have unique titles within Matomo for each video. By sending the OC Event ID as the video title to Matomo, we can ensure that this is the case.