Javascript API

The Userpilot Javascript SDK officially supports the following methods.

identify (userId, [properties])

Identifies the current user with an ID and an optional set of properties.

userpilot.identify("123", {
    name: "John",
    email: "john@example.com",
    created_at: "1519205055"
});

anonymous

Assign a session based unique ID for the current user.

reload

Update Userpilot content when there is a change in the page state.

track (name, [properties])

userpilot.track("invitedAgent", {
    name: "Sam",
    email: "sam@example.com"
});

Tracks a custom event taken by the current user.

trigger (contentId)

Force a certain Userpilot content to show for the current user. This method completely overrides any targeting conditions has been set for that content. 

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.