mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 08:30:12 +01:00
🚨
This commit is contained in:
parent
20c338399d
commit
36f2d68e89
7 changed files with 42 additions and 49 deletions
|
|
@ -161,24 +161,31 @@ export const onGetConfig = (isStart: boolean) => {
|
|||
mountHelp();
|
||||
}
|
||||
|
||||
try {
|
||||
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();
|
||||
if (window.siyuan.config.system.googleAnalytics) {
|
||||
try {
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
// @ts-ignore
|
||||
window.gtag = () => {window.dataLayer.push(arguments)};
|
||||
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