More in Product analytics
- Autocapture and the AI event inbox
- Build a funnel that explains drop-off
- Identify users across web, app and mini-programs
- What is autocapture, and how does it work?
- How do I review and accept events in the inbox?
- What are unplanned events, and how do I manage them?
- When should I use a funnel instead of a goal or path?
- How do I build a funnel?
- How do I read where a funnel drops off?
- What is identified mode, and should I turn it on?
- How is one person merged across devices?
- How does identity work on apps and mini-programs?
- How do I track clicks on outbound links?
- How do I track file downloads?
- How do I track form submissions?
- How do I track custom events?
- How do I track button clicks?
- How do I create a heatmap?
- How do I track scroll depth?
- How do I track ecommerce purchases and revenue?
- How do I set up goals and track conversions?
- How do I query my data with SQL?
- How do I create a custom metric?
- How do I analyze accounts with groups?
- How do I connect AI agents with MCP?
- How do I ask the AI assistant about my data?
- How do I create user segments?
- How do I run an RFM analysis?
- How do I record and watch session replays?
- How do I analyze user paths?
- How do I build a retention report?
- How do I analyze how an event is distributed?
- How do I create a tracking plan?
- How do I view a user’s profile and activity?
- How do I read the lifecycle report (new, returning, resurrecting, dormant)?
- How do I compare attribution models for a conversion?
- All guides in this category
Still have a question?
Could not find it? A person reads every message, usually within a few hours on business days.
Chat with usShort 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:
// 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();| Method | What 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 / setPropsOnce | Overwrite 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.
Couldn’t send. Please try again in a minute.
Thanks for the feedback. We’ll use it to improve this page.You’ve already sent feedback on this page. Thanks.