Closed abridger closed 2 years ago
Thanks for the request!
See also https://github.com/plausible/analytics/discussions/136
Aha! I hadn't seen that. Thanks for the pointer :smile:
This is now live: Specify a custom location to aggregate pages that contain identifiers.
Detailed Description
We have an issue at Giki where user IDs form part of the URL. This means that any information that we send with the URL attached would in theory be traceable back to a user. We'd love to be able to remove the unique IDs from the URL or obfuscate them in some way so that we can see which pages within their account users are viewing, without being able to link this back to specific users. The best way for us to do this at the moment seems to be creating a small wrapper around Plausible, where we can call the
trackEvent
andtrackPageview
functions and pass in a sanitizedurl
in the props.Context
Possible Implementation
It might be possible to provide a function for the Plausible init options that could either be called to produce the current URL (a default could just return
location.href
as currently, but developers could implement their own to filter out or obfuscate URLs as needed) or a specific URL sanitizer function (a default could just return the string provided, but a developer could provide one that does any transformation or filtering required). The function we would supply for either of these would just return thelocation.href
string with anything matching a UUID regex replaced.Thanks!