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:
Timo authored and GitHub committed 2022-12-19 12:16:59 +01:00
1 parent b60a92112f
commit e3aa810230
7 files changed
+143 -51

No files matched your search

+5
View File
@@ -75,6 +75,10 @@ export interface UrlParams {
* The factor by which to scale the interface's font size.
*/
fontScale: number | null;
/**
* The Posthog analytics ID. It is only available if the user has given consent for sharing telemetry in element web.
*/
analyticsID: string | null;
}
/**
@@ -130,6 +134,7 @@ export const getUrlParams = (
lang: getParam("lang"),
fonts: getAllParams("font"),
fontScale: Number.isNaN(fontScale) ? null : fontScale,
analyticsID: getParam("analyticsID"),
};
};