How to add google analytics?

I want add google analytics 4 .
I config Django admin page https://lms.domain/admin/site_configuration/siteconfiguration/
and I get id from analytics.google.com making sure that the configuration is marked enabled and save config


{
    "GOOGLE_ANALYTICS_4_ID": "G-ZMXV6TSV3M",
    "MFE_CONFIG": {
        "GOOGLE_ANALYTICS_4_ID": "G-ZMXV6TSV3M"
    }
}


image example Configuring Google Analytics — Latest documentation
I restart lms. but not show JavaScript in header tag. How to fix it?

Hello choltha,
We developed an Analytics MFE “PANORAMA by Aulasneo” incorporating Quicksight,
which there are 2 versions, one online and another to incorporate into your LMS, you can see a demo at:

If you are interested we can help you contact us at the following emails:

esteban@aulasneo.com
andres@aulasneo.com

@choltha
You need to make a tutor plugin like this example.

Hi @choltha ,

I can try to help you out with this. Which version of Open edX are you using? Which page are you looking at to check the tag? Some micro-frontend pages will not have those tags enabled.

Assuming you are on a Palm or newer version of Open edX, in the web developer tools you should be able to see a network call to /api/mfe_config/v1. If things are configured correctly, when you look at the response to that call there should be your GA configuration. That is what the MFEs will use to determine whether to insert the script tags. We can debug further based on what you are seeing there!

@Anh_Vu_Nguy_n that’s one way to insert that configuration, but what they are doing should work also.

Hi Anh Vũ,
I’m new to this platform and getting the same problem, after spending a half hour figuring out how to contact you I still don’t find a way,
Would you mind share me your contact so that I can learn from you?

Thank you in advance, my email is: vo.thanh.danh.95.26@gmail.com
Danh Vo.

Hi @Danh_Vo, have you tried the method I suggested above?
What’s the openedx version you are using?
If you are new to the platform, I highly recommend you go through the official document and the forum if you encounter any troubles.
My email is anhvu.desu@gmail.com in case you want to contact me.

1 Like

Thank you @Anh_Vu_Nguy_n , How to install plugin step by step? I use tutor, version 14.0.4 (nutmeg)

Hi @BrianMesick I use open edx version 14.0.4 (nutmeg)

@choltha According to the official doc, I think your set up is currently correct. However, as @BrianMesick has mentioned, you need Tutor version 16.0.0 (Palm) or higher to make it work.
If you somehow can not upgrade to newer versions of Tutor, the only way that I can think of is you have to fork individual MFE and manually add Google Analytics V4 scripts to them. I don’t know if that is an easy thing to do in tutor v14.0.4 though.
Another way is to fork frontend-pfatform and follow the PR that add GA4. I am unsure if this works though, I’ve never tried it.
I recommend that you upgrade your instance to tutor v16.0.0.

2 Likes