-
Notifications
You must be signed in to change notification settings - Fork 1
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
Modular Web Analytics #148
Comments
@bmtcril, some food for thought. Might become an ADR or even an OEP. I no longer think our original approach is the best idea, but it's listed as the first possible solution, above. The second one is probably the best we'd be able to do before Modular MFE Domains kick in. It looks reasonably self-contained, so we should be able to make a funded project out of it. Definitely not for Olive, though. And we'd need to get things rolling pretty quickly if we want to get ready by Palm - which we pretty much have to if we want to continue supporting Google Analytics in any fashion. |
Forum thread to go with this: https://discuss.openedx.org/t/google-universal-analytics-google-analytics-4-and-all-mfes/8749 |
Thanks for writing all of this up @arbrandes ! I agree the second option will get us out of the current problem, but there are so many players in the analytics space that operators might want to integrate with I don't think it will scale for us in the long term. I'll definitely keep an eye on the MFE Domains planning to see what we can do to keep this use case in mind during the process, but in the meantime I'd be ok with implementing the Segment-style integration for GA to get us through. |
@bmtcril, I believe all PRs are merged, now. Can you check and see if I missed anything? |
This looks good to me, let me just double check with RG that there's nothing outstanding and we can close this beast! Thanks for the heroic efforts. |
Raccoon Gang believes this is done as well and has sent the close out report. Closing! |
Motivation
To begin, Google Universal Analytics will stop working on July 1, 2023, and it's all the current snippet in the LMS supports. We'll either need to deprecate/remove this by then, or move to support Google Analytics 4 (as has been requested in the forum).
In parallel, we need to investigate the possibility of supporting GA in MFEs (something that has also been requested explicitly).
Possible solutions
Loading arbitrary javascript
One could allow operators to define custom external scripts to be loaded in the head of server-side rendered pages or MFEs; the operator would be able to load any arbitrary analytics engines that way.
OEP-15 proposed a way to do this for entires courses; see its implementation. A similar thing could be done for both LMS server-side pages and MFEs. The latter, in particular, could be served a list of custom JS (maybe even snippets) via runtime configuration, which in turn supports site configuration, thus allowing for per-domain analytics configuration.
However, an attempt to bring this into the Learning MFE was rejected at the time for good reasons. Loading generic scripts can throw a wrench into SPA react apps.
Questions:
<head/>
of an MFE without explicitreact-router
integration? Would page changes be detected properly?Explicit support for analytics engines in MFEs
frontend-platform
already has explicit support for Segment in what looks to be a modular analytics service framework.frontend-app-learning
, for instance, tracks clicks using it.It should be possible to implement GA and others using this method. However, each MFE would have to be modified to support the desired tracking.
Support for analytics engines in a containing SPA
Once Modular MFE Domains are a thing, it would be relatively simple to support modular analytics engines at the containing SPA level. Because routing would be done for MFEs at this level, page tracking need not be done in an MFE itself. Event tracking would still have to be done by the MFE, of course, but all MFEs would use the same instance of the analytics service interface.
Foundational
PRs against master
PRs against Palm
PRs agains Olive
The text was updated successfully, but these errors were encountered: