Calling Identify vs Reload Methods
Below is a complete explanation between calling userpilot.identify()
and userpilot.reload()
and when to use each function.
Userpilot Identify
- This function is mainly called on the page first reload passing the user unique ID and other properties about the user. These properties will help Userpilot in personalizing and accurately target specific users. Here is an example of such use
-
userpilot.identify( "443", { name: "James", created_at: "1519205055", plan: "Trial" // Additional user properties // projectId: "1" // trialEnds: '2019-10-31T09:29:33.401Z' } );
- You can call
userpilot.identify()
multiple times on the same page passing the user unique ID and any new user properties. For example, if the user changed their app color from green to blue, we can just call -
userpilot.identify( "443", { color: "blue", } );
Userpilot Reload
- Calling
userpilot.reload()
function should only be called after identifying the user. Calling the function before identifying the user won't really do anything. - The main usage of
userpilot.reload()
function is to refresh the current Userpilot content and display new content based on the current URL of the page, a good use for callinguserpilot.reload()
happens in the Single Page Apps such as React & Angular. More about that explained here