Skip to main content

Identify users

You can identify logged in users and send metadata to Produktly using the window.Produktly.identifyUser function.

User id should be unique per user, e.g. primary key, or uuid, and it should stay the same for each user. Metadata should be an object, to send e.g. the plan the user is subscribed to, or the access role, or anything else you might want to segment users by.

// window.Produktly.identifyUser(your_user_id, metadata)
// For example:
window.Produktly.identifyUser(123, {
plan: "startup",
companyId: 42,
createdAt: "2021-10-26T12:33:52Z",
});

// If you are running into issues where window.Produktly isn't yet loaded when you are calling it,
// you can use the window.onload event listener:
window.onload = () => {
window.Produktly.identifyUser(123, {
plan: "startup",
companyId: 42,
createdAt: "2021-10-26T12:33:52Z",
});
};

The properties you send here, can be used for custom user segmentation. With our matching engine you can use the properties to more granularly select which users a tour should show to. Select a tour, then go to "Tour settings", and under "Tour triggers" you will find these custom properties.

Need more help? Check out examples/solutions

Security

You can optionally enable identity verification to prevent bad actors from impersonating users. This requires signing the user ID with a private key on your backend. Learn more about identity verification.