feat: add analytics support for GoatCounter (#1526)

This commit is contained in:
Benjamin van den Hout 2024-02-06 15:19:28 +01:00 committed by GitHub
parent 1a01c35e52
commit 90693ff95e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 17 additions and 1 deletions

View file

@ -34,7 +34,7 @@
- Built-in Search - Built-in Search
- Atom Feeds - Atom Feeds
- PWA - PWA
- Google Analytics - Google Analytics / GoatCounter
- SEO & Performance Optimization - SEO & Performance Optimization
## Documentation ## Documentation

View file

@ -52,6 +52,9 @@ google_site_verification: # fill in to your verification string
google_analytics: google_analytics:
id: # fill in your Google Analytics ID id: # fill in your Google Analytics ID
goatcounter:
id: # fill in your Goatcounter ID
# Prefer color scheme setting. # Prefer color scheme setting.
# #
# Note: Keep empty will follow the system prefer color by default, # Note: Keep empty will follow the system prefer color by default,

View file

@ -0,0 +1,8 @@
<!-- GoatCounter -->
<script
data-goatcounter="https://{{ site.goatcounter.id }}.goatcounter.com/count"
async
src="https://gc.zgo.at/count.js"
></script>

View file

@ -105,4 +105,9 @@
{% if site.google_analytics.id != empty and site.google_analytics.id %} {% if site.google_analytics.id != empty and site.google_analytics.id %}
{% include google-analytics.html %} {% include google-analytics.html %}
{% endif %} {% endif %}
<!-- GoatCounter -->
{% if site.goatcounter.id != empty and site.goatcounter.id %}
{% include goatcounter.html %}
{% endif %}
{% endif %} {% endif %}