1POST https://api.june.so/sdk/track
1POST https://api.june.so/sdk/track
This action is used to track the identification of a user or an anonymous user.
Returns a JSON response with a status of 200
and a success
key set to true
.
1{ 2"status": 200, 3"success": true 4}
Parameter | Type | Description | Required |
---|---|---|---|
userId | String | The ID for this user in your database. Note: At least one of userId or anonymousId must be included in any track call. | Optional |
anonymousId | String | An ID associated with the user when you don’t know who they are (for example, the anonymousId generated by analytics.js). Note: You must include at least one of userId or anonymousId in all track calls. | Optional |
event | String | The name of the event you’re tracking. It is recommended to use human-readable names like Song Played or Status Updated. | Required |
properties | Object | A dictionary of properties for the event. For instance, if the event was Product Added, it might have properties like price or product. | Optional |
timestamp | Date | A JavaScript date object representing when the track took place. If the track just happened, leave it out and the server’s time will be used. If you’re importing data from the past, make sure to send a timestamp. | Optional |
context | Object | A dictionary of extra context to attach to the call. Note: context differs from traits because it is not attributes of the user itself. | Optional |
1POST https://api.june.so/sdk/track 2 3{ 4"userId": 'USER_ID', 5"event": 'Signed In', 6"properties": { 7"browser": 'chrome' 8} 9}
In order to track company event, you need to pass groupId
in the context object.
1POST https://api.june.so/sdk/track 2 3{ 4"userId": 'USER_ID', 5"event": 'Signed In', 6"properties": { 7"browser": 'chrome' 8}, 9"context": { 10"groupId": "1" 11} 12}