Identifying Users
Last updated
Last updated
Beware, this guide requires basic coding and javascript knowledge.
If you will be using personally identifiable information (PII) in your identifier, please include this in your privacy policy. HockeyStack bears no responsibility for holding this type of data.
It is just as important to know who your users are as what actions they’ve performed.
You can send both a unique identifier (usually email but can also be another id, username etc.) and any other custom properties (plan, role, company etc.) of your users to HockeyStack.
Bear in mind that using this method does not send a separate action to HockeyStack, it only updates the properties of that user. For sending custom actions, see Tracking Custom Goals.
As mentioned before, this unique identifier is in most cases the email of the user. However, if you know the consequences (ask us!), you can send any other unique identifier - like an id or a username - here as well.
For this method, you would need HockeyStack to be already loaded in the website. See the disclaimer for more technical info. Then, anywhere in your JavaScript, include:
Change the script to include data-identity
.
Add the highlighted section to your integration snippet:
Add the highlighted line to your integration snippet:
You can also send custom properties other than an identifier! It works similar to sending an identifier, but instead, you use an object:
You can send Strings, Numbers or Booleans as custom properties.
You should be very careful whether the HockeyStack object has been defined in the code at that point or not. If not defined, your users can get an error that would prevent the rest of the script (where you added the identify
function) from executing.
In order to overcome this error:
1. Or you can check whether the HockeyStack object is undefined.
2. Or you can put a try-catch block around the identify function:
3. You can add another script that creates the HockeyStack buffer object: