diff --git a/config.toml b/config.toml index d67f16ead1..9710b8d379 100644 --- a/config.toml +++ b/config.toml @@ -4,7 +4,6 @@ title = "Chef Web Docs" theme = "docs-new" enableGitInfo = true pluralizeListTitles = false -googleAnalytics = "G-2L57JLVKNZ" # We do redirects via Netlify's _redirects file, generated by Hugo (see "outputs" below). disableAliases = true diff --git a/themes/docs-new/assets/js/feedback.js b/themes/docs-new/assets/js/feedback.js index ad151b68a8..0dba3aa58f 100644 --- a/themes/docs-new/assets/js/feedback.js +++ b/themes/docs-new/assets/js/feedback.js @@ -18,7 +18,6 @@ function thanksFeedback(button){ const sendFeedback = (value) => { if (typeof ga !== 'function') return; const args = { - command: 'send', hitType: 'event', category: 'Feedback Buttons', action: 'click', @@ -40,4 +39,4 @@ noButton.addEventListener('click', () => { thanksFeedback(noButton); disableButtons(); sendFeedback(0); -}); \ No newline at end of file +}); diff --git a/themes/docs-new/layouts/_default/data-api.html b/themes/docs-new/layouts/_default/data-api.html index 03c9303bb8..61541bc37a 100644 --- a/themes/docs-new/layouts/_default/data-api.html +++ b/themes/docs-new/layouts/_default/data-api.html @@ -8,7 +8,7 @@ {{ if eq (getenv "HUGO_ENV") "production" }} - {{ template "_internal/google_analytics.html" . }} + {{ partial "gtag.html" . }} {{ end }}
diff --git a/themes/docs-new/layouts/partials/gtag.html b/themes/docs-new/layouts/partials/gtag.html new file mode 100644 index 0000000000..1c221af99e --- /dev/null +++ b/themes/docs-new/layouts/partials/gtag.html @@ -0,0 +1,11 @@ +{{ with .Site.GoogleAnalytics }} + + + +{{ end }} diff --git a/themes/docs-new/layouts/partials/head.html b/themes/docs-new/layouts/partials/head.html index 098a8505e1..9491712625 100644 --- a/themes/docs-new/layouts/partials/head.html +++ b/themes/docs-new/layouts/partials/head.html @@ -1,4 +1,7 @@ + {{ if eq (getenv "HUGO_ENV") "production" }} + {{ partial "gtag.html" . }} + {{ end }} @@ -8,7 +11,4 @@ {{ $options := (dict "includePaths" (slice "node_modules")) }} {{ $style := resources.Get "sass/main.scss" | resources.ToCSS $options }} - {{ if eq (getenv "HUGO_ENV") "production" }} - {{ template "_internal/google_analytics.html" . }} - {{ end }}