I have a tracking client now added to the new version of the datatasks website (not released yet). The website uses NextJS, so I have kind of the easiest session-id implementation as starter:
Since NextJS is a SPA we generate a unique ID when the page is loaded and as long someone does not reload the page the id stays the same. Not perfect but works for my use case.
What are other ways to have an anonymous session id?
Plausible Analytics has a smart way to generate the user id based on:
daily salt + user-agent + ip-address as hash
They rotate the salt on a daily base. The only problem might be Apple’s announcement to block IP-addresses in Safari with the upcoming new OS versions.
The old way would be to generate a uuid and add it to all links on the website, so it can be read from the url. Not really nice.