Posthog widget embedding (#767)
* load analytics id from url in embedded mode Signed-off-by: Timo K <timok@element.io> * add start call in the widget code path Signed-off-by: Timo K <timok@element.io> * send group call id instead of call name Signed-off-by: Timo K <timok@element.io> * generate analyticsid based on account analyticsid This make it impossible to find users from the element web posthog instance in the element call instance * move registration type setup PosthogAnalytics.ts * Order identificaition and tracking. This fixes an issue that the widget version did not identify the user before sneding the first track event. Because start call is called right after app startup. Signed-off-by: Timo K <timok@element.io>
This commit is contained in:
@@ -142,6 +142,10 @@ export function GroupCallView({
|
||||
]);
|
||||
|
||||
await groupCall.enter();
|
||||
|
||||
PosthogAnalytics.instance.eventCallEnded.cacheStartCall(new Date());
|
||||
PosthogAnalytics.instance.eventCallStarted.track(groupCall.groupCallId);
|
||||
|
||||
await Promise.all([
|
||||
widget.api.setAlwaysOnScreen(true),
|
||||
widget.api.transport.reply(ev.detail, {}),
|
||||
@@ -159,6 +163,9 @@ export function GroupCallView({
|
||||
if (isEmbedded && !preload) {
|
||||
// In embedded mode, bypass the lobby and just enter the call straight away
|
||||
groupCall.enter();
|
||||
|
||||
PosthogAnalytics.instance.eventCallEnded.cacheStartCall(new Date());
|
||||
PosthogAnalytics.instance.eventCallStarted.track(groupCall.groupCallId);
|
||||
}
|
||||
}, [groupCall, isEmbedded, preload]);
|
||||
|
||||
@@ -178,7 +185,7 @@ export function GroupCallView({
|
||||
}
|
||||
|
||||
PosthogAnalytics.instance.eventCallEnded.track(
|
||||
groupCall.room.name,
|
||||
groupCall.groupCallId,
|
||||
participantCount
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user