Skip to content

Commit 96fdcc5

Browse files
committed
Drop support of AnonymizeIp configuration parameter
1 parent dcbed3e commit 96fdcc5

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3030
- Removed explicit setting of the `languageCode` for the example site to force
3131
Hugo use `site.Language.LanguageCode` as the default language code for the
3232
site. See `exampleSite/config/_default/languages.yaml` for more details.
33+
- Drop support of AnonymizeIp configuration parameter for Google Analytics as
34+
it is no longer relevant in Google Analytics >= v4.
3335

3436
## [v0.8.0](https://github.com/sergeyklay/gohugo-theme-ed/compare/v0.7.0...v0.8.0)
3537

assets/js/ga.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {analyticsCode, anonymizeIp} from '@params';
1+
import {analyticsCode} from '@params';
22

33
let dataLayer;
44

@@ -126,7 +126,6 @@ if (isDoNotTrackEnabled()) {
126126

127127
// Setup the project analytics code and send a pageview
128128
gtag('config', analyticsCode, {
129-
'anonymize_ip': anonymizeIp,
130129
'cookie_expires': month
131130
});
132131

exampleSite/config/_default/params.yaml

-5
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,6 @@ seo:
8383
# The site.Title will be used if empty.
8484
publisher: Serghei Iakovlev
8585

86-
# To anonymize the IP addresses of hits sent to Google Analytics
87-
# set this param to true. Please note, to enable Google Analytics
88-
# you have to set `googleAnalytics` param in config.yaml file.
89-
anonymizeIp: true
90-
9186
author:
9287
name: Serghei Iakovlev
9388

layouts/partials/seo/ga.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{- if (or (eq (getenv "HUGO_ENV") "production") (eq site.Params.env "production")) -}}
22
{{- with site.GoogleAnalytics -}}
3-
{{- $gaParams := dict "analyticsCode" (site.GoogleAnalytics | default "") "anonymizeIp" (site.Params.anonymizeIp | default true) -}}
3+
{{- $gaParams := dict "analyticsCode" (site.GoogleAnalytics | default "") -}}
44

55
{{- $gaScript := slice -}}
66
{{- $gaScript = $gaScript | append (resources.Get "js/ga.js") -}}

0 commit comments

Comments
 (0)