Skip to content

Commit 90693ff

Browse files
authored
feat: add analytics support for GoatCounter (#1526)
1 parent 1a01c35 commit 90693ff

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
- Built-in Search
3535
- Atom Feeds
3636
- PWA
37-
- Google Analytics
37+
- Google Analytics / GoatCounter
3838
- SEO & Performance Optimization
3939

4040
## Documentation

_config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ google_site_verification: # fill in to your verification string
5252
google_analytics:
5353
id: # fill in your Google Analytics ID
5454

55+
goatcounter:
56+
id: # fill in your Goatcounter ID
57+
5558
# Prefer color scheme setting.
5659
#
5760
# Note: Keep empty will follow the system prefer color by default,

_includes/goatcounter.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!-- GoatCounter -->
2+
3+
<script
4+
data-goatcounter="https://{{ site.goatcounter.id }}.goatcounter.com/count"
5+
async
6+
src="https://gc.zgo.at/count.js"
7+
></script>
8+

_includes/js-selector.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,9 @@
105105
{% if site.google_analytics.id != empty and site.google_analytics.id %}
106106
{% include google-analytics.html %}
107107
{% endif %}
108+
109+
<!-- GoatCounter -->
110+
{% if site.goatcounter.id != empty and site.goatcounter.id %}
111+
{% include goatcounter.html %}
112+
{% endif %}
108113
{% endif %}

0 commit comments

Comments
 (0)