From 25331a5ffad215b86fcdf78067ee89b940147bc5 Mon Sep 17 00:00:00 2001 From: Alexey Averikhin Date: Fri, 8 Nov 2019 06:54:59 +0100 Subject: [PATCH 1/4] Enable IP anonymization in Google Analytics (GDPR) - Introduced "ga_tracking_anonymize_ip" parameter to enable/disable Google Analytics IP anonymization (to comply with GDPR). (cherry picked from commit ce530f36fa0549c78ffe53ea6077f44f6f0b330f) (+1 squashed commit) Squashed commits: [69b7718] - enable GA anonymize_ip (cherry picked from commit f2b67c632af72b61dd634b9a337200781519691e) --- _config.yml | 1 + _includes/head.html | 2 +- docs/configuration.md | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index a09067082833..5508d4a2554d 100644 --- a/_config.yml +++ b/_config.yml @@ -47,6 +47,7 @@ color_scheme: nil # Google Analytics Tracking (optional) # e.g, UA-1234567-89 ga_tracking: UA-2709176-10 +ga_tracking_anonymize_ip: true plugins: - jekyll-seo-tag diff --git a/_includes/head.html b/_includes/head.html index eae6a5e9f04f..67e7b0561526 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -21,7 +21,7 @@ function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); - gtag('config', "{{ site.ga_tracking }}"); + gtag('config', '{{ site.ga_tracking }}'{% if site.ga_tracking_anonymize_ip %}, { 'anonymize_ip': true }{% endif %}); {% endif %} diff --git a/docs/configuration.md b/docs/configuration.md index eb43a086f957..23a0e2602ff2 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -85,4 +85,5 @@ See [Customization]({{ site.baseurl }}{% link docs/customization.md %}) for more # Google Analytics Tracking (optional) # e.g, UA-1234567-89 ga_tracking: UA-5555555-55 +ga_tracking_anonymize_ip: true ``` From 17cf72bd3327fcdf6e17193c24f506b5b5e9cae2 Mon Sep 17 00:00:00 2001 From: "R.Brown" Date: Fri, 24 Apr 2020 19:44:25 +0200 Subject: [PATCH 2/4] Update _includes/head.html Co-Authored-By: Patrick Marsceill --- _includes/head.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_includes/head.html b/_includes/head.html index 67e7b0561526..a56304c6df6f 100644 --- a/_includes/head.html +++ b/_includes/head.html @@ -21,7 +21,7 @@ function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); - gtag('config', '{{ site.ga_tracking }}'{% if site.ga_tracking_anonymize_ip %}, { 'anonymize_ip': true }{% endif %}); + gtag('config', '{{ site.ga_tracking }}'{% unless site.ga_tracking_anonymize_ip == nil %}, { 'anonymize_ip': true }{% endunless %}); {% endif %} From 5152912e5c52414106b8d021dfd32baa720a4d4c Mon Sep 17 00:00:00 2001 From: "R.Brown" Date: Fri, 24 Apr 2020 19:44:34 +0200 Subject: [PATCH 3/4] Update docs/configuration.md Co-Authored-By: Patrick Marsceill --- docs/configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/configuration.md b/docs/configuration.md index 23a0e2602ff2..7166d740d501 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -85,5 +85,5 @@ See [Customization]({{ site.baseurl }}{% link docs/customization.md %}) for more # Google Analytics Tracking (optional) # e.g, UA-1234567-89 ga_tracking: UA-5555555-55 -ga_tracking_anonymize_ip: true +ga_tracking_anonymize_ip: true # Use GDPR compliant Google Analytics settings (true by default) ``` From c06eae8fa3e72ad6890912b950c0f7f395e839e1 Mon Sep 17 00:00:00 2001 From: "R.Brown" Date: Fri, 24 Apr 2020 19:44:42 +0200 Subject: [PATCH 4/4] Update _config.yml Co-Authored-By: Patrick Marsceill --- _config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index 5508d4a2554d..761a6e40d78d 100644 --- a/_config.yml +++ b/_config.yml @@ -47,7 +47,7 @@ color_scheme: nil # Google Analytics Tracking (optional) # e.g, UA-1234567-89 ga_tracking: UA-2709176-10 -ga_tracking_anonymize_ip: true +ga_tracking_anonymize_ip: true # Use GDPR compliant Google Analytics settings (true by default) plugins: - jekyll-seo-tag