From 421f9aa96320bfb085b5ec2e387b043fb6e96522 Mon Sep 17 00:00:00 2001
From: Tomas <tomasysh@gmail.com>
Date: 星期六, 23 七月 2022 09:37:03 +0800
Subject: [PATCH] add GTM module

---
 PAMapp/nuxt.config.js |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/PAMapp/nuxt.config.js b/PAMapp/nuxt.config.js
index 64cc92d..83ed9b6 100644
--- a/PAMapp/nuxt.config.js
+++ b/PAMapp/nuxt.config.js
@@ -60,7 +60,41 @@
 
   // Modules: https://go.nuxtjs.dev/config-modules
   modules: [
+    '@nuxtjs/gtm',
   ],
+  plugins: [
+    '~/plugins/gtm'
+   ],
+  // TODO: 蝵格�甇�蝣箇�� GTM CODE
+  gtm: {
+    enabled: true, /* see below */
+    debug: false,
+
+    id: 'GTM-XXXXXXX',
+    layer: 'dataLayer',
+    variables: {},
+
+    pageTracking: true,
+    pageViewEventName: 'nuxtRoute',
+
+    autoInit: true,
+    respectDoNotTrack: true,
+
+    scriptId: 'gtm-script',
+    scriptDefer: false,
+    scriptURL: 'https://www.googletagmanager.com/gtm.js',
+    crossOrigin: false,
+
+    noscript: true,
+    noscriptId: 'gtm-noscript',
+    noscriptURL: 'https://www.googletagmanager.com/ns.html'
+  },
+
+  publicRuntimeConfig: {
+    gtm: {
+      id: process.env.GOOGLE_TAG_MANAGER_ID
+    }
+  },
 
   // Build Configuration: https://go.nuxtjs.dev/config-build
   build: {

--
Gitblit v1.8.0