mirror of
https://github.com/welpo/tabi.git
synced 2025-10-10 23:38:53 +02:00
✨ feat(analytics): make Umami DNT behavior configurable
This commit is contained in:
parent
23a1baf96c
commit
fe4e9b6163
4 changed files with 9 additions and 1 deletions
|
@ -372,6 +372,9 @@ service = "goatcounter"
|
|||
# Leave this field empty if you're using the service's default hosting.
|
||||
self_hosted_url = "https://tabi-stats.osc.garden"
|
||||
|
||||
# Optional: For Umami, enable this option to respect users' Do Not Track (DNT) settings. The default is true.
|
||||
do_not_track = true
|
||||
|
||||
# giscus support for comments. https://giscus.app
|
||||
# Setup instructions: https://welpo.github.io/tabi/blog/comments/#setup
|
||||
[extra.giscus]
|
||||
|
|
|
@ -811,6 +811,8 @@ You can set them up in the `[extra.analytics]` section of your `config.toml`.
|
|||
- For Umami: `"https://umami.example.com"`
|
||||
- For Plausible: `"https://plausible.example.com"`
|
||||
|
||||
- `do_not_track`: (Umami only) Optional. When set to `true`, the generated tracking script will include the `data-do-not-track="true"` attribute, which disables tracking for users whose browsers send a "Do Not Track" (DNT) header.
|
||||
|
||||
An example configuration for non-self-hosted GoatCounter would look like this:
|
||||
|
||||
```toml
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
data-website-id="{{ analytics_id }}"
|
||||
src="https://cloud.umami.is/script.js"
|
||||
{% endif %}
|
||||
data-do-not-track="true">
|
||||
{% if config.extra.analytics.do_not_track %}data-do-not-track="true"{% endif %}>
|
||||
</script>
|
||||
|
||||
{% elif analytics_service == "plausible" %}
|
||||
|
|
|
@ -320,6 +320,9 @@ custom_subset = true
|
|||
# Leave this field empty if you're using the service's default hosting.
|
||||
# self_hosted_url = ""
|
||||
|
||||
# Optional: For Umami, enable this option to respect users' Do Not Track (DNT) settings. The default is true.
|
||||
do_not_track = true
|
||||
|
||||
# giscus support for comments. https://giscus.app
|
||||
# Setup instructions: https://welpo.github.io/tabi/blog/comments/#setup
|
||||
[extra.giscus]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue