Every user has stored properties. It is possible to set custom user data that can be viewed inside the dashboard for each individual user.

Default Properties

Each user has all properties listed above that are set by Splitbee.

Define own ID for backend tracking and merging

If your users are authenticated and using your app on different devices you need to provide a property called userId in order to merge users & just keep only user in Splitbee.

You can set the userId property using splitbee.user.set({userId:'yourUniqueId'})

If you don't set a userId, Splitbee will use the id or email property as unique userId

Set user display name using JavaScript

The Splitbee JS library is exposed on the global window object called splitbee.

Use the splitbee.user.set() function to store data to a user.

splitbee.user.set({plan:"Enterprise", appVersion: '1.0.0'})
splitbee.user.set({displayName: "Anna"})
splitbee.user.set({email: "[email protected]"})

This function can be called at any time. It will overwrite all fields that are sent within the object.

Example of sending multiple calls

Setting user data on page load

splitbee may be undefined if you invoke it directly after loading the script. To solve this, you can use the "onload" property of the script tag.

<script async src="<https://cdn.splitbee.io/sb.js>"
  onload="if(window.splitbee) splitbee.user.set({ email: '[email protected]'})">
</script>