My next question is analytics based, but not necessarily Open edX based.
Currently in lms/templates/main.html there is a code snippet allowing site operators to collect traffic through Google Universal Analytics.
Google Universal Analytics is going away on July 1, 2023.
Will the code snippet be updated to support Google Analytics 4?
And since we are now in a more Micro Frontend friendly architecture, will the code snippet be added to each MFE so that operators don’t have to fork each MFE in order to add it if they want to follow traffic through the Learning MFE for example?
I’ve been talking to @BrianMesick about this, and we think it’s important enough to warrant a new epic/discovery around it.
This is the draft description: Modular Web Analytics · Issue #148 · openedx/frontend-wg · GitHub. There’s precious little in there, yet, but it should be enough to get a conversation started. I don’t know if it’ll become an OEP, ADR, or just a PR somewhere, but whatever we do, if we want to continue supporting Google Analytics we need to do it by Palm.
Given the relative urgency, I think this is a good candidate for a funded contribution. I’ll have a talk internally to see if tCRIL would want to fund it ourselves.
Alternatively, if any core contributors want to pick this up to work using their monthly 20 hours, it would, of course, be awesome.
It’s worth noting that there are two Univeral Analytics flavors - regular and the enterprise scale 360. Regular is the one that @sambapete is referencing above, while 360 will live on until July 1 2024. It’s not clear to me currently what the community uptake is on 360, but that is what edx.org is using so they may not feel the same time pressure as other parts of the community. However, I’m sure they would like better coverage for MFEs so that conversation is ongoing.
I’m happy to continue the technical portion of this conversation over in the Issue that Adolfo created, but just wanted to get this bit of context out to the wider audience.
The cost of Google Analytics 360 starts out at $150,000 per year and billed at $12,500 a month. Costs can increase as well based on the size of the website. The cost also includes the full suite of tools in the Google Marketing Platform.
Thanks for explaining why this hasn’t been fixed. +1 as a person who’s just running a small site and would in no universe ever be able to afford $150k a year for google analytics! We really need Google Analytics 4 fixed before we lose all visibility!
After reading over this I noticed that our edx-platform main.html is coming into the frontend-app-learning sequential vertical <iframe/> elements.
This does not satisfy all the MFEs (Account, Profile, Gradebook, etc) or all routes in frontend-app-learning like Outline, Progress.
Looking into how Segment analytics is handled in the frontend-platform code below it makes sense to have a separate configuration for Google Analytics too.
# We problem need to add something like this for Google Analytics 4
import {
configure as GoogleAnalyticsService
} from './analytics';
configureAnalytics(GoogleAnalyticsService, {
config: getConfig(),
loggingService: getLoggingService(),
httpClient: getAuthenticatedHttpClient(),
});
# Then we'd need to implement the `GoogleAnalyticService` as a `AnalyticsService` with Google Analytics 4 in mind.
src/frontend-platform/src/analytics/GoogleAnalyticsService.js
Also, here is a npm package react-ga4 - npm (npmjs.com) for Google Analytics 4 that we could use when implementing the GoogleAnalyicsService component.
I realize that Segment can have a destination for Google Analytics 4 too and maybe this would circumvent any need to extend the frontend-platform analytics component. To configure Segment properly for Google Analytics deliver you’d need to setup the correct mappings for each event though. Also what happens if you want to just use Google Analytics and not Segment.
Let me know if I’m in the right understanding about how one would approach adding Google Analytics 4 into the MFEs by use of extending the analytic component in frontend-platform. Has any work been done to date on integrating Google Analytics 4 into the MFEs?
Not yet, but we put out a call for a funded contribution to fix the issue for Palm, and I believe we’ve selected a vendor, already. This means work should start soon.
Thanks @arbrandes for the response. We’ll keep check to see what happens with the Palm updates for this feature request. Is there any way that someone can keep us informed through this post once this is implemented?
I just wanted to confirm, I’m not able to test this as of today’s Olive, because it’s not “Olive.4”, correct?
(I did actually test it, via making the change from the admin interface as specified, and I just saw no updates to the page HTML. So I want to make sure the reason that’s true is because it’s just not actually in the current Olive release?)