Add posthog Telemetry (Anonymity Logic + call duration telemetry) (#658)
Co-authored-by: Timo K <timok@element.io> Co-authored-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
d5326ed9ee
commit
72503d0335
14 changed files with 574 additions and 7 deletions
|
|
@ -38,6 +38,7 @@ import {
|
|||
fallbackICEServerAllowed,
|
||||
} from "./matrix-utils";
|
||||
import { widget } from "./widget";
|
||||
import { PosthogAnalytics, RegistrationType } from "./PosthogAnalytics";
|
||||
import { translatedError } from "./TranslatedError";
|
||||
|
||||
declare global {
|
||||
|
|
@ -114,7 +115,9 @@ export const ClientProvider: FC<Props> = ({ children }) => {
|
|||
if (widget) {
|
||||
// We're inside a widget, so let's engage *matryoshka mode*
|
||||
logger.log("Using a matryoshka client");
|
||||
|
||||
PosthogAnalytics.instance.setRegistrationType(
|
||||
RegistrationType.Registered
|
||||
);
|
||||
return {
|
||||
client: await widget.client,
|
||||
isPasswordlessUser: false,
|
||||
|
|
@ -132,6 +135,11 @@ export const ClientProvider: FC<Props> = ({ children }) => {
|
|||
session;
|
||||
|
||||
try {
|
||||
PosthogAnalytics.instance.setRegistrationType(
|
||||
passwordlessUser
|
||||
? RegistrationType.Guest
|
||||
: RegistrationType.Registered
|
||||
);
|
||||
return {
|
||||
client: await initClient(
|
||||
{
|
||||
|
|
@ -279,6 +287,7 @@ export const ClientProvider: FC<Props> = ({ children }) => {
|
|||
error: undefined,
|
||||
});
|
||||
history.push("/");
|
||||
PosthogAnalytics.instance.setRegistrationType(RegistrationType.Guest);
|
||||
}, [history, client]);
|
||||
|
||||
const { t } = useTranslation();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue