Merge pull request #250 from Labs64/pr-anonymize_ip

Enable IP anonymization in Google Analytics (GDPR)
This commit is contained in:
Patrick Marsceill 2020-04-24 14:47:21 -04:00 committed by GitHub
commit 0716ea77d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 1 deletions

View File

@ -59,6 +59,7 @@ color_scheme: nil
# Google Analytics Tracking (optional)
# e.g, UA-1234567-89
ga_tracking: UA-2709176-10
ga_tracking_anonymize_ip: true # Use GDPR compliant Google Analytics settings (true by default)
plugins:
- jekyll-seo-tag

View File

@ -21,7 +21,7 @@
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', "{{ site.ga_tracking }}");
gtag('config', '{{ site.ga_tracking }}'{% unless site.ga_tracking_anonymize_ip == nil %}, { 'anonymize_ip': true }{% endunless %});
</script>
{% endif %}

View File

@ -103,4 +103,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 # Use GDPR compliant Google Analytics settings (true by default)
```