diff options
author | Joe Mooring <[email protected]> | 2024-03-23 13:07:00 -0700 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2024-03-26 15:40:51 +0100 |
commit | ebfca61ac4d4b62b3e4a50477826a85c06b44552 (patch) | |
tree | 2d82e184bcb6071f0edbad45672b4f98593a9a2b /hugolib | |
parent | e1917740afe3fd08d1948947e25eff55e2c10d98 (diff) | |
download | hugo-ebfca61ac4d4b62b3e4a50477826a85c06b44552.tar.gz hugo-ebfca61ac4d4b62b3e4a50477826a85c06b44552.zip |
tpl/tplimpl: Update Google Analytics template and config
Google Analytics 4 (GA4) replaced Google Universal Analytics (UA)
effective 1 July 2023.
See https://support.google.com/analytics/answer/11583528.
Changes:
- Update tpl/tplimpl/embedded/templates/google_analytics.html
- Remove tpl/tplimpl/embedded/templates/google_analytics_async.html
- Remove extraneous config settings
Closes #11802
Closes #10093
Diffstat (limited to 'hugolib')
-rw-r--r-- | hugolib/embedded_templates_test.go | 39 | ||||
-rw-r--r-- | hugolib/testhelpers_test.go | 1 |
2 files changed, 0 insertions, 40 deletions
diff --git a/hugolib/embedded_templates_test.go b/hugolib/embedded_templates_test.go index a3b09e369..c409b0fbd 100644 --- a/hugolib/embedded_templates_test.go +++ b/hugolib/embedded_templates_test.go @@ -15,8 +15,6 @@ package hugolib import ( "testing" - - qt "github.com/frankban/quicktest" ) func TestInternalTemplatesImage(t *testing.T) { @@ -97,43 +95,6 @@ title: My Site `) } -// Just some simple test of the embedded templates to avoid -// https://github.com/gohugoio/hugo/issues/4757 and similar. -func TestEmbeddedTemplates(t *testing.T) { - t.Parallel() - - c := qt.New(t) - c.Assert(true, qt.Equals, true) - - home := []string{"index.html", ` -GA: -{{ template "_internal/google_analytics.html" . }} - -GA async: - -{{ template "_internal/google_analytics_async.html" . }} - -Disqus: - -{{ template "_internal/disqus.html" . }} - -`} - - b := newTestSitesBuilder(t) - b.WithSimpleConfigFile().WithTemplatesAdded(home...) - - b.Build(BuildCfg{}) - - // Gheck GA regular and async - b.AssertFileContent("public/index.html", - "'anonymizeIp', true", - "'script','https://www.google-analytics.com/analytics.js','ga');\n\tga('create', 'UA-ga_id', 'auto')", - "<script async src='https://www.google-analytics.com/analytics.js'>") - - // Disqus - b.AssertFileContent("public/index.html", "\"disqus_shortname\" + '.disqus.com/embed.js';") -} - func TestEmbeddedPaginationTemplate(t *testing.T) { t.Parallel() diff --git a/hugolib/testhelpers_test.go b/hugolib/testhelpers_test.go index e2bd57f3c..dab693623 100644 --- a/hugolib/testhelpers_test.go +++ b/hugolib/testhelpers_test.go @@ -258,7 +258,6 @@ id = "UA-ga_id" disable = false [privacy.googleAnalytics] respectDoNotTrack = true -anonymizeIP = true [privacy.instagram] simple = true [privacy.twitter] |