pirsch-analytics / pirsch

Pirsch is a drop-in, server-side, no-cookie, and privacy-focused analytics solution for Go.
https://pirsch.io
GNU Affero General Public License v3.0
918 stars 42 forks source link

Programmatically prevent tracking #225

Closed fschucht closed 2 years ago

fschucht commented 2 years ago

There should be a way to prevent tracking, for example by setting a value in the local storage. Right now the script only seems to ignore events if do not track is enabled. However some browsers, like Safari are not supporting it anymore. Right now when I visit my own page from an iPhone or iPad all my visits are being tracked without any possibility to prevent it.

Kugelschieber commented 2 years ago

Hi Fabian,

it's legally not required to ask for consent, as no personally identifiable information (PII) is collected. You can still add a consent banner to your website that only loads the Pirsch script if the user accepts tracking.

I don't know if we can do something to replicate the DNT behavior if it's not supported by Safari. Do you know of any alternative?

Kugelschieber commented 2 years ago

Maybe we can add a consent script alternative that shows a banner.

fschucht commented 2 years ago

My main use case would be to be able to exclude my own events from being tracked. Ideally I don’t have to show a banner for this.

Currently I use Plausible and am trying Pirsch as an alternative. Plausible allows me to set a plausible_ignore flag in the local storage. I set it using a “disable tracking” button in my privacy policy. It would be great if the same approach would work with Pirsch.

For that Pirsch would need to check if a disable_Pirsch value exists in local storage in addition to the do not track check. It would provide more flexibility than a consent banner as everyone can build their own functionality around it.

Kugelschieber commented 2 years ago

Sounds good! I'll add an option like that to the script :)

Kugelschieber commented 2 years ago

Done. You can set the disable_pirsch variable to 1 (or any other value).

Kugelschieber commented 2 years ago

Docs: https://docs.pirsch.io/get-started/frontend-integration/#ignoring-your-own-page-views