1window.analytics.identify('USER_ID', { 2email: 'test@example.com', 3// Optional 4name: 'Joe Bloggs', 5avatar_url: 'https://avatar.com/asd809sdhoif9as10nc29.png' 6// Add anything else about the user here 7});
If you haven't installed one of the June SDKs, please do that first before implementing the .identify
method.
This document 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.
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_url, name, role, etc. This information will appear on the user's profile and can be used to filter users in reports.
1window.analytics.identify('USER_ID', { 2email: 'test@example.com', 3// Optional 4name: 'Joe Bloggs', 5avatar_url: 'https://avatar.com/asd809sdhoif9as10nc29.png' 6// Add anything else about the user here 7});
1analytics.identify('USER_ID', 2traits: { 3email: 'test@example.com', 4// Optional 5name: 'Joe Bloggs', 6avatar_url: 'https://avatar.com/asd809sdhoif9as10nc29.png' 7// Add anything else about the user here 8});
1analytics.identify({ 2userId: 'USER_ID', 3traits: { 4email: 'test@example.com', 5// Optional 6name: 'Joe Bloggs', 7avatar_url: 'https://avatar.com/asd809sdhoif9as10nc29.png' 8// Add anything else about the user here 9} 10});
1analytics.identify( 2user_id="USER_ID", 3traits={ 4"email": "test@example.com", 5# Optional 6"name": "Joe Bloggs", 7"avatar_url": "https://avatar.com/0sd9fsd8y97a0sf99asd.png", 8# Add anything else about the user here 9}, 10)
1Analytics.identify( 2user_id: 'USER_ID', 3traits: { 4email: "test@example.com" 5# Optional 6name: "Joe Bloggs", 7avatar_url: "https://avatar.com/d78979as8hlsa9088f.png" 8# Add anything else about the user here 9} 10)
1curl https://api.june.so/sdk/identify 2-H "Content-Type: application/json" 3-H "Authorization: Basic YOUR_WRITE_KEY" 4-X POST 5 6{ 7"userId": "USER_ID", 8"traits": { 9"email": "test@example.com", 10# Optional 11"name": "Joe Bloggs", 12"avatar_url": "https://avatar.com/0sd9fsd8y97a0sf99asd.png", 13# Add anything else about the user here 14}, 15"timestamp": "2012-12-02T00:31:38.208Z" 16}
Once you've implemented the identify
method in your codebase, it's time to track what your users are doing in your product.