Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Matamo in Paella player #1038

Closed
LukasKalbertodt opened this issue Dec 18, 2023 · 3 comments · Fixed by #1099
Closed

Add support for Matamo in Paella player #1038

LukasKalbertodt opened this issue Dec 18, 2023 · 3 comments · Fixed by #1099
Assignees
Labels
area:frontend Everything frontend related area:player Paella and its integration in Tobira kind:new-feature A new feature needs:external-input We need some input from admins, users, ...
Milestone

Comments

@LukasKalbertodt
Copy link
Member

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:

  • Tobira could add additional "events" to the tracking data, like what page was visited when, how the search is used, ... and much more. I'm sure people are also interested in that, and not only the actual player interactions.
  • It was once requested that Tobira should show some basic statistical data (like views or watch time), at least for the owner of the video. To do that, Tobira has to collect that data internally. We don't want to load that data from Matomo as that would make the setup a lot more complex and brittle.
  • If we should ever switch the player, the data is not collected anymore by the Paella plugin.

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

  • Collecting the exact same player data from multiple places (Opencast itself, LMS, Tobira) combined into one Matomo instance might be useful. Tobira would probably not offer the exact same data (?).
  • It's simpler than adding built-in support.

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 LukasKalbertodt added area:frontend Everything frontend related kind:new-feature A new feature area:player Paella and its integration in Tobira needs:external-input We need some input from admins, users, ... labels Dec 18, 2023
@LukasKalbertodt
Copy link
Member Author

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

image

@LukasKalbertodt
Copy link
Member Author

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.

@LukasKalbertodt LukasKalbertodt added this to the v2.5 milestone Dec 20, 2023
@oas777
Copy link
Collaborator

oas777 commented Jan 11, 2024

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

@LukasKalbertodt LukasKalbertodt self-assigned this Feb 1, 2024
owi92 added a commit that referenced this issue Feb 22, 2024
This add the ability to configure Paella to send statistical data to a
Matomo instance. Closes #1038

There is additional support planned, with Tobira sending events to
Matomo as well. But this is not part of this PR.

See the added docs and commit messages for more information.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:frontend Everything frontend related area:player Paella and its integration in Tobira kind:new-feature A new feature needs:external-input We need some input from admins, users, ...
Projects
Status: Done ✔️
Development

Successfully merging a pull request may close this issue.

2 participants