fix: 修改谷歌分析代码

This commit is contained in:
spylecym 2024-08-13 11:51:47 +08:00 committed by gwokwong
parent 3915c065fe
commit dff22272b5
23 changed files with 112 additions and 30 deletions

View File

@ -11,6 +11,11 @@
<link rel="stylesheet" href="../css/common.css"> <link rel="stylesheet" href="../css/common.css">
<link rel="stylesheet" type="text/css" href="../css/rem.css"> <link rel="stylesheet" type="text/css" href="../css/rem.css">
<link rel="stylesheet" href="../css/about.css"> <link rel="stylesheet" href="../css/about.css">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-16660800396"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PE77P6491J"></script>
<script src="../js/googleAnalyze1.js"></script>
<script src="../js/googleAnalyze2.js"></script>
</head> </head>
<body> <body>
<div class="BulletBox"></div> <div class="BulletBox"></div>

View File

@ -9,6 +9,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="../img/favicon.ico"> <link rel="shortcut icon" href="../img/favicon.ico">
<link rel="stylesheet" href="../css/privacy.css"> <link rel="stylesheet" href="../css/privacy.css">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-16660800396"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PE77P6491J"></script>
<script src="../js/googleAnalyze1.js"></script>
<script src="../js/googleAnalyze2.js"></script>
</head> </head>
<body> <body>
<style> <style>

View File

@ -11,6 +11,11 @@
<link rel="stylesheet" href="../css/common.css"> <link rel="stylesheet" href="../css/common.css">
<link rel="stylesheet" type="text/css" href="../css/rem.css"> <link rel="stylesheet" type="text/css" href="../css/rem.css">
<link rel="stylesheet" href="../css/download.css"> <link rel="stylesheet" href="../css/download.css">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-16660800396"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PE77P6491J"></script>
<script src="../js/googleAnalyze1.js"></script>
<script src="../js/googleAnalyze2.js"></script>
</head> </head>
<body> <body>
<div class="BulletBox"></div> <div class="BulletBox"></div>

View File

@ -17,6 +17,11 @@
<link rel="stylesheet" href="../css/common.css"/> <link rel="stylesheet" href="../css/common.css"/>
<link rel="stylesheet" type="text/css" href="../css/rem.css"/> <link rel="stylesheet" type="text/css" href="../css/rem.css"/>
<link rel="stylesheet" href="../css/help.css"/> <link rel="stylesheet" href="../css/help.css"/>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-16660800396"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PE77P6491J"></script>
<script src="../js/googleAnalyze1.js"></script>
<script src="../js/googleAnalyze2.js"></script>
</head> </head>
<body> <body>

View File

@ -11,6 +11,11 @@
<link rel="stylesheet" type="text/css" href="../css/common.css"> <link rel="stylesheet" type="text/css" href="../css/common.css">
<link rel="stylesheet" type="text/css" href="../css/rem.css"> <link rel="stylesheet" type="text/css" href="../css/rem.css">
<link rel="stylesheet" type="text/css" href="../css/home.css"> <link rel="stylesheet" type="text/css" href="../css/home.css">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-16660800396"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PE77P6491J"></script>
<script src="../js/googleAnalyze1.js"></script>
<script src="../js/googleAnalyze2.js"></script>
</head> </head>
<body> <body>
<div id="layout"> <div id="layout">

View File

@ -11,6 +11,11 @@
<link rel="stylesheet" href="../css/common.css"> <link rel="stylesheet" href="../css/common.css">
<link rel="stylesheet" type="text/css" href="../css/rem.css"> <link rel="stylesheet" type="text/css" href="../css/rem.css">
<link rel="stylesheet" href="../css/log.css"> <link rel="stylesheet" href="../css/log.css">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-16660800396"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PE77P6491J"></script>
<script src="../js/googleAnalyze1.js"></script>
<script src="../js/googleAnalyze2.js"></script>
</head> </head>
<body> <body>
<div id="layout"> <div id="layout">

View File

@ -11,6 +11,11 @@
<link rel="stylesheet" href="../css/common.css"> <link rel="stylesheet" href="../css/common.css">
<link rel="stylesheet" type="text/css" href="../css/rem.css"> <link rel="stylesheet" type="text/css" href="../css/rem.css">
<link rel="stylesheet" href="../css/price.css"> <link rel="stylesheet" href="../css/price.css">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-16660800396"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PE77P6491J"></script>
<script src="../js/googleAnalyze1.js"></script>
<script src="../js/googleAnalyze2.js"></script>
</head> </head>
<body> <body>
<div class="BulletBox1"> <div class="BulletBox1">

View File

@ -9,6 +9,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="../img/favicon.ico"> <link rel="shortcut icon" href="../img/favicon.ico">
<link rel="stylesheet" href="../css/privacy.css"> <link rel="stylesheet" href="../css/privacy.css">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-16660800396"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PE77P6491J"></script>
<script src="../js/googleAnalyze1.js"></script>
<script src="../js/googleAnalyze2.js"></script>
</head> </head>
<body> <body>
<style> <style>

View File

@ -11,6 +11,11 @@
<link rel="stylesheet" href="../css/common.css"> <link rel="stylesheet" href="../css/common.css">
<link rel="stylesheet" type="text/css" href="../css/rem.css"> <link rel="stylesheet" type="text/css" href="../css/rem.css">
<link rel="stylesheet" href="../css/product.css"> <link rel="stylesheet" href="../css/product.css">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-16660800396"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PE77P6491J"></script>
<script src="../js/googleAnalyze1.js"></script>
<script src="../js/googleAnalyze2.js"></script>
</head> </head>
<body> <body>
<div id="layout"> <div id="layout">

View File

@ -11,6 +11,11 @@
<link rel="stylesheet" href="../css/common.css"> <link rel="stylesheet" href="../css/common.css">
<link rel="stylesheet" type="text/css" href="../css/rem.css"> <link rel="stylesheet" type="text/css" href="../css/rem.css">
<link rel="stylesheet" href="../css/solution.css"> <link rel="stylesheet" href="../css/solution.css">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-16660800396"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PE77P6491J"></script>
<script src="../js/googleAnalyze1.js"></script>
<script src="../js/googleAnalyze2.js"></script>
</head> </head>
<body> <body>
<div id="layout"> <div id="layout">

View File

@ -200,35 +200,5 @@ const openInNewTab = (url)=> {
const win = window.open(url, '_blank'); const win = window.open(url, '_blank');
win.focus(); win.focus();
} }
// 引入谷歌分析代码
let scriptElement = document.createElement('script');
scriptElement.async = true;
scriptElement.src = 'https://www.googletagmanager.com/gtag/js?id=AW-16660800396';
let scriptElement1 = document.createElement('script');
scriptElement1.async = true;
scriptElement1.src = 'https://www.googletagmanager.com/gtag/js?id=G-PE77P6491J';
// 在 script 元素加载完成后执行的回调函数
scriptElement.onload = function() {
let customScript = document.createElement('script');
customScript.textContent = `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'AW-16660800396');`
document.head.appendChild(customScript);
};
scriptElement1.onload = function() {
let customScript = document.createElement('script');
customScript.textContent = `
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-PE77P6491J'); `
document.head.appendChild(customScript);
};
// 将 script 元素插入到文档的 head 元素中
document.head.appendChild(scriptElement);
document.head.appendChild(scriptElement1);

6
public/site/js/googleAnalyze1.js vendored Normal file
View File

@ -0,0 +1,6 @@
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "AW-16660800396");

6
public/site/js/googleAnalyze2.js vendored Normal file
View File

@ -0,0 +1,6 @@
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag("js", new Date());
gtag("config", "G-PE77P6491J");

View File

@ -11,6 +11,11 @@
<link rel="stylesheet" href="../css/common.css"> <link rel="stylesheet" href="../css/common.css">
<link rel="stylesheet" type="text/css" href="../css/rem.css"> <link rel="stylesheet" type="text/css" href="../css/rem.css">
<link rel="stylesheet" href="../css/about.css"> <link rel="stylesheet" href="../css/about.css">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-16660800396"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PE77P6491J"></script>
<script src="../js/googleAnalyze1.js"></script>
<script src="../js/googleAnalyze2.js"></script>
</head> </head>
<body> <body>
<div class="BulletBox"></div> <div class="BulletBox"></div>

View File

@ -9,6 +9,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="../img/favicon.ico"> <link rel="shortcut icon" href="../img/favicon.ico">
<link rel="stylesheet" href="../css/privacy.css"> <link rel="stylesheet" href="../css/privacy.css">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-16660800396"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PE77P6491J"></script>
<script src="../js/googleAnalyze1.js"></script>
<script src="../js/googleAnalyze2.js"></script>
</head> </head>
<body> <body>
<style> <style>

View File

@ -11,6 +11,11 @@
<link rel="stylesheet" href="../css/common.css"> <link rel="stylesheet" href="../css/common.css">
<link rel="stylesheet" type="text/css" href="../css/rem.css"> <link rel="stylesheet" type="text/css" href="../css/rem.css">
<link rel="stylesheet" href="../css/download.css"> <link rel="stylesheet" href="../css/download.css">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-16660800396"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PE77P6491J"></script>
<script src="../js/googleAnalyze1.js"></script>
<script src="../js/googleAnalyze2.js"></script>
</head> </head>
<body> <body>
<div class="BulletBox"></div> <div class="BulletBox"></div>

View File

@ -11,6 +11,11 @@
<link rel="stylesheet" href="../css/common.css"> <link rel="stylesheet" href="../css/common.css">
<link rel="stylesheet" type="text/css" href="../css/rem.css"> <link rel="stylesheet" type="text/css" href="../css/rem.css">
<link rel="stylesheet" href="../css/help.css"> <link rel="stylesheet" href="../css/help.css">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-16660800396"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PE77P6491J"></script>
<script src="../js/googleAnalyze1.js"></script>
<script src="../js/googleAnalyze2.js"></script>
</head> </head>
<body> <body>
<div id="layout"> <div id="layout">

View File

@ -11,6 +11,11 @@
<link rel="stylesheet" type="text/css" href="../css/common.css"> <link rel="stylesheet" type="text/css" href="../css/common.css">
<link rel="stylesheet" type="text/css" href="../css/rem.css"> <link rel="stylesheet" type="text/css" href="../css/rem.css">
<link rel="stylesheet" type="text/css" href="../css/home.css"> <link rel="stylesheet" type="text/css" href="../css/home.css">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-16660800396"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PE77P6491J"></script>
<script src="../js/googleAnalyze1.js"></script>
<script src="../js/googleAnalyze2.js"></script>
</head> </head>
<body> <body>
<div id="layout"> <div id="layout">

View File

@ -11,6 +11,11 @@
<link rel="stylesheet" href="../css/common.css"> <link rel="stylesheet" href="../css/common.css">
<link rel="stylesheet" type="text/css" href="../css/rem.css"> <link rel="stylesheet" type="text/css" href="../css/rem.css">
<link rel="stylesheet" href="../css/log.css"> <link rel="stylesheet" href="../css/log.css">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-16660800396"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PE77P6491J"></script>
<script src="../js/googleAnalyze1.js"></script>
<script src="../js/googleAnalyze2.js"></script>
</head> </head>
<body> <body>
<div id="layout"> <div id="layout">

View File

@ -11,6 +11,11 @@
<link rel="stylesheet" href="../css/common.css"> <link rel="stylesheet" href="../css/common.css">
<link rel="stylesheet" type="text/css" href="../css/rem.css"> <link rel="stylesheet" type="text/css" href="../css/rem.css">
<link rel="stylesheet" href="../css/price.css"> <link rel="stylesheet" href="../css/price.css">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-16660800396"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PE77P6491J"></script>
<script src="../js/googleAnalyze1.js"></script>
<script src="../js/googleAnalyze2.js"></script>
</head> </head>
<body> <body>
<div class="BulletBox1"> <div class="BulletBox1">

View File

@ -9,6 +9,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="../img/favicon.ico"> <link rel="shortcut icon" href="../img/favicon.ico">
<link rel="stylesheet" href="../css/privacy.css"> <link rel="stylesheet" href="../css/privacy.css">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-16660800396"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PE77P6491J"></script>
<script src="../js/googleAnalyze1.js"></script>
<script src="../js/googleAnalyze2.js"></script>
</head> </head>
<body> <body>
<style> <style>

View File

@ -11,6 +11,11 @@
<link rel="stylesheet" href="../css/common.css"> <link rel="stylesheet" href="../css/common.css">
<link rel="stylesheet" type="text/css" href="../css/rem.css"> <link rel="stylesheet" type="text/css" href="../css/rem.css">
<link rel="stylesheet" href="../css/product.css"> <link rel="stylesheet" href="../css/product.css">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-16660800396"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PE77P6491J"></script>
<script src="../js/googleAnalyze1.js"></script>
<script src="../js/googleAnalyze2.js"></script>
</head> </head>
<body> <body>
<div id="layout"> <div id="layout">

View File

@ -11,6 +11,11 @@
<link rel="stylesheet" href="../css/common.css"> <link rel="stylesheet" href="../css/common.css">
<link rel="stylesheet" type="text/css" href="../css/rem.css"> <link rel="stylesheet" type="text/css" href="../css/rem.css">
<link rel="stylesheet" href="../css/solution.css"> <link rel="stylesheet" href="../css/solution.css">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=AW-16660800396"></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-PE77P6491J"></script>
<script src="../js/googleAnalyze1.js"></script>
<script src="../js/googleAnalyze2.js"></script>
</head> </head>
<body> <body>
<div id="layout"> <div id="layout">