Kaynağa Gözat

Swap Google Analytics for Google Tag Manager

Ramona Plogmann 1 yıl önce
ebeveyn
işleme
463a37c684
1 değiştirilmiş dosya ile 14 ekleme ve 9 silme
  1. 14 9
      client/public/index.html

+ 14 - 9
client/public/index.html

@@ -1,6 +1,16 @@
 <!DOCTYPE html>
 <html lang="en" style="height: 100%">
   <head>
+    <script>
+      window.dataLayer = window.dataLayer || [];
+    </script>
+    <!-- Google Tag Manager -->
+    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
+              new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
+            j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
+            'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
+    })(window,document,'script','dataLayer','GTM-M87FCP4');</script>
+    <!-- End Google Tag Manager -->
     <meta charset="utf-8" />
 
     <title>Emilia</title>
@@ -81,16 +91,11 @@
     <link rel="apple-touch-startup-image" media="screen and (device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2) and (orientation: landscape)" href="%PUBLIC_URL%/10.2__iPad_landscape.png">
     <link rel="apple-touch-startup-image" media="screen and (device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2) and (orientation: portrait)" href="%PUBLIC_URL%/iPhone_11__iPhone_XR_portrait.png">
   </head>
-  <!-- Google tag (gtag.js) Google Analytics -->
-  <script async src="https://www.googletagmanager.com/gtag/js?id=G-Y9TRLLHGC0"></script>
-  <script>
-    window.dataLayer = window.dataLayer || [];
-    function gtag(){dataLayer.push(arguments);}
-    gtag('js', new Date());
-
-    gtag('config', 'G-Y9TRLLHGC0');
-  </script>
   <body style="margin: 0; height: 100%; overflow-x: hidden; background-color: #28793c">
+    <!-- Google Tag Manager (noscript) -->
+    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M87FCP4"
+                      height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
+    <!-- End Google Tag Manager (noscript) -->
     <div id="root" style="height: 100%"></div>
   </body>
 </html>