Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Cloudflare analytics #798

Merged
merged 3 commits into from
Apr 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Added support for Patreon, Medium, and Itch.io in the social network links in the footer (#783, #788)
- Fixed bug where special characters in the title led to broken share tags (#744)
- Updated staticman from using v2 (public servers) to v3 (private servers) due to the public servers becoming obsolete (#775)
- Added support for Cloudflare Analytics (#797)

## v5.0.0 (2020-09-15)

Expand Down
3 changes: 3 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ footer-link-col: "#404040"
# Fill in your Google Analytics ID to track your website using Google Analytics
#google_analytics: ""

# Fill in your Cloudflare Analytics beacon token to track your website using Cloudflare Analytics
#cloudflare_analytics: ""

# Google Tag Manager ID
#gtm: ""

Expand Down
8 changes: 8 additions & 0 deletions _includes/cloudflare_analytics.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% if site.cloudflare_analytics %}
<!-- Cloudflare Web Analytics -->
<script defer
src='https://static.cloudflareinsights.com/beacon.min.js'
data-cf-beacon='{"token": "{{ site.cloudflare_analytics}}"}'>
</script>
<!-- End Cloudflare Web Analytics -->
{% endif %}
1 change: 1 addition & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
{% include gtag.html %}
{% include gtm_head.html %}
{% include google_analytics.html %}
{% include cloudflare_analytics.html %}

{% if layout.common-ext-css %}
{% for css in layout.common-ext-css %}
Expand Down