Developer Installation Guide

How to Install

To get the Userpilot running on your app simply copy and paste the snippet below after the beginning <body> tag on every page where you want the content to appear for your users.

<script src = "https://deploy.userpilot.io/App Token.js"></script>
<script>
  userpilot.identify(
    "UNIQUE USER ID", // Used to identify users 
    { 
         name: "John Doe", // Full name 
         email: "customer@example.com", // Email address 
         created_at: "1519205055" // Signup date as a Unix timestamp 
         // Additional user properties 
         // projectId: "1"
    }     
  );
</script>

IMPORTANT: Don't forget to fill in the "App Token" with your own app token. Also, you will need to pass the "UNIQUE USER ID" to help Userpilot identify each user.

You are encouraged to pass additional user data to help you target specific segments of your user base as well as personalize Experiences.

If you want to trigger the Experience on pages where users are logged out, you can simply call userpilot.anonymous(); instead of userpilot.identify();.This will trigger the Experience anonymously without the need to pass any user data.

Note: If your user’s data changes in some way without a page load, you should call the userpilot.identify() method. This will cause Userpilot to check for any new changes to the user’s data. You only need to include whatever has changed — you don’t need to include all user data in each update.

 userpilot.identify( 
    "<UNIQUE USER ID>", // Used to identify users 
    { 
        plan: "paid"
    }     
);

Track Custom Events

Add more power to your segments by tracking custom user events. This is extremely useful to analyze feature adoption and create more powerful segments.

// You can track your events using the "Track" method 
<script>
 userpilot.track("Event");
</script>

// You can also specify more information about your event 
<script> 
 var meta = {URL: "/growth"};
 userpilot.track("Page Event", meta);
</script>
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.