Browser SDK reference
Track actions, inspect consent and identify a permitted persistent visitor.
On this page
Available global
The script exposes window.weeveo after loading. There is no separate published Weeveo npm or Python SDK required for these methods. REST examples later in these docs use standard language HTTP clients.
| Method | Arguments | Result / behavior |
|---|---|---|
| track() | none | Manual pageview |
| track(name) | event name string | Custom event, subject to consent and name validation |
| track(object) | { name?, url? } | Named event at a path, or a pageview when name is omitted |
| identify(id, data) | stable user ID, optional { email } | Identity event only with separate purpose consent and persistent identity |
| setConsent(choice, purposes?) | granted or denied; optional recording / identification booleans | Updates choice and returns the applied state |
| getConsent(purpose?) | analytics (default), recording or identification | Current permission state |
| getConsentRecord() | none | Status, timestamp, version, notice URL, mode and purpose flags |
| getSession() | none | { projectId, visitorId }; visitorId may be undefined |
Track an action
window.weeveo?.track("signup_complete");
window.weeveo?.track({ name: "pricing_cta", url: "/pricing" });Names must start with a letter, use letters, digits, spaces, underscores, dots, colons or hyphens, and be at most 64 characters. Strings containing eight consecutive digits are rejected. Do not put names, emails, order IDs or free text into event names.
Add declarative tracking
<button data-weeveo-event="pricing_cta">View plans</button>Declarative clicks require automatic tracking to be enabled. The legacy data-umami-event attribute is also recognized.
Understand the data boundary
The current tracker accepts event names and sanitized paths, not an arbitrary custom-properties analytics store. Ordinary custom properties are discarded. Internal numeric performance and engagement fields are allowlisted. Passing a second object to track(name, properties) does not create custom property reports.
Read session information
const session = window.weeveo?.getSession();
// visitorId is available only when persistent identity is permitted.The return value does not include a public sessionId. Do not invent an ID or assume cookieless visitor continuity. See identification for payment matching.
Still looking for an answer? Try troubleshooting or get in touch.