Use this file to discover all available pages before exploring further.
There are three ways to install Userpilot: directly via JavaScript, which requires only a few minutes from an engineer; through Segment, if your web application already has it installed; or via Google Tag Manager (GTM), allowing you to install it yourself if GTM is already set up.
JavaScript
Segment
Google Tag Manager
1
Step 1: Install JavaScript Snippet
Copy the snippet and paste it at the beginning of your <head> section in your index.html file on every page you want to use Userpilot.Your App Token can be found under the Environment tab.
You can include the staging token on staging environments
2
Step 2: Identify Users
The user ID (a unique identifier) is required. Additional user and company properties can also be included in the script.
PII Data NoticeBefore passing any Personally Identifiable Information (PII) such as names, emails, or other sensitive user data to Userpilot:
Security & Compliance: Verify internally with your legal, security, and compliance teams that doing so aligns with your organization’s data privacy policies and applicable regulations (e.g., GDPR, CCPA).
Data Type Mapping: Ensure correct data type mapping for all properties. Userpilot supports String, Numeric, and Date types. Make sure dates are in ISO8601 format and numeric values are properly formatted. Incorrect type mapping can cause issues with segmentation, analytics, and debugging.
Debugging: Proper data formatting is crucial for effective debugging and troubleshooting. Verify that your data maps correctly to Userpilot’s expected formats before implementation.
Multi-page Applications
The userpilot.identify() call is used on each page to identify the user and determine if they should see Userpilot content.
<script> userpilot.identify( "UNIQUE_USER_ID", // Used to identify users { name: "John Doe", // Full name email: "customer@example.com", // Email address created_at: '2019-10-17', // ISO8601 Date company: { id: "UNIQUE_COMPANY_ID", // Required, used to identify the company name: "Acme Labs", //created_at: '2019-10-17' // ISO8601 Date }, // Additional properties // projectId: "1", // trialEnds: '2019-10-31' // ISO8601 Date } );</script>
Single page Applications
You only have to call this function once, upon a successful user authentication.The following is an example of how Userpilot’s identify function is called in the app’s entry point only when the user is successfully authenticated.localStorage.get("token") is an example method of authentication.
Userpilot must be reloaded on every route change through Userpilot’s reload function. In the following example, we call the reload function in the route change watcher file (in our case it is auth.guard.ts).The following is an example of how Userpilot’s identify function is called in the app’s entry point only when the user is successfully authenticated.
Sending coded events to Userpilot is recommended to utilize the events in reports, in-app triggering, and segmenting users.Use the userpilot.track() call to track actions users take in your application.If you use an analytics tool (e.g. Mixpanel, Amplitude, Hotjar, FullStory, Google Analytics) add theuserpilot.track() wherever you’re already tracking events. You can also pass extra metadata alongside the event’s name to pass unique information about the event.
userpilot.track("signed up");//triggered when a user signs up. Helps track activationuserpilot.track("churned");//triggered when a user cancels or becomes inactive. Useful for retention analysisuserpilot.track("plan upgraded", {from_plan: “Starter”,to_plan: “Growth”});//triggered when a user upgrades their plan. Helps track conversions and upsellsuserpilot.track("payment completed", {amount: “$500”,invoice_number: “12345”});//triggered when a payment is completed. Useful for tracking revenue and billing success
This will Install Userpilot on the client side where the data will be sent from the webpage itself.
1
Step 1: Sign in to Segment
You are required to have a Segment account and have Segment fully installed on your web application
Segment’s Identify method analytics.identifymust be called on every page reload. Without identifying the user, Userpilot won’t attempt to show content to the users.
2
Step 2: Add the Userpilot Destination
From the main menu, click on the Catalog tab, then click on the Destination tab.
Search for and select “Userpilot Web (Actions)”.
Choose the source you want to pass the data from and continue the setup steps and click on “Create Destination”
After completing the setup steps, fill out the app token field with your token.
In order to send data to Userpilot through a back-end server, you will need to follow the steps below
1
Step 1: Add the backend destination
Navigate to the Destinations tab and select “Add Destination
Search for “Userpilot Cloud (Actions)” and add the destination
2
Step 2: Select the data source
Choose the source you want to pass the data from
3
Step 3
Fill in the required values; you can find the API Key and the API Endpoint in your Userpilot account under the Environment tab, ensure that you copy the API Key correctly.
Yes! If you have Userpilot installed via Segment, events will be sent to Userpilot as soon as the analytics.track() method is called and will appear in the Events tab. For more details on the Segment track method, click here
Does Userpilot support group properties?
Absolutely, Group properties will appear under Companies in Userpilot
Installing Userpilot with google tag manager is an easy way to get up and running in no time. To get started we first need to create an account on google tag manager and install GTM code into your app.
In order to start displaying Userpilot content on your app, we first need to create a new Custom HTML tag
Next, we will add the deployment script below to the HTML box.
As for the triggering setting, it should be set to “All pages”
You will need to pass all properties including the unique user ID directly to the data layer.
PII Data NoticeBefore passing any Personally Identifiable Information (PII) such as names, emails, or other sensitive user data to Userpilot:
Security & Compliance: Verify internally with your legal, security, and compliance teams that doing so aligns with your organization’s data privacy policies and applicable regulations (e.g., GDPR, CCPA).
Data Type Mapping: Ensure correct data type mapping for all properties. Userpilot supports String, Numeric, and Date types. Make sure dates are in ISO8601 format and numeric values are properly formatted. Incorrect type mapping can cause issues with segmentation, analytics, and debugging.
Debugging: Proper data formatting is crucial for effective debugging and troubleshooting. Verify that your data maps correctly to Userpilot’s expected formats before implementation.
Note: You will need to replace the “appToken” with your account app token
Step 2: Calling userpilot.reload()If you have a Single Page App (SPA) you will need to trigger the userpilot.reload() function on every page URL change.
To do that we will need to create a new Custom HTML tag.
Then simply add the code below in the HTML box.
<script> userpilot.reload();</script>
After that, we need to set the Triggering to “History Change”. The “History Change” trigger will run the tag only when the URL has been updated.