make sure you have created a GA4 property in your Google Analytics account, and have the GA4 tracking code installed on your website using Google Tag Manager.
To track the meeting iFrame as an event, you can use the dataLayer to send an event when the meeting is started or ended. Here’s an example of how you can do this:
Add the following code to your website’s HTML before the Google Tag Manager code:
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
</script>
Create a custom event in Google Tag Manager for the meeting iFrame. Go to “Tags” > “New” > “Tag Configuration” > “Google Analytics: GA4 Event”.
In the “Triggering” section, create a trigger for the custom event. Go to “Triggers” > “New” > “Trigger Configuration” > “Custom Event”. Set the trigger to fire when the event equals “meeting_started” or “meeting_ended”.
Add the following code to your website’s JavaScript where the meeting iFrame is started or ended:
<script>
window.dataLayer.push({
'event': 'meeting_started' // or 'meeting_ended'
});
</script>
Make sure to replace “meeting_started” and “meeting_ended” with your own event names.
Once you have implemented this code, test it by starting and ending a meeting and checking the Realtime Events report in Google Analytics. You should see the custom event being tracked as “Meeting Started” or “Meeting Ended” in GA4.