Sfoglia il codice sorgente

chore: test register ga (#2202)

Joel 1 anno fa
parent
commit
bdc5e9ceb0
1 ha cambiato i file con 17 aggiunte e 1 eliminazioni
  1. 17 1
      web/app/components/base/ga/index.tsx

+ 17 - 1
web/app/components/base/ga/index.tsx

@@ -38,7 +38,23 @@ gtag('config', '${gaIdMaps[gaType]}');
         }}
       >
       </Script>
-
+      {gaType === GaType.admin && (
+        <>
+          <Script strategy="beforeInteractive" async src={'https://www.googletagmanager.com/gtag/js?id=AW-11217955271"}'}></Script>
+          <Script
+            id="ga-monitor-register"
+            dangerouslySetInnerHTML={{
+              __html: `
+window.dataLayer2 = window.dataLayer2 || [];
+function gtag(){dataLayer2.push(arguments);}
+gtag('js', new Date());
+gtag('config', 'AW-11217955271"');
+          `,
+            }}
+          >
+          </Script>
+        </>
+      )}
     </>
 
   )