This commit is contained in:
xu_yanfeng 2025-02-07 14:23:05 +08:00
parent e331c51dc3
commit 039fc604f5
3 changed files with 7 additions and 0 deletions

View File

@ -79,6 +79,7 @@ export enum GA_EventName {
Inspector = "Inspector",
EngineVersion = "engine_version",
AppVersion = "app_version",
GameUrl = "game_url",
GamePlayer = "game_player",
GamePause = "game_pause",
GameStep = "game_step",

View File

@ -29,4 +29,9 @@ export class InjectEvent {
const event = new CustomEvent(DocumentEvent.GoogleAnalytics, { detail });
document.dispatchEvent(event);
}
sendUrl(url: string) {
const detail = { event: GA_EventName.GameUrl, params: url } as GoogleAnalyticsData;
const event = new CustomEvent(DocumentEvent.GoogleAnalytics, { detail });
document.dispatchEvent(event);
}
}

View File

@ -214,6 +214,7 @@ export class Inspector extends InjectEvent {
if (version) {
this.hasUploadEngineVersion = true;
this.sendEngineVersion(version);
this.sendUrl(window.location.href);
}
}
forEachNode(cb: (node: any) => void) {