mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 08:30:12 +01:00
This commit is contained in:
parent
710e703867
commit
938f7d2944
1 changed files with 27 additions and 24 deletions
|
|
@ -30,6 +30,7 @@ import {showMessage} from "../dialog/message";
|
|||
import {replaceLocalPath} from "../editor/rename";
|
||||
import {editor} from "../config/editor";
|
||||
import {goBack, goForward} from "./backForward";
|
||||
import {addScript} from "../protyle/util/addScript";
|
||||
|
||||
const matchKeymap = (keymap: Record<string, IKeymapItem>, key1: "general" | "editor", key2?: "general" | "insert" | "heading" | "list" | "table") => {
|
||||
if (key1 === "general") {
|
||||
|
|
@ -162,31 +163,33 @@ export const onGetConfig = (isStart: boolean) => {
|
|||
}
|
||||
|
||||
if (!window.siyuan.config.system.disableGoogleAnalytics) {
|
||||
try {
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
window.gtag = function (...args) {
|
||||
window.dataLayer.push(args);
|
||||
};
|
||||
window.gtag("js", new Date());
|
||||
window.gtag("config", "G-L7WEXVQCR9");
|
||||
const para = {
|
||||
"version": Constants.SIYUAN_VERSION,
|
||||
"container": window.siyuan.config.system.container,
|
||||
"isLoggedIn": "false",
|
||||
"subscriptionStatus": "-1",
|
||||
"subscriptionPlan": "-1",
|
||||
"subscriptionType": "-1",
|
||||
};
|
||||
if (window.siyuan.user) {
|
||||
para.isLoggedIn = "true";
|
||||
para.subscriptionStatus = window.siyuan.user.userSiYuanSubscriptionStatus.toString();
|
||||
para.subscriptionPlan = window.siyuan.user.userSiYuanSubscriptionPlan.toString();
|
||||
para.subscriptionType = window.siyuan.user.userSiYuanSubscriptionType.toString();
|
||||
addScript("https://www.googletagmanager.com/gtag/js?id=G-L7WEXVQCR9", "gaScript").then(() => {
|
||||
try {
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
window.gtag = function (...args) {
|
||||
window.dataLayer.push(args);
|
||||
};
|
||||
window.gtag("js", new Date());
|
||||
window.gtag("config", "G-L7WEXVQCR9");
|
||||
const para = {
|
||||
"version": Constants.SIYUAN_VERSION,
|
||||
"container": window.siyuan.config.system.container,
|
||||
"isLoggedIn": "false",
|
||||
"subscriptionStatus": "-1",
|
||||
"subscriptionPlan": "-1",
|
||||
"subscriptionType": "-1",
|
||||
};
|
||||
if (window.siyuan.user) {
|
||||
para.isLoggedIn = "true";
|
||||
para.subscriptionStatus = window.siyuan.user.userSiYuanSubscriptionStatus.toString();
|
||||
para.subscriptionPlan = window.siyuan.user.userSiYuanSubscriptionPlan.toString();
|
||||
para.subscriptionType = window.siyuan.user.userSiYuanSubscriptionType.toString();
|
||||
}
|
||||
window.gtag("event", Constants.ANALYTICS_EVT_ON_GET_CONFIG, para);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
window.gtag("event", Constants.ANALYTICS_EVT_ON_GET_CONFIG, para);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue