Userlove - Help Center
Go to UserloveContact Support
  • Getting Started
    • What is Userlove?
    • Installation
    • JavaScript Installation
    • Installing with Google Tag Manager
    • Install the Chrome Extension
    • FAQs
  • User Experiences
    • How to create Product Tour?
    • How to create Surveys?
      • Web-App Survey
      • Sharable Survey
    • How to create Checklist?
    • How to create DemoX?
      • Record with chrome extension
      • Build manually
    • Segments and Filters
    • Create Net Promoter ScoreĀ® (NPS)
    • Styling & Customization
  • Developers
    • JavaScript API
  • Sandbox
    • How to use sandbox
  • Account & Subscriptions
    • Account
    • Team, roles & permissions
    • Security
    • Manage your subscription
  • Contact Us
  • Changelog
    • Version: 1.2.2
    • Version: 1.2.3
    • Version: 1.2.4
    • Version: 1.3.1
    • Version: 1.3.2
    • Version: 1.3.3
    • Version: 1.3.4
    • Version: 1.4.1
    • Version: 1.4.2
    • Version: 1.4.3
    • Version: 2.1.1
    • Version: 2.1.2
    • Version: 2.3.1
    • Version: 2.3.3
    • Version: 2.3.4
    • Version: 2.4.1
    • Version: 2.4.2
    • Version: 2.4.3
    • Version: 3.1.1
    • Version: 3.1.2
    • Version: 3.1.3
    • Version: 3.1.4
  • Profile & Security
    • Profile Settings
  • SSO Setup
    • SSO using SAML
Powered by GitBook
On this page
  1. Developers

JavaScript API

Userlove JavaScript supports the following events & methods as part of its API

Examples

Identify the current user

userlove("identify", {
  id: "YOUR_USER_ID",
  userData: {
    name: "John Doe",
    email: "john@example.com",
  },
});

Track event

userlove("track", { event: "CustomEventName" });

Track event with custom data

userlove("track", {
  event: "CustomEventName",
  data: {
    name: "123456789",
    price: 299.99,
  },
});

Launch Product Tour

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.

Hide Product Tour

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.

Launch Survey

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.

Hide Survey

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.

Launch Onboarding Checklist

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.

Hide Onboarding Checklist

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.

PreviousStyling & CustomizationNextHow to use sandbox

Last updated 2 years ago