Browse Source

add google analytics code

guoziyun 1 year ago
parent
commit
6bc590d80c
12 changed files with 155 additions and 40 deletions
  1. 9 0
      views/album.ejs
  2. 17 7
      views/albums.ejs
  3. 9 0
      views/category.ejs
  4. 9 0
      views/designer.ejs
  5. 25 9
      views/designers.ejs
  6. 9 0
      views/detail.ejs
  7. 23 14
      views/index.ejs
  8. 18 9
      views/info.ejs
  9. 9 1
      views/play.ejs
  10. 9 0
      views/search.ejs
  11. 9 0
      views/special.ejs
  12. 9 0
      views/tag.ejs

+ 9 - 0
views/album.ejs

@@ -6,6 +6,15 @@
     <link rel="stylesheet" href="/stylesheets/styles.css">
     <link rel="stylesheet" href="/stylesheets/album.css">
 </head>
+<!-- Google tag (gtag.js) -->
+<script async src="https://www.googletagmanager.com/gtag/js?id=G-JBGGVGLHTP"></script>
+<script>
+  window.dataLayer = window.dataLayer || [];
+  function gtag() { dataLayer.push(arguments); }
+  gtag('js', new Date());
+
+  gtag('config', 'G-JBGGVGLHTP');
+</script>
 
 <body>
   <%- include('header') %>

+ 17 - 7
views/albums.ejs

@@ -4,15 +4,24 @@
 <head>
   <%- include('common-meta') %>
 
-  <link rel="alternate" href="https://art.pcoloring.com/en/albums" hrefLang="en" />
-  <link rel="alternate" href="https://art.pcoloring.com/zh/albums" hrefLang="zh" />
-  <link rel="alternate" href="https://art.pcoloring.com/es/albums" hrefLang="es" />
-  <link rel="alternate" href="https://art.pcoloring.com/pt/albums" hrefLang="pt" />
-  <link rel="alternate" href="https://art.pcoloring.com/ja/albums" hrefLang="ja" />
+    <link rel="alternate" href="https://art.pcoloring.com/en/albums" hrefLang="en" />
+    <link rel="alternate" href="https://art.pcoloring.com/zh/albums" hrefLang="zh" />
+    <link rel="alternate" href="https://art.pcoloring.com/es/albums" hrefLang="es" />
+    <link rel="alternate" href="https://art.pcoloring.com/pt/albums" hrefLang="pt" />
+    <link rel="alternate" href="https://art.pcoloring.com/ja/albums" hrefLang="ja" />
 
-  <link rel="stylesheet" href="/stylesheets/styles.css">
+    <link rel="stylesheet" href="/stylesheets/styles.css">
 
 </head>
+<!-- Google tag (gtag.js) -->
+<script async src="https://www.googletagmanager.com/gtag/js?id=G-JBGGVGLHTP"></script>
+<script>
+  window.dataLayer = window.dataLayer || [];
+  function gtag() { dataLayer.push(arguments); }
+  gtag('js', new Date());
+
+  gtag('config', 'G-JBGGVGLHTP');
+</script>
 
 <body>
   <%- include('header') %>
@@ -25,7 +34,8 @@
       <div class="album-grid">
         <% data.forEach(album=> { %>
           <div class="album-grid-card">
-            <a href="/<%= lang %>/album/<%= album._id %>"><img src="<%= album.cover %>" alt="<%= album.title %> | <%= translate.coloringPageAlbum[lang] %>"></a>
+            <a href="/<%= lang %>/album/<%= album._id %>"><img src="<%= album.cover %>"
+                alt="<%= album.title %> | <%= translate.coloringPageAlbum[lang] %>"></a>
             <div style="padding: 0px 0px 4px 4px">
               <%= album.title %>
             </div>

+ 9 - 0
views/category.ejs

@@ -13,6 +13,15 @@
     <link rel="stylesheet" href="/stylesheets/styles.css">
     <link rel="stylesheet" href="/stylesheets/category.css">
 </head>
+<!-- Google tag (gtag.js) -->
+<script async src="https://www.googletagmanager.com/gtag/js?id=G-JBGGVGLHTP"></script>
+<script>
+  window.dataLayer = window.dataLayer || [];
+  function gtag() { dataLayer.push(arguments); }
+  gtag('js', new Date());
+
+  gtag('config', 'G-JBGGVGLHTP');
+</script>
 
 <body>
   <%- include('header') %>

+ 9 - 0
views/designer.ejs

@@ -6,6 +6,15 @@
     <link rel="stylesheet" href="/stylesheets/styles.css">
     <link rel="stylesheet" href="/stylesheets/designer.css">
 </head>
+<!-- Google tag (gtag.js) -->
+<script async src="https://www.googletagmanager.com/gtag/js?id=G-JBGGVGLHTP"></script>
+<script>
+  window.dataLayer = window.dataLayer || [];
+  function gtag() { dataLayer.push(arguments); }
+  gtag('js', new Date());
+
+  gtag('config', 'G-JBGGVGLHTP');
+</script>
 
 <body>
   <%- include('header') %>

+ 25 - 9
views/designers.ejs

@@ -4,15 +4,24 @@
 <head>
   <%- include('common-meta') %>
 
-  <link rel="alternate" href="https://art.pcoloring.com/en/designers" hrefLang="en" />
-  <link rel="alternate" href="https://art.pcoloring.com/zh/designers" hrefLang="zh" />
-  <link rel="alternate" href="https://art.pcoloring.com/es/designers" hrefLang="es" />
-  <link rel="alternate" href="https://art.pcoloring.com/pt/designers" hrefLang="pt" />
-  <link rel="alternate" href="https://art.pcoloring.com/ja/designers" hrefLang="ja" />
+    <link rel="alternate" href="https://art.pcoloring.com/en/designers" hrefLang="en" />
+    <link rel="alternate" href="https://art.pcoloring.com/zh/designers" hrefLang="zh" />
+    <link rel="alternate" href="https://art.pcoloring.com/es/designers" hrefLang="es" />
+    <link rel="alternate" href="https://art.pcoloring.com/pt/designers" hrefLang="pt" />
+    <link rel="alternate" href="https://art.pcoloring.com/ja/designers" hrefLang="ja" />
 
-  <link rel="stylesheet" href="/stylesheets/designer.css">
+    <link rel="stylesheet" href="/stylesheets/designer.css">
 
 </head>
+<!-- Google tag (gtag.js) -->
+<script async src="https://www.googletagmanager.com/gtag/js?id=G-JBGGVGLHTP"></script>
+<script>
+  window.dataLayer = window.dataLayer || [];
+  function gtag() { dataLayer.push(arguments); }
+  gtag('js', new Date());
+
+  gtag('config', 'G-JBGGVGLHTP');
+</script>
 
 <body>
   <%- include('header') %>
@@ -24,10 +33,17 @@
     <div class="container">
       <% data.forEach(item=> { %>
         <div class="card">
-          <a href="/<%= lang %>/designer/<%= item._id %>"><img src="<%= item.avatar %>" alt="<%= item.username %> | <%= translate.coloringPageDesigner[lang]%>"></a>
+          <a href="/<%= lang %>/designer/<%= item._id %>"><img src="<%= item.avatar %>"
+              alt="<%= item.username %> | <%= translate.coloringPageDesigner[lang]%>"></a>
           <div class="info">
-            <p><strong><%= item.username %></strong></p>
-            <p><%= translate.worksCount[lang] %>: <strong><%= item.count %></strong></p>
+            <p><strong>
+                <%= item.username %>
+              </strong></p>
+            <p>
+              <%= translate.worksCount[lang] %>: <strong>
+                  <%= item.count %>
+                </strong>
+            </p>
           </div>
         </div>
         <% }); %>

+ 9 - 0
views/detail.ejs

@@ -13,6 +13,15 @@
         <link rel="stylesheet" href="/stylesheets/styles.css">
         <link rel="stylesheet" href="/stylesheets/detail.css">
 </head>
+<!-- Google tag (gtag.js) -->
+<script async src="https://www.googletagmanager.com/gtag/js?id=G-JBGGVGLHTP"></script>
+<script>
+    window.dataLayer = window.dataLayer || [];
+    function gtag() { dataLayer.push(arguments); }
+    gtag('js', new Date());
+
+    gtag('config', 'G-JBGGVGLHTP');
+</script>
 
 <body>
     <%- include('header') %>

+ 23 - 14
views/index.ejs

@@ -3,25 +3,34 @@
 
 <head>
   <%- include('common-meta') %>
-  <link rel="alternate" href="https://art.pcoloring.com/en" hrefLang="en" />
-  <link rel="alternate" href="https://art.pcoloring.com/zh" hrefLang="zh" />
-  <link rel="alternate" href="https://art.pcoloring.com/es" hrefLang="es" />
-  <link rel="alternate" href="https://art.pcoloring.com/pt" hrefLang="pt" />
-  <link rel="alternate" href="https://art.pcoloring.com/ja" hrefLang="ja" />
+    <link rel="alternate" href="https://art.pcoloring.com/en" hrefLang="en" />
+    <link rel="alternate" href="https://art.pcoloring.com/zh" hrefLang="zh" />
+    <link rel="alternate" href="https://art.pcoloring.com/es" hrefLang="es" />
+    <link rel="alternate" href="https://art.pcoloring.com/pt" hrefLang="pt" />
+    <link rel="alternate" href="https://art.pcoloring.com/ja" hrefLang="ja" />
 
-  <link rel="stylesheet" href="/stylesheets/styles.css">
+    <link rel="stylesheet" href="/stylesheets/styles.css">
 </head>
+<!-- Google tag (gtag.js) -->
+<script async src="https://www.googletagmanager.com/gtag/js?id=G-JBGGVGLHTP"></script>
+<script>
+  window.dataLayer = window.dataLayer || [];
+  function gtag() { dataLayer.push(arguments); }
+  gtag('js', new Date());
+
+  gtag('config', 'G-JBGGVGLHTP');
+</script>
 
 <body>
   <%- include('header') %>
-  <%- include('banner') %>
-  <%- include('latest-section') %>
-  <%- include('album-section') %>
-  <%- include('hot-section') %>
-  <%- include('designer-section') %>
-  <%- include('special-section') %>
-  <%- include('footer') %>
-  <div style="height: 50px;"></div>
+    <%- include('banner') %>
+      <%- include('latest-section') %>
+        <%- include('album-section') %>
+          <%- include('hot-section') %>
+            <%- include('designer-section') %>
+              <%- include('special-section') %>
+                <%- include('footer') %>
+                  <div style="height: 50px;"></div>
 </body>
 
 </html>

+ 18 - 9
views/info.ejs

@@ -4,18 +4,27 @@
 <head>
   <%- include('common-meta') %>
 
-  <link rel="alternate" href="https://art.pcoloring.com/en/info" hrefLang="en" />
-  <link rel="alternate" href="https://art.pcoloring.com/zh/info" hrefLang="zh" />
-  <link rel="alternate" href="https://art.pcoloring.com/es/info" hrefLang="es" />
-  <link rel="alternate" href="https://art.pcoloring.com/pt/info" hrefLang="pt" />
-  <link rel="alternate" href="https://art.pcoloring.com/ja/info" hrefLang="ja" />
+    <link rel="alternate" href="https://art.pcoloring.com/en/info" hrefLang="en" />
+    <link rel="alternate" href="https://art.pcoloring.com/zh/info" hrefLang="zh" />
+    <link rel="alternate" href="https://art.pcoloring.com/es/info" hrefLang="es" />
+    <link rel="alternate" href="https://art.pcoloring.com/pt/info" hrefLang="pt" />
+    <link rel="alternate" href="https://art.pcoloring.com/ja/info" hrefLang="ja" />
 
-  <link rel="stylesheet" href="/stylesheets/styles.css">
-  <link rel="stylesheet" href="/stylesheets/info.css">
+    <link rel="stylesheet" href="/stylesheets/styles.css">
+    <link rel="stylesheet" href="/stylesheets/info.css">
+
+    <script src="https://cdnjs.cloudflare.com/ajax/libs/bodymovin/5.5.8/lottie.min.js"></script>
 
-  <script src="https://cdnjs.cloudflare.com/ajax/libs/bodymovin/5.5.8/lottie.min.js"></script>
-  
 </head>
+<!-- Google tag (gtag.js) -->
+<script async src="https://www.googletagmanager.com/gtag/js?id=G-JBGGVGLHTP"></script>
+<script>
+  window.dataLayer = window.dataLayer || [];
+  function gtag() { dataLayer.push(arguments); }
+  gtag('js', new Date());
+
+  gtag('config', 'G-JBGGVGLHTP');
+</script>
 
 <body>
   <section id="about" class="full-screen about-container">

+ 9 - 1
views/play.ejs

@@ -21,7 +21,15 @@
   <link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-B5Qt9EMX.js">
   <link rel="stylesheet" crossorigin href="/assets/main-DGuEntp1.css">
 </head>
-
+<!-- Google tag (gtag.js) -->
+<script async src="https://www.googletagmanager.com/gtag/js?id=G-JBGGVGLHTP"></script>
+<script>
+  window.dataLayer = window.dataLayer || [];
+  function gtag() { dataLayer.push(arguments); }
+  gtag('js', new Date());
+
+  gtag('config', 'G-JBGGVGLHTP');
+</script>
 
 <body>
   <div id="container">

+ 9 - 0
views/search.ejs

@@ -13,6 +13,15 @@
     <link rel="stylesheet" href="/stylesheets/styles.css">
 
 </head>
+<!-- Google tag (gtag.js) -->
+<script async src="https://www.googletagmanager.com/gtag/js?id=G-JBGGVGLHTP"></script>
+<script>
+  window.dataLayer = window.dataLayer || [];
+  function gtag() { dataLayer.push(arguments); }
+  gtag('js', new Date());
+
+  gtag('config', 'G-JBGGVGLHTP');
+</script>
 
 <body>
   <%- include('header') %>

+ 9 - 0
views/special.ejs

@@ -13,6 +13,15 @@
     <link rel="stylesheet" href="/stylesheets/styles.css">
 
 </head>
+<!-- Google tag (gtag.js) -->
+<script async src="https://www.googletagmanager.com/gtag/js?id=G-JBGGVGLHTP"></script>
+<script>
+  window.dataLayer = window.dataLayer || [];
+  function gtag() { dataLayer.push(arguments); }
+  gtag('js', new Date());
+
+  gtag('config', 'G-JBGGVGLHTP');
+</script>
 
 <body>
   <%- include('header') %>

+ 9 - 0
views/tag.ejs

@@ -13,6 +13,15 @@
     <link rel="stylesheet" href="/stylesheets/styles.css">
     <link rel="stylesheet" href="/stylesheets/tag.css">
 </head>
+<!-- Google tag (gtag.js) -->
+<script async src="https://www.googletagmanager.com/gtag/js?id=G-JBGGVGLHTP"></script>
+<script>
+  window.dataLayer = window.dataLayer || [];
+  function gtag() { dataLayer.push(arguments); }
+  gtag('js', new Date());
+
+  gtag('config', 'G-JBGGVGLHTP');
+</script>
 
 <body>
   <%- include('header') %>