WysLeap
WysLeap Docs

Known People

Count a logged-in person once across all their devices with WysLeap.identify() and userId on server events.

When someone logs in, signs up or submits a form, you know who they are. Tell WysLeap, and their visits on every device and browser count as one person. That also keeps returning-visitor numbers right on Safari and iPhone, where browser storage only lasts 7 days.

Before you start

  1. Turn it on. In Site Settings › Known people, switch on Identify logged-in visitors. Until then, identify() does nothing and server events with a userId are rejected.

  2. Update your consent banner and privacy policy. In the EU/EEA, UK and Switzerland, your banner's analytics option must say that it includes cross-device and logged-in measurement. For example:

    Analytics: we measure how you use our site, including recognizing you across devices when you're logged in, so we can improve it.

    A banner that only promises "anonymous visit counts" doesn't cover this. Check the wording with your privacy advisor.

Identify in the browser

Call WysLeap.identify(userId) once the person is logged in, for example right after login or on every page load while they're signed in:

WysLeap.identify("user_8812", { email: "ana@example.com" });
  • userId is your own stable ID for the person (not their email, which can change).
  • email is optional. It lets you look up or erase the person's data by email later.
  • Both are SHA-256 hashed in the visitor's browser before anything is sent, and WysLeap stores only a hash keyed to your site, so the same person can't be matched across different sites.
  • It does nothing for visitors who haven't consented or have opted out.

At logout, call WysLeap.reset() so the next person on that device starts with a new visitor ID:

WysLeap.reset();

Identify from your server

Add userId (and optionally email) to server events. WysLeap hashes them on arrival and never stores them raw:

curl -X POST https://wysleap.com/api/v1/events \
  -H "Authorization: Bearer $WYSLEAP_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "event": "Subscription Paid",
    "eventId": "evt_1Q2w3E",
    "userId": "user_8812",
    "visitorId": "vis_abc123",
    "value": 30,
    "currency": "USD"
  }'

Passing the browser's visitorId (from WysLeap.visitorId) as well links that browser to the person. Without it, the event still counts as the person.

setConsent also takes the visitor's choice per purpose, if your banner asks separately:

WysLeap.setConsent({
  measurement: true, // analytics; false is a full opt-out
  personalization: false, // tailoring your site to the person
  activation: false, // sending data to ad platforms
});

Each page view and event records the purposes it was collected under. Global Privacy Control always turns activation off.

How linking works

  • A person's browsers are linked to one ID, and dashboards count them once. Links can be undone, and the browsers keep their own IDs.
  • A browser that already belongs to a different person is never merged into another one.
  • A user ID seen on more than 20 browsers in 24 hours (a shared or test login) stops linking.
  • Identities expire 13 months after the person's last activity.
  • To see or delete a person's data, use look up and erase with their userId or email.