显示Engine版本号

This commit is contained in:
xu_yanfeng
2025-01-12 17:57:02 +08:00
parent aba21c6f89
commit 8bff11cc10
10 changed files with 91 additions and 27 deletions

View File

@@ -14,7 +14,13 @@ export class GoogleAnalytics {
}
return clientId;
}
private isChromeEnv() {
return !!chrome?.storage?.local?.get;
}
public async fireEventWithParam(name: GA_EventName, param: string) {
if (!this.isChromeEnv()) {
return;
}
const time = Date.now();
const id = await this.getOrCreateSessionId();
fetch(`${GA_ENDPOINT}?measurement_id=${MEASUREMENT_ID}&api_secret=${API_SECRET}`, {
@@ -35,6 +41,9 @@ export class GoogleAnalytics {
});
}
public async fireEvent(name: string) {
if (!this.isChromeEnv()) {
return;
}
const time = Date.now();
const id = await this.getOrCreateSessionId();
fetch(`${GA_ENDPOINT}?measurement_id=${MEASUREMENT_ID}&api_secret=${API_SECRET}`, {

View File

@@ -77,6 +77,7 @@ export enum GA_EventName {
MouseMenu = "mouse_menu",
Hierarchy = "hierarchy",
Inspector = "Inspector",
EngineVersion = "engine_version",
}
export enum GA_Button {
Github = "github",