зеркало из https://github.com/mozilla/awebpodcast.git
Switch to GTM
This commit is contained in:
Родитель
9ba30180df
Коммит
1542eab5f2
|
@ -1,3 +1,3 @@
|
|||
baseURL = "https://awebpodcast.org"
|
||||
googleAnalytics = "UA-36116321-28"
|
||||
googleAnalytics = "GTM-NWNPDQV"
|
||||
buildFuture = false
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
{{ if gt (len .Site.GoogleAnalytics) 0 }}
|
||||
<script>
|
||||
(function(Mozilla) {
|
||||
|
@ -10,9 +9,14 @@
|
|||
(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/gtag/js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
||||
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
||||
})(window,document,'script','dataLayer','{{ .Site.GoogleAnalytics }}');
|
||||
} else {
|
||||
// still need the object to avoid errors
|
||||
window.dataLayer = [];
|
||||
}
|
||||
})(window.Mozilla);
|
||||
</script>
|
||||
{{ end }}
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче