IFrame API and google analytics

Hi everyone,
I’m currently using a self hosted Jitsi Meet environment and it works great. However, it would seems that Google Analytics is not sent when connected through the IFrame API.

When connecting live to it (via the URI) it seems to work sometimes but not everytime.
Anyone knows why this is happening ?
Am I missing anything ?

I also tried sending the analytics config through the configOverwrite but it did not work either.

        analytics: {
            // The Google Analytics Tracking ID:
            googleAnalyticsTrackingId: 'UA-XXXXXXXXX-XX',
            // Array of script URLs to load as lib-jitsi-meet "analytics handlers".
            scriptUrls: [
                  "libs/analytics-ga.min.js", // google-analytics
            ],
        },

I don’t see any relevant errors on the console neither in jitsi logs.

Thanks to all

Okay, I think I solved it.
The thing is that I call the IFrame on a different domain and since google change its policies, when creating the “ga” component in libs/analytics-ga.js, instead of "auto" you must put {'cookieFlags': 'SameSite=None;Secure'}

Dear, should you have done something else? follow these steps but I still do not see data in google analytics

Hey there,

can you see the modified file in your dev console ?
Have you configured google analytics in you config.js file ?

Can you send both these files to make sure everything is alright ?

Regards,

Hey there,

I have modified the file that is in this path:

/etc/jitsi/meet/mymeet.mydomain.cl-config.js

the modified piece of code (just for security I changed some numbers of the track-id I’m showing):

    // The Google Analytics Tracking ID:
    googleAnalyticsTrackingId: 'UA-179386666-1'

    // Matomo configuration:
    // matomoEndpoint: 'https://your-matomo-endpoint/',
    // matomoSiteID: '42',

    // The Amplitude APP Key:
    // amplitudeAPPKey: '<APP_KEY>'

    // Configuration for the rtcstats server:
    // By enabling rtcstats server every time a conference is joined the rtcstats
    // module connects to the provided rtcstatsEndpoint and sends statistics regarding
    // PeerConnection states along with getStats metrics polled at the specified
    // interval.
    // rtcstatsEnabled: true,

    // In order to enable rtcstats one needs to provide a endpoint url.
    // rtcstatsEndpoint: wss://rtcstats-server-pilot.jitsi.net/,

    // The interval at which rtcstats will poll getStats, defaults to 1000ms.
    // If the value is set to 0 getStats won't be polled and the rtcstats client
    // will only send data related to RTCPeerConnection events.
    // rtcstatsPolIInterval: 1000

    // Array of script URLs to load as lib-jitsi-meet "analytics handlers".
    //scriptURLs: [
    //     "libs/analytics-ga.min.js", // google-analytics
    //      "https://example.com/my-custom-analytics.js"
    // ],
},

and in the other file, located in:
/usr/share/jitsi-meet/libs/analytics-ga.js

modify the following:

/**
* Google Analytics
* TODO: Keep this local, there’s no need to add it to window.
/
(function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1
new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentN>
})(window,document,‘script’,’//www.google-analytics.com/analytics.js’,'ga’);
ga(‘create’, options.googleAnalyticsTrackingId,{‘cookieFlags’: ‘SameSite=None;Secure’});
ga(‘send’, ‘pageview’);

    /* eslint-enable */

Yep, that’s its, you need to modify the loaded script in you configuration file

scriptURLs: [
     "libs/analytics-ga.js", // google-analytics
 ],

if you do not change this, it will keep loading the min file which is not modified.

Let me know if that helps

thank you very much for your help.

the configuration file is this?
/etc/jitsi/meet/mymeet.mydomain.cl-config.js

Yes it is this one, do not forget to put the comma (,) after the “googleAnalyticsTrackingId”, or else you might have errors when using jitsi

thank you very much.
Indeed I was missing (,) but I put it and I still do not get data

:pensive:

Did you uncomment and changed these 3 lines ?
Can you actually make a conference with yourself (in two seperate tabs) ?

Yes, I have uncommented the 3 lines you indicate.
And a conference with myself also works for me, in two independent tabs.