Identify users
See which users are using your product
Have you installed the June SDK?
If you haven't installed one of the June SDKs, please do that first before implementing the .identify method.
See how to install the June SDK →
Users
Overview
This section provides guidance on using the identify method to successfully identify your product's users. This will show you which users are triggering events in June. It is recommended to include this code snippet in the section of your code where user sign-ups, logins, or account details updates are handled.
Code
Replace USER_ID with a unique identifier, preferably the user ID from your database. Including the user's email is also suggested, along with any additional "traits" like avatar, name, role, etc. This information will appear on the user's profile and can be used to filter users in reports.
💡 Not sure which traits to add? We automatically map some standard ones: check out our guide
window.analytics.identify('USER_ID', {
email: 'test@example.com',
// Optional
name: 'Joe Bloggs',
avatar: 'https://avatar.com/asd809sdhoif9as10nc29.png'
// Add anything else about the user here
});
analytics.identify('USER_ID',{
email: 'test@example.com',
// Optional
name: 'Joe Bloggs',
avatar: 'https://avatar.com/asd809sdhoif9as10nc29.png'
// Add anything else about the user here
});
analytics.identify({
userId: 'USER_ID',
traits: {
email: 'test@example.com',
// Optional
name: 'Joe Bloggs',
avatar: 'https://avatar.com/asd809sdhoif9as10nc29.png'
// Add anything else about the user here
}
});
analytics.identify(
user_id="USER_ID",
traits={
"email": "test@example.com",
# Optional
"name": "Joe Bloggs",
"avatar": "https://avatar.com/0sd9fsd8y97a0sf99asd.png",
# Add anything else about the user here
},
)
Analytics.identify(
user_id: 'USER_ID',
traits: {
email: "test@example.com"
# Optional
name: "Joe Bloggs",
avatar: "https://avatar.com/d78979as8hlsa9088f.png"
# Add anything else about the user here
}
)
curl https://api.june.so/sdk/identify
-H "Content-Type: application/json"
-H "Authorization: Basic YOUR_WRITE_KEY"
-X POST
{
"userId": "USER_ID",
"traits": {
"email": "test@example.com",
# Optional
"name": "Joe Bloggs",
"avatar": "https://avatar.com/0sd9fsd8y97a0sf99asd.png",
# Add anything else about the user here
},
"timestamp": "2012-12-02T00:31:38.208Z"
}
Next: Track user behaviour
Once you've implemented the identify method in your codebase, it's time to track what your users are doing in your product.