Browse Source

:rotating_light:

Vanessa 2 years ago
parent
commit
710e703867
2 changed files with 4 additions and 3 deletions
  1. 1 1
      app/src/types/index.d.ts
  2. 3 2
      app/src/util/onGetConfig.ts

+ 1 - 1
app/src/types/index.d.ts

@@ -26,7 +26,7 @@ type TBazaarType = "templates" | "icons" | "widgets" | "themes"
 declare module "blueimp-md5"
 declare module "blueimp-md5"
 
 
 interface Window {
 interface Window {
-    dataLayer: string[]
+    dataLayer: any[]
     siyuan: ISiyuan
     siyuan: ISiyuan
     webkit: any
     webkit: any
 
 

+ 3 - 2
app/src/util/onGetConfig.ts

@@ -164,8 +164,9 @@ export const onGetConfig = (isStart: boolean) => {
     if (!window.siyuan.config.system.disableGoogleAnalytics) {
     if (!window.siyuan.config.system.disableGoogleAnalytics) {
         try {
         try {
             window.dataLayer = window.dataLayer || [];
             window.dataLayer = window.dataLayer || [];
-            // @ts-ignore
-            window.gtag = () => {window.dataLayer.push(arguments)};
+            window.gtag = function (...args) {
+                window.dataLayer.push(args);
+            };
             window.gtag("js", new Date());
             window.gtag("js", new Date());
             window.gtag("config", "G-L7WEXVQCR9");
             window.gtag("config", "G-L7WEXVQCR9");
             const para = {
             const para = {