Update index.html
Browse files- index.html +30 -13
index.html
CHANGED
@@ -5,22 +5,39 @@
|
|
5 |
<script>
|
6 |
eruda.init();
|
7 |
</script>
|
8 |
-
<!-- Google tag (gtag.js) -->
|
9 |
-
<!-- Google Tag Manager -->
|
10 |
-
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
11 |
-
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
12 |
-
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
13 |
-
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
14 |
-
})(window,document,'script','dataLayer','GTM-NDL2LKLQ');</script>
|
15 |
-
<!-- End Google Tag Manager -->
|
16 |
-
<script async src="https://www.googletagmanager.com/gtag/js?id=G-2M35HBEEVH"></script>
|
17 |
<script>
|
18 |
-
|
19 |
-
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
</script>
|
|
|
24 |
<script>
|
25 |
document.addEventListener("DOMContentLoaded", () => {
|
26 |
if (localStorage.getItem("admin") !== "1") {
|
|
|
5 |
<script>
|
6 |
eruda.init();
|
7 |
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
<script>
|
9 |
+
function isAdmin() {
|
10 |
+
return document.cookie.includes("admin_access=true");
|
11 |
+
}
|
12 |
+
|
13 |
+
if (!isAdmin()) {
|
14 |
+
// Google Tag Manager
|
15 |
+
(function(w,d,s,l,i){
|
16 |
+
w[l]=w[l]||[];
|
17 |
+
w[l].push({'gtm.start': new Date().getTime(), event:'gtm.js'});
|
18 |
+
var f=d.getElementsByTagName(s)[0],
|
19 |
+
j=d.createElement(s),
|
20 |
+
dl=l!='dataLayer'?'&l='+l:'';
|
21 |
+
j.async=true;
|
22 |
+
j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;
|
23 |
+
f.parentNode.insertBefore(j,f);
|
24 |
+
})(window,document,'script','dataLayer','GTM-NDL2LKLQ');
|
25 |
+
|
26 |
+
// Google Analytics (gtag.js)
|
27 |
+
var gtagScript = document.createElement('script');
|
28 |
+
gtagScript.async = true;
|
29 |
+
gtagScript.src = "https://www.googletagmanager.com/gtag/js?id=G-2M35HBEEVH";
|
30 |
+
document.head.appendChild(gtagScript);
|
31 |
|
32 |
+
window.dataLayer = window.dataLayer || [];
|
33 |
+
function gtag(){dataLayer.push(arguments);}
|
34 |
+
gtag('js', new Date());
|
35 |
+
gtag('config', 'G-2M35HBEEVH');
|
36 |
+
} else {
|
37 |
+
console.log("管理者のため、Googleタグはスキップされました。");
|
38 |
+
}
|
39 |
</script>
|
40 |
+
|
41 |
<script>
|
42 |
document.addEventListener("DOMContentLoaded", () => {
|
43 |
if (localStorage.getItem("admin") !== "1") {
|