Documentation
Onboarding guide
Get from zero to live analytics in minutes: installation, custom events, SaaS metrics, AI observability, and session replay.
Onboarding guide
Advanced configuration options for visitor identity, privacy settings, sampling, and more.
WysLeap identifies visitors with an anonymous ID stored in the browser (WysLeap.visitorId). There is no API to attach your own user IDs, and visitors aren't linked across devices. To analyze by account or plan, pass those values as properties on your events (see Custom Properties).
WysLeap.init({
siteId: 'your-site-id',
options: {
_apiKey: 'your-api-key',
sessionReplay: {
enabled: true,
maskSensitive: true,
sampleRate: 0.5, // 0.0 - 1.0 (default: 1.0)
// Session limits
inactivityTimeout: 60000, // Pause after 60s of inactivity
maxInactivityTimeout: 900000, // Stop completely after 15min idle
maxSessionDuration: 900000, // Max recording length (15min)
stopOnHidden: true, // Stop when tab goes to background
// Recording controls
recordMousemove: false, // Mouse movement (off by default)
recordClick: true, // Click events
recordScroll: true, // Scroll events
recordInput: true, // Form input changes
recordMedia: true, // Media element events
// Element-level filter (optional)
recordElement: null // e.g. ['#checkout', '.hero']
}
}
});data-sensitive, data-private or class="sensitive". Add class="rr-block" to leave an element out of recordings entirely.WysLeap.init({
siteId: 'your-site-id',
options: {
_apiKey: 'your-api-key',
privacy: true // Ask the server to anonymize IP addresses
}
});WysLeap sets no cookies, so there are no cookie options. To let a visitor opt out, call WysLeap.setConsent(false).
Pass the properties you want to segment by with each event:
WysLeap.trackEvent('report_exported', {
plan: 'enterprise',
accountType: 'business',
region: 'us-west'
});Page views in React, Vue, Angular and other SPAs are tracked automatically: the tracker records each route change (pushState, back/forward and hash changes) once, with the new page's title. No extra code is needed.
Call WysLeap.trackPageView() only if your app changes pages without changing the URL. Calling it on route changes as well is harmless: a second page view for the same URL within two seconds is ignored.
// Only for pages that change without a URL change
WysLeap.trackPageView();WysLeap sets no cookies. It keeps one random, anonymous visitor ID in the browser's local storage and anonymizes IP addresses. Device recognition is being tested in a measurement-only mode: it reads device characteristics to measure how well visitors who clear their storage could be recognized, and it is not used to identify anyone. For visitors in the EU/EEA, UK and Switzerland it only runs after you record their consent. Tell WysLeap when a visitor accepts or declines, for example from your consent banner's callback:
// Visitor accepted analytics / device recognition
WysLeap.setConsent(true);
// Visitor declined or withdrew consent: full opt-out. WysLeap stops
// tracking this browser (page views, events, replays, device
// recognition), removes the stored visitor ID, forgets its
// device-recognition links, and stays off on later visits until
// setConsent(true) is called.
WysLeap.setConsent(false);To require consent from every visitor, choose Only with consent under Device recognition in your site settings, or pass requireConsent: true. To turn device recognition off entirely, pass fingerprinting: false or choose Off in site settings. Visitors with Global Privacy Control or Do Not Track enabled are always skipped.
Your jurisdiction and how you use analytics decide whether you need a consent banner. Check with your privacy advisor, and mention WysLeap in your privacy policy.
sampleRate to record fewer sessionsrecordMousemove: false (default). Mouse movement is typically the largest share of event datarecordElement to record only specific page sectionsinactivityTimeout to pause on idleasync attributeFor complete API documentation, event schemas, and more examples:
View Full API Documentation →You've completed the onboarding guide. Start tracking your users and analyzing their behavior!