mirror of
https://github.com/kubesphere/website.git
synced 2025-12-30 00:52:47 +00:00
Merge pull request #470 from liuboaibc/add_google_tag
add google tag manager
This commit is contained in:
commit
2c5baaedce
|
|
@ -3,3 +3,4 @@ baseURL = "https://kubesphere.io"
|
|||
[params]
|
||||
|
||||
addGoogleAnalytics = true
|
||||
addGoogleTag = true
|
||||
|
|
@ -5,6 +5,12 @@
|
|||
</head>
|
||||
|
||||
<body>
|
||||
{{ if .Site.Params.addGoogleTag }}
|
||||
<!-- Google Tag Manager (noscript) -->
|
||||
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-W9FLX4R"
|
||||
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
||||
<!-- End Google Tag Manager (noscript) -->
|
||||
{{ end }}
|
||||
{{- partial "header.html" . -}}
|
||||
<main class='main-section {{ if eq .Site.Language.Lang "zh"}} padding{{ end }}'>
|
||||
{{- block "main" . }}{{- end }}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,12 @@
|
|||
</head>
|
||||
|
||||
<body>
|
||||
{{ if .Site.Params.addGoogleTag }}
|
||||
<!-- Google Tag Manager (noscript) -->
|
||||
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-W9FLX4R"
|
||||
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
||||
<!-- End Google Tag Manager (noscript) -->
|
||||
{{ end }}
|
||||
{{- partial "header.html" . -}}
|
||||
<main class='main-section {{ if eq .Site.Language.Lang "zh"}} padding{{ end }}'>
|
||||
<section class='section-1 bg-cover'>
|
||||
|
|
|
|||
|
|
@ -15,6 +15,12 @@
|
|||
|
||||
|
||||
<body>
|
||||
{{ if .Site.Params.addGoogleTag }}
|
||||
<!-- Google Tag Manager (noscript) -->
|
||||
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-W9FLX4R"
|
||||
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
||||
<!-- End Google Tag Manager (noscript) -->
|
||||
{{ end }}
|
||||
{{ partial "header.html" $context }}
|
||||
<section class="main-section {{ if eq .context.Site.Language.Lang "zh"}} padding{{ end }}">
|
||||
<div class="common-layout">
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
{{ end }}
|
||||
|
||||
<!-- Global site tag (gtag.js) - Google Analytics -->
|
||||
{{ if .Site.Params.addGoogleAnalytics }}
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-YYCVN36HT5"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
|
|
@ -33,6 +34,19 @@
|
|||
|
||||
gtag('config', 'G-YYCVN36HT5');
|
||||
</script>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.addGoogleTag }}
|
||||
<!-- 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-W9FLX4R');</script>
|
||||
<!-- End Google Tag Manager -->
|
||||
|
||||
<script type="text/javascript" src="//script.crazyegg.com/pages/scripts/0100/4419.js" async="async"></script>
|
||||
{{ end }}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue