소스 검색

GTM埋碼

mike 3 년 전
부모
커밋
3c372951bb
1개의 변경된 파일14개의 추가작업 그리고 1개의 파일을 삭제
  1. 14 1
      themes/hugo-lamp/layouts/_default/baseof.html

+ 14 - 1
themes/hugo-lamp/layouts/_default/baseof.html

@@ -9,6 +9,14 @@
     <!-- <script async custom-element="amp-youtube" src="https://cdn.ampproject.org/v0/amp-youtube-0.1.js"></script> -->
     <script async custom-element="amp-iframe" src="https://cdn.ampproject.org/v0/amp-iframe-0.1.js"></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-TTKNPPT');</script>
+    <!-- End Google Tag Manager -->
+
     <!-- Page Title -->
     <title>
       {{- block "title" . -}}
@@ -20,7 +28,12 @@
     {{ partial "head.html" . }}
   </head>
   <body style="background-color: #ffffff; color: #000000">
-    <!-- Google Tag Manager -->
+    <!-- Google Tag Manager (noscript) -->
+    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-TTKNPPT"
+      height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
+    <!-- End Google Tag Manager (noscript) -->
+
+    <!-- Google Tag Manager (FB)-->
     <amp-analytics config="https://www.googletagmanager.com/amp.json?id=GTM-W5PRWTW&gtm.url=https://bhouse.com.tw" data-credentials="include"></amp-analytics>
     
     <!-- Google Tag Manager (AccuHit) -->