Skip to content

Commit

Permalink
Revert "Use gtag.js analytics library for all site tags"
Browse files Browse the repository at this point in the history
This reverts commit c7c3fa7.
  • Loading branch information
geriom committed Aug 31, 2022
1 parent 78a9796 commit 4a41d9b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 51 deletions.
42 changes: 0 additions & 42 deletions layouts/_internal/google_analytics_gtag.html

This file was deleted.

5 changes: 2 additions & 3 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@

{{/* To comply with GDPR, cookie consent scripts places in head-end must execute before Google Analytics is enabled */ -}}
{{ if hugo.IsProduction -}}
{{ $enableGtagForUniversalAnalytics := not .Site.Params.disableGtagForUniversalAnalytics -}}
{{ if (or $enableGtagForUniversalAnalytics (hasPrefix .Site.GoogleAnalytics "G-")) -}}
{{ template "_internal/google_analytics_gtag.html" . -}}
{{ if hasPrefix .Site.GoogleAnalytics "G-" -}}
{{ template "_internal/google_analytics.html" . -}}
{{ else -}}
{{ template "_internal/google_analytics_async.html" . -}}
{{ end -}}
Expand Down
6 changes: 0 additions & 6 deletions userguide/content/en/docs/adding-content/feedback.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ started** section of [Introducing Google Analytics 4 (GA4)][ga4-intro].
Enable Google Analytics by adding your project's analytics ID to the site
configuration file. For details, see [Configure Google Analytics][].

By default, Docsy uses the [gtag.js][] analytics library for both GA4 (which
_requires_ `gtag.js`) and Universal Analytics (UA) site tags. If you prefer using
the older `analytics.js` library for your UA site tag, then set
`params.disableGtagForUniversalAnalytics` to false in your project's config.

{{% alert title="Warning" color="warning" %}}
<!-- Remove this warning once the Hugo docs have been updated to include it. -->

Expand Down Expand Up @@ -294,7 +289,6 @@ partial. For details, see [Customizing templates]({{< ref "lookandfeel#customizi
[Configure Google Analytics]: https://gohugo.io/templates/internal/#configure-google-analytics
[ga4-intro]: https://support.google.com/analytics/answer/1042508
[Google Analytics]: https://analytics.google.com/analytics/web/
[gtag.js]: https://support.google.com/analytics/answer/10220869
[hugo-ga]: https://gohugo.io/templates/internal/#google-analytics
[internal templates]: https://gohugo.io/templates/internal/
[layouts/partials/page-description.html]: https://github.com/google/docsy/blob/main/layouts/partials/page-description.html
Expand Down

0 comments on commit 4a41d9b

Please sign in to comment.