8000 Add Google Analytics anonymous IP option, default set to true, fixes … · EdwardZX/EdwardZX.github.io@e9dfcfc · GitHub
[go: up one dir, main page]

Skip to content

Commit e9dfcfc

Browse files
committed
Add Google Analytics anonymous IP option, default set to true, fixes daviddarnes#117
1 parent dabf6ee commit e9dfcfc

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ There are a number of optional settings for you to configure. Use the example [`
123123

124124
You'll need to change the `description`, `title` and `url` to match with the project. You'll also need to replace the logos, default social and default offline images in the `/assets/` directory with your own graphics. Setting the site language can be done with `lang`, the theme will default to `en-US`. The `email` needs to be changed to the email you want to receive contact form enquires with. The `disqus` value can be changed to your project username on [Disqus](https://disqus.com), remove this from the `/_config.yml` file if you don't want comments enabled. Look for the `Site settings` comment within the `/_config.yml` file. The `repo` setting is optional, for now, and can be removed entirely, if you wish.
125125

126-
Google Analytics can be enabled via the site configuration too. Add your tracking ID to the `/_config.yml` file in the following method: `google_analytics: 'UA-XXXXXXXX-1'`
126+
Google Analytics can be enabled via the site configuration too. Add your tracking ID to the `/_config.yml` file in the following method: `google_analytics: 'UA-XXXXXXXX-1'`. By default all IPs of site visitors are anonymous to maintain a level of privacy for the audience. If you wish to turn this off set the `google_analytics_anonymize_ip` key to `false`.
127127

128128
Date format can be customised in the `/_config.yml` with the option `date_format` (please refer to Liquid date filters documentation for learning about formatting possibilities):
129129
`d 8000 ate_format: "%-d %B %Y" # NOTE: only placeholder formatting is supported (do not try to use ordinal dates introduced in Jekyll 3.8)`
@@ -197,7 +197,6 @@ Available options:
197197
``` yml
198198
Twitter: "#1DA1F2"
199199
facebook: "#3B5998"
200-
Google+: "#DC4E41"
201200
Pinterest: "#BD081C"
202201
LinkedIn: "#0077B5"
203202
tumblr: "#36465D"

_config.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ social: # jekyll-seo-tag > social overrides
4848
- https://twitter.com/DavidDarnes
4949
- https://www.facebook.com/daviddarnes
5050
- https://www.linkedin.com/in/daviddarnes
51-
- https://plus.google.com/+DavidDarnes
5251
- https://github.com/daviddarnes
5352
# markdown: CommonMark # Markdown parse settings, CommonMark performs slightly better an others in build time
5453
# commonmark:
@@ -92,6 +91,7 @@ repo: "https://github.com/daviddarnes/alembic"
9291
email: "me@daviddarnes.com"
9392
# disqus: "alembic-1" # Blog post comments, uncomment the option and set the site ID from your Disqus account
9493
# google_analytics: ''
94+
# google_analytics_anonymize_ip: ''
9595
# service_worker: false # Will turn off the service worker if set to false
9696
css_inline: true # Will insert all styles into a single <style> block in the <head> element and remove the style <link> reference
9797

@@ -121,15 +121,13 @@ navigation_footer:
121121
social_links: # Appears in sidebar. Set the urls then uncomment and comment out as desired
122122
Twitter: https://twitter.com/DavidDarnes
123123
LinkedIn: https://www.linkedin.com/in/daviddarnes
124-
Google+: https://plus.google.com/+DavidDarnes
125124
GitHub: https://github.com/daviddarnes
126125
link: https://darn.es
127126
RSS: /feed.xml
128127

129128
sharing_links: # Appear at the bottom of single blog posts, uncomment and comment out as desired. Colours set the button colour
130129
Twitter: "#0d94e7"
131130
facebook: "#3B5998"
132-
Google+: "#DC4E41"
133131
# Pinterest: "#BD081C"
134132
# LinkedIn: "#0077B5"
135133
# tumblr: "#36465D"

_includes/site-analytics.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@
66
gtag('js', new Date());
77

88
gtag('config', '{{ site.google_analytics }}');
9+
gtag('config', '{{ site.google_analytics }}', {
10+
'anonymize_ip': {{ site.google_analytics_anonymize_ip | default: "true" }}
11+
});
912
</script>

0 commit comments

Comments
 (0)
0