You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Manually track page views
This commit is contained in:
@@ -28,6 +28,13 @@ export interface IRoomEvent extends IPseudonymousEvent {
|
||||
hashedRoomId: string
|
||||
}
|
||||
|
||||
interface IPageView extends IAnonymousEvent {
|
||||
eventName: "$pageview",
|
||||
properties: {
|
||||
durationMs?: number
|
||||
}
|
||||
}
|
||||
|
||||
export interface IWelcomeScreenLoad extends IAnonymousEvent {
|
||||
key: "welcome_screen_load",
|
||||
}
|
||||
@@ -205,6 +212,12 @@ export class PosthogAnalytics {
|
||||
};
|
||||
await this.trackPseudonymousEvent(eventName, updatedProperties);
|
||||
}
|
||||
|
||||
public async trackPageView(durationMs: number) {
|
||||
await this.trackAnonymousEvent<IPageView>("$pageview", {
|
||||
durationMs,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export function getAnalytics(): PosthogAnalytics {
|
||||
|
||||
Reference in New Issue
Block a user