mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 08:30:12 +01:00
🎨 加入 Google Analytics https://github.com/siyuan-note/siyuan/issues/6369
This commit is contained in:
parent
2c608bf593
commit
41d882ddba
3 changed files with 20 additions and 2 deletions
|
|
@ -160,9 +160,23 @@ export const onGetConfig = (isStart: boolean) => {
|
|||
mountHelp();
|
||||
}
|
||||
|
||||
window.gtag("event", "config", {
|
||||
let para = {
|
||||
"version": Constants.SIYUAN_VERSION,
|
||||
});
|
||||
"isLoggedIn": "false",
|
||||
"subscriptionStatus": "-1",
|
||||
"subscriptionPlan": "-1",
|
||||
"subscriptionType": "-1",
|
||||
}
|
||||
if (window.siyuan.user) {
|
||||
para.isLoggedIn = "true";
|
||||
if (0 === window.siyuan.user.userSiYuanSubscriptionStatus) {
|
||||
console.log(window.siyuan.user)
|
||||
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);
|
||||
};
|
||||
|
||||
const initBar = () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue