elan-ev / tobira

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

Add support for Matamo in Paella player #1038

Closed LukasKalbertodt closed 8 months ago

LukasKalbertodt commented 11 months ago

Many institutions want to configure Matomo inside the Tobira Paella player. Some were confused why changing the Paella config in Opencast didn't affect Tobira. There are quite a few open questions regarding that.

For starters, we need to use paella-user-tracking and enable es.upv.paella.matomo.userTrackingDataPlugin and es.upv.paella.userEventTracker in the configuration. The Matomo plugin configuration contains quite a bit of stuff that admins need to configure.

Allow Matomo in Paella at all?

The alternative to using the Paella plugin is to have Matomo support in Tobira itself. There are some reasons why this is a good idea or a requirement even:

There are only two reasons I can think of for adding support for the Matomo Paella plugin:

One might think we can add the Paella Matomo Plugin support now and add the built-in one later. But then we end up with two solutions to do the same thing? That's not great?

What do we make configurable?

(This question is only useful if we add support for the plugin)

On one end of the spectrum, Tobira completely mirrors Matomo configuration, i.e. having one Tobira configuration value for every configuration value of the plugin. That would mean more code in Tobira, it would require Tobira to be adjusted whenever a new config is added, and it would be specific to Matomo without Google Analytics support for example.

On the other end, we just let admins completely change the Paella config. But that has problems, too. The current Paella config is hardcoded in the Tobira frontend, so we would have to merge a configured config with that somehow. Also: most things Tobira configures in Paella have to stay like that. I don't think it's a good idea letting admins have full control over the config; it has to be Tobira controlled. Otherwise, we might easily run into a non-robust solution, that might break with any update. I did go through all Paella configuration values and almost all of them should only be set by Tobira, I think. This only leaves the plugins configuration as something admins might want to touch. We have a similar problem there: Tobira already needs to configure loads of plugins and that config should not be changed for consistency and stability.

One option might be: add one Tobira config value paella.plugins which is is a string containing a JSON object. (JSON in TOML, amazing, I know.) That JSON object is merged by Tobira with the built-in plugins object: the configured object will overwrite already existing keys and add new ones. That allows admins to configure Matomo and/or Google analytics. We would add a big warning that configuring this can break the player.

It's worth noting that plugins have to be enabled via JS code before they can be configured, so admins can't just configure arbitrary plugins there. Tobira must have loaded them beforehand. This limits its usefulness. But I also haven't heard any other use case for all of this except Matomo.

LukasKalbertodt commented 11 months ago

Just for reference, here is the protocol of our session on the last Opencast D/A/CH unconference:

image

LukasKalbertodt commented 11 months ago

In today's meeting we decided to go forward with adding support for the Paella Matomo plugin now, but plan to add proper full support in the future. So the solution we implement now doesn't have to be perfect and we might remove it again in the future once the full version landed.

oas777 commented 10 months ago

Just a quick comment that one thing we need at ETH is for Matomo to collect information on viewing speed.