Skip to content

Commit 61bdca2

Browse files
authored
feat(analytics): add Umami and Matomo tracking codes (cotes2020#1658)
1 parent 23be416 commit 61bdca2

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
- Built-in Search
3737
- Atom Feeds
3838
- PWA
39-
- Google Analytics / GoatCounter
39+
- Web Analytics
4040
- SEO & Performance Optimization
4141

4242
## Documentation

_config.yml

+6
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ analytics:
6262
id: # fill in your Google Analytics ID
6363
goatcounter:
6464
id: # fill in your GoatCounter ID
65+
umami:
66+
id: # fill in your Umami ID
67+
domain: # fill in your Umami domain
68+
matomo:
69+
id: # fill in your Matomo ID
70+
domain: # fill in your Matomo domain
6571

6672
# Pageviews settings
6773
pageviews:

_includes/analytics/matomo.html

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!-- Matomo -->
2+
<script type="text/javascript">
3+
var _paq = window._paq = window._paq || [];
4+
_paq.push(['trackPageView']);
5+
_paq.push(['enableLinkTracking']);
6+
(function() {
7+
var u="//{{ site.analytics.matomo.domain }}/";
8+
_paq.push(['setTrackerUrl', u+'matomo.php']);
9+
_paq.push(['setSiteId', {{ site.analytics.matomo.id }}]);
10+
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
11+
g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
12+
})();
13+
</script>
14+
<!-- End Matomo Code -->

_includes/analytics/umami.html

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<!-- Umami -->
2+
<script
3+
defer
4+
src="{{ site.analytics.umami.domain }}/script.js"
5+
data-website-id="{{ site.analytics.umami.id }}"
6+
></script>

0 commit comments

Comments
 (0)