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
928 stars 43 forks source link

Option to disable/remove campaign level tracking #276

Closed romainmenke closed 2 years ago

romainmenke commented 2 years ago

see : https://github.com/pirsch-analytics/pirsch/issues/95

We would prefer it if campaign related url params added by 3rd parties were not send to Pirsch. Is this something that can be configured in the client side script?

Kugelschieber commented 2 years ago

The easiest method to do that would be to copy the JS snippet and remove the parameters from the URL that's sent to us here: https://github.com/pirsch-analytics/pirsch/blob/master/js/pirsch.js#L88

You would then have to host the JS file yourself. I would recommend minifying it as we do in the package.json.

Here is a replacement for line 88 that will remove all query parameters:

"&url=" + encodeURIComponent((location.href.includes('?') ? location.href.split('?')[0] : location.href).substring(0, 1800)) +
romainmenke commented 2 years ago

Although we can make this change (we would also omit referrer) we would prefer not to host our own version.

As an agency we have projects that can last for ±10 years. The benefit of a hosted snippet for Pirsch is that it can be updated by you in case there is an API change.

We are looking for a low maintenance and maximally compliant service to gather minimal usage statistics.

Kugelschieber commented 2 years ago

What's the reason for this feature request? You could also just ignore the UTM panels on the dashboard. I would rather not inflate the script with too many configuration options.

Also, we don't make API-breaking changes. Should we ever rebuild the page view endpoint, we would publish it as /api/v2/... instead of replacing the current one.

romainmenke commented 2 years ago

https://www.cnil.fr/en/google-analytics-and-data-transfers-how-make-your-analytics-tool-compliant-gdpr

the removal of any parameters contained in the collected URLs (e.g. UTMs, but also URL parameters allowing internal routing of the site);

This guideline is why we would like not to send any query params to any 3rd party.

Kugelschieber commented 2 years ago

I'll add an option for it.

Kugelschieber commented 2 years ago

I have added three new options for the scripts that will be made available later today:

You can simply add them to the script like this:

<script defer type="text/javascript" src="https://api.pirsch.io/pirsch.js" 
    id="pirschjs" 
    data-code="YOUR_IDENTIFICATION_CODE"
    data-disable-query></script>
romainmenke commented 2 years ago

Thank you so much for this @Kugelschieber

We really appreciate that you are open to making this change and for rolling it out so quickly.