Skip to content

Commit d336b3c

Browse files
nourkaghaluizdepra
andauthored
Add Pirsch analytics (luizdepra#795)
### Prerequisites Put an `x` into the box(es) that apply: - [ ] This pull request fixes a bug. - [x] This pull request adds a feature. - [ ] This pull request introduces breaking change. ### Description Adds support for [Pirsch](https://pirsch.io) analytics. One of the best privacy-friendly, open source and lightweight analytics providers. ### Issues Resolved N/A ### Checklist Put an `x` into the box(es) that apply: #### General - [x] Describe what changes are being made - [x] Explain why and how the changes were necessary and implemented respectively - [ ] Reference issue with `#<ISSUE_NO>` if applicable #### Resources - [ ] If you have changed any SCSS code, run `make release` to regenerate all CSS files #### Contributors - [ ] Add yourself to `CONTRIBUTORS.md` if you aren't on it already Signed-off-by: Nour Agha <[email protected]> Co-authored-by: Luiz F. A. de Prá <[email protected]>
1 parent 7627f13 commit d336b3c

File tree

5 files changed

+18
-0
lines changed

5 files changed

+18
-0
lines changed

docs/analytics.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* [Goat Counter](https://www.goatcounter.com/) - [documentation](/docs/analytics/goatcounter.md)
1313
* [Matomo](https://matomo.org/) - [documentation](/docs/analytics/matomo.md)
1414
* [Micro Analytics](https://microanalytics.io/) - [documentation](/docs/analytics/microanalytics.md)
15+
* [Pirsch](https://pirsch.io/) - [documentation](/docs/analytics/pirsch.md)
1516
* [Plausible Analytics](https://plausible.io/) - [documentation](/docs/analytics/plausible.md)
1617
* [Umami](https://umami.is/) - [documentation](/docs/analytics/umami.md)
1718
* [Wide Angle Analytics](https://wideangle.co/) - [documentation](/docs/analytics/wideangle.md)

docs/analytics/pirsch.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Pirsch
2+
3+
```toml
4+
[params.pirsch]
5+
code = "ABCDE"
6+
```

exampleSite/config.toml

+4
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ customRemoteJS = []
8888
# id = "ABCDE"
8989
# dnt = "false" # respect DNT tracker, "true" by default
9090

91+
# If you want to use Pirsch(https://pirsch.io) for analytics, add this section
92+
# [params.pirsch]
93+
# code = "ABCDE"
94+
9195
# If you want to implement a Content-Security-Policy, add this section
9296
# [params.csp]
9397
# childsrc = ["'self'"]

layouts/_default/baseof.html

+4
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@
108108
{{- partial "analytics/umami" . -}}
109109
{{ end }}
110110

111+
{{ if and .Site.Params.pirsch .Site.Params.pirsch.code }}
112+
{{- partial "analytics/pirsch" . -}}
113+
{{ end }}
114+
111115
{{- partial "body/extensions" . -}}
112116
</body>
113117

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<script async defer type="text/javascript" src="https://api.pirsch.io/pirsch.js"
2+
id="pirschjs"
3+
data-code="{{ .Site.Params.pirsch.code }}"></script>

0 commit comments

Comments
 (0)