forked from deepStateMirrors/tabi
✨ feat(analytics): make Umami DNT behavior configurable (#536)
Co-authored-by: welpo <welpo@users.noreply.github.com>
This commit is contained in:
parent
23a1baf96c
commit
9b115904d7
6 changed files with 16 additions and 4 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]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
+++
|
||||
title = "Domina la configuració de tabi: guia completa"
|
||||
date = 2023-09-18
|
||||
updated = 2025-06-08
|
||||
updated = 2025-06-16
|
||||
description = "Descobreix les múltiples maneres en què pots personalitzar tabi."
|
||||
|
||||
[taxonomies]
|
||||
|
@ -802,6 +802,8 @@ Pots configurar-los en la secció `[extra.analytics]` del teu arxiu `config.toml
|
|||
- Per a Umami: `"https://umami.example.com"`
|
||||
- Per a Plausible: `"https://plausible.example.com"`
|
||||
|
||||
- `do_not_track`: (només per a Umami) opcional. Quan s'estableix com a `true`, es desactiva el seguiment per als usuaris els navegadors dels quals envien una capçalera "Do Not Track".
|
||||
|
||||
Un exemple de configuració per a GoatCounter no auto-allotjada seria:
|
||||
|
||||
```toml
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
+++
|
||||
title = "Domina la configuración de tabi: guía completa"
|
||||
date = 2023-09-18
|
||||
updated = 2025-06-08
|
||||
updated = 2025-06-16
|
||||
description = "Descubre las múltiples maneras en que puedes personalizar tabi."
|
||||
|
||||
[taxonomies]
|
||||
|
@ -803,6 +803,8 @@ Puedes configurarlos en la sección `[extra.analytics]` de tu archivo `config.to
|
|||
- Para Umami: `"https://umami.example.com"`
|
||||
- Para Plausible: `"https://plausible.example.com"`
|
||||
|
||||
- `do_not_track`: (sólo para Umami) opcional. Cuando se establece en `true`, se desactiva el seguimiento para los usuarios cuyos navegadores envían un encabezado "Do Not Track".
|
||||
|
||||
Un ejemplo de configuración para GoatCounter no auto-alojada sería:
|
||||
|
||||
```toml
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
+++
|
||||
title = "Mastering tabi Settings: A Comprehensive Guide"
|
||||
date = 2023-09-18
|
||||
updated = 2025-06-08
|
||||
updated = 2025-06-16
|
||||
description = "Discover the many ways you can customise your tabi site."
|
||||
|
||||
[taxonomies]
|
||||
|
@ -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" 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