Count a signed-in person once, on any device
Without cookies, a returning visitor counts again each day and on each device. Pass the account ID people sign in with, and each person counts once.
Ultanimus teamOn this page3 sections
Without cookies, the visitor ID changes every day. Someone who reads your pricing page on Monday and signs up on Tuesday counts as two visitors, and opening your site on their phone makes three. Once someone signs in, pass the ID your database gives their account, and from then on they count as one visitor.
Pass the account ID
Use an ID such as u_8f2k1x or 4410, never an email address or a name.
With the script tag, render the ID into the snippet on pages for signed-in people, and leave the attribute out for everyone else:
<script defer src="https://cdn.ultanimus.com/s.js" data-site="YOUR_SITE_ID" data-user="u_8f2k1x"></script>With the React or Next.js package, give Analytics the signed-in user, or null when nobody is:
<Analytics site="YOUR_SITE_ID" user={session?.userId ?? null} />The script keeps the ID in memory until the next full page load, so render it from your main layout whenever someone is signed in. On a page that signs people in without a reload, call identify with the ID, and call identify(null) when they sign out.
What changes in your numbers
A signed-in person counts once over the whole range, on any device. A visit stays one visit when someone signs in halfway through, and a funnel keeps following the same person when they sign in between two steps.
The pages someone views before signing in keep the anonymous ID, so the visit where they sign in can add one extra visitor.
On Insight and up, events your server sends with the same user join the person's open visit and take its source, country and device. A paid order sent from your backend can then be the last step of a funnel.
What we store
We store a hash of your ID and the site ID in place of the visitor ID. We never store your ID itself, and the same ID on two of your sites gives two different hashes.
The hash stays the same every day and links one person's visits, which makes it personal data in many countries. Mention it in your privacy notice, and check whether your users need to agree to it first.
Signed-in users in the docs has the steps for each framework and what changes on each report.