TapCub is live — analytics, insights and live chat, free on one platform
Help center

How do I call login to identify a user?

The four identity methods, what each stores, and the IDs that are rejected.

Product analytics1 min readLast updated Oct 28, 2026TapCub teamPart of Identify users across web, app and mini-programs

Still have a question?

Could not find it? A person reads every message, usually within a few hours on business days.

Chat with us

Short answer

Call tapcub.login(id, props) after your own sign-in succeeds, bind() to add more identifiers, and logout() on sign-out. The id is required (up to 200 characters); emails are lowercased and hashed, phone numbers are normalised.

The four methods

After identified mode is on, the script exposes four methods. Call login after your own sign-in succeeds and logout when the user signs out:

app.js
// after your sign-in succeeds
tapcub.login('u_123', { $name: 'Ada', plan: 'pro' });

// add other identifiers for the same person
tapcub.bind({ unionid: 'UNION_ID' });

// on sign-out
tapcub.logout();
MethodWhat it does
login(id, props, opts)id required, up to 200 characters. opts.type defaults to your login ID and may be email, mobile, OpenID or UnionID. Emails are lowercased and hashed; phone numbers lose spaces and dashes. Name, email and phone in props go to the profile.
bind(ids)Adds further IDs to the same person. One login-type ID per person; up to five each of email, mobile and UnionID.
logout()Clears the login and rotates the session marker, so the next visitor on a shared device starts fresh.
setProps / setPropsOnceOverwrite profile fields, or write a field only when it is empty — first campaign, for example.

IDs that are rejected

Placeholder IDs are refused so a whole crowd does not collapse into one “user”: anonymous, guest, null, all-zeros and -1 are rejected and show as warnings on the identity map.

Calling before the identity module has loaded fails — queue the call or wait for the ready event. Exact method names are in the SDK reference.

Did this answer your question?

We use your answers to fix and expand this page.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics