Skip to content

Commit

Permalink
Add support for Cloudflare Web Analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent-C committed Jan 17, 2023
1 parent d9c1fd0 commit 8bd43aa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ The minimalist [Pelican](http://blog.getpelican.com/) theme.
- [Google Analytics](https://www.google.com/analytics/web/)
- [Google Tag Manager](https://www.google.com/tagmanager/)
- [Matomo Analytics (formerly Piwik)](https://matomo.org/)
- [Cloudflare Web Analytics](https://www.cloudflare.com/web-analytics/)
- [Plausible](https://plausible.io/)
- [StatusCake](https://www.statuscake.com/)
- [Isso](https://posativ.org/isso/)
Expand Down
1 change: 1 addition & 0 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
{% include "partial/matomo.html" %}
{% include 'partial/github.html' %}
{% include 'partial/stork.html' %}
{% include 'partial/cf_analytics.html' %}

{% block additional_js %}{% endblock %}
</body>
Expand Down
6 changes: 6 additions & 0 deletions templates/partial/cf_analytics.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% if CLOUDFLARE_WEB_ANALYTICS_TOKEN %}
<script defer
src='https://static.cloudflareinsights.com/beacon.min.js'
data-cf-beacon='{"token": "{{ CLOUDFLARE_WEB_ANALYTICS_TOKEN }}"}'>
</script>
{% endif %}

0 comments on commit 8bd43aa

Please sign in to comment.