mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-28 18:00:15 +01:00
🔥 Completely remove Google Analytics https://github.com/siyuan-note/siyuan/issues/15096
This commit is contained in:
parent
3631b729ad
commit
3319ffbb18
28 changed files with 91 additions and 9172 deletions
|
|
@ -169,49 +169,6 @@ export const initAssets = () => {
|
|||
});
|
||||
};
|
||||
|
||||
export const addGA = () => {
|
||||
if (!window.siyuan.config.system.disableGoogleAnalytics) {
|
||||
addScript("https://www.googletagmanager.com/gtag/js?id=G-L7WEXVQCR9", "gaScript");
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
/*eslint-disable */
|
||||
const gtag = function (...args: any[]) {
|
||||
window.dataLayer.push(arguments);
|
||||
};
|
||||
/*eslint-enable */
|
||||
gtag("js", new Date());
|
||||
gtag("config", "G-L7WEXVQCR9", {send_page_view: false});
|
||||
const para = {
|
||||
version: Constants.SIYUAN_VERSION,
|
||||
container: window.siyuan.config.system.container,
|
||||
os: window.siyuan.config.system.os,
|
||||
osPlatform: window.siyuan.config.system.osPlatform,
|
||||
isLoggedIn: false,
|
||||
subscriptionStatus: -1,
|
||||
subscriptionPlan: -1,
|
||||
subscriptionType: -1,
|
||||
oneTimePayStatus: -1,
|
||||
syncEnabled: false,
|
||||
syncProvider: -1,
|
||||
cTreeCount: window.siyuan.config.stat.cTreeCount,
|
||||
cBlockCount: window.siyuan.config.stat.cBlockCount,
|
||||
cDataSize: window.siyuan.config.stat.cDataSize,
|
||||
cAssetsSize: window.siyuan.config.stat.cAssetsSize,
|
||||
};
|
||||
if (window.siyuan.user) {
|
||||
para.isLoggedIn = true;
|
||||
para.subscriptionStatus = window.siyuan.user.userSiYuanSubscriptionStatus;
|
||||
para.subscriptionPlan = window.siyuan.user.userSiYuanSubscriptionPlan;
|
||||
para.subscriptionType = window.siyuan.user.userSiYuanSubscriptionType;
|
||||
para.oneTimePayStatus = window.siyuan.user.userSiYuanOneTimePayStatus;
|
||||
}
|
||||
if (window.siyuan.config.sync) {
|
||||
para.syncEnabled = window.siyuan.config.sync.enabled;
|
||||
para.syncProvider = window.siyuan.config.sync.provider;
|
||||
}
|
||||
gtag("event", Constants.ANALYTICS_EVT_ON_GET_CONFIG, para);
|
||||
}
|
||||
};
|
||||
|
||||
export const setInlineStyle = async (set = true) => {
|
||||
const height = Math.floor(window.siyuan.config.editor.fontSize * 1.625);
|
||||
let style;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue