Comment on page
JavaScript API
Userlove JavaScript supports the following events & methods as part of its API
userlove("identify", {
id: "YOUR_USER_ID",
userData: {
name: "John Doe",
email: "[email protected]",
},
});
userlove("track", { event: "CustomEventName" });
userlove("track", {
event: "CustomEventName",
data: {
name: "123456789",
price: 299.99,
},
});
userloveMethods.launchProductTour("YOUR-TOUR-ID");
This function allows you to start a product tour anytime without verifying any trigger or segment conditions. You only need to pass the unique tour ID as a single argument to the function.
userloveMethods.hideProductTour("YOUR-TOUR-ID");
You can use this function to dismiss a product tour or trigger the completed event. If the product tour is already completed, the function will fire the completed event. Otherwise, it will dismiss the product tour. You need to pass the unique Tour ID of that product tour as a single argument to this function.
userloveMethods.launchSurvey("YOUR-SURVEY-ID");
This function can be used to launch a survey at any time, without checking the trigger or segment conditions. You only need to provide the survey ID, which you can copy from the survey list.

userloveMethods.hideSurvey("YOUR-SURVEY-ID");
You can use this function to trigger a dismiss or completed event for a survey. When the function is called, if the survey is already completed and displaying a thank you screen, it will fire the completed event. In any other case, it will dismiss the survey. You only need to pass the unique survey ID as a single argument to the function.
userloveMethods.launchChecklist("YOUR-CHECKLIST-ID");
This function can be used to start a checklist at any time, regardless of any triggers or segment conditions. You just need to provide the unique checklist ID as a single parameter.
userloveMethods.hideChecklist("YOUR-CHECKLIST-ID");
This function triggers a dismiss event or a completed event for a checklist. If the checklist is already completed or displaying a congratulatory screen, calling this function will fire the completed event. Otherwise, it will dismiss the checklist. It required a single argument, which is the unique ID of the checklist.
Last modified 7mo ago