Skip to main content

Installation

Or include via CDN:

userpilotSettings Object

Keep sessions and active flows across subdomains

Set crossSubdomainSessionCookie to true to keep a user’s session and in-progress flow when they move between subdomains. The SDK stores the session ID and flow progress in first-party cookies for the same user and session. This option defaults to false and has no effect when disableCookies is true.

Getting Started

To use the SDK, ensure it is loaded on your page. Then, you can call the available methods on the userpilot object.

Methods

identify(userId, )

Identifies the current user with an ID and optional properties.

anonymous()

Assigns a session-based unique ID for the current user on public pages.

reload()

Updates Userpilot content when the page state changes.

track(name, )

Tracks a custom event for the current user.

triggerById(contentId)

Forces specific Userpilot content to show for the current user.

on(event, callback)

Registers a callback for a Userpilot event.

Event Examples


off(event)

Removes a callback function attached to an event.

once(event, callback)

Registers a callback to be triggered only once.

end()

End the currently running flow.

clean()

Clears Userpilot storage and session data.

destroy()

Fully clears Userpilot storage and removes all active content.

suppress()

Fully stops Userpilot operations on the SDK side.

unsuppress()

Resumes SDK operations.

Parameters