Track user behaviour
See what users are doing inside your product
Users
Have you started identifying your users?
If you haven't implemented the .identify call, please do that first before implementing the .track method.
Overview
This guide will teach you how to successfully track how your users are using your product.
Once you've identified them, you can track what they are doing, which features they use, how often and much more. You can use the track method to track events on behalf of your users. Add this code snippet to basic features like "signed up", "logged in" and any additional events that may track the core features of your product.
For June, one of our core features is when a user loads and creates a report. Therefore, we have a "loaded report" and "created report" event.
Code
Replace USER_ID with your own unique identified, ideally the user ID from your database. Passing additional information is possible using the properties object.
In the following example, it's important to call the .identify call before the .group call, because the .group call will attach the current identified user.
window.analytics.track('Signed In', {
browser: 'chrome'
});
analytics.track('Signed In', {
browser: 'chrome'
});
analytics.track({
userId: 'USER_ID',
event: 'Signed In',
properties: {
browser: 'chrome'
}
});
analytics.track(
user_id="USER_ID",
event="Signed In",
properties={"browser": "chrome"},
)
Analytics.track(
user_id: 'USER_ID',
event: 'Signed In',
properties: {
browser: 'chrome'
}
)
curl https://api.june.so/sdk/track
-H "Content-Type: application/json"
-H "Authorization: Basic YOUR_WRITE_KEY"
-X POST
{
"userId": "USER_ID",
"event": "Signed in",
"properties": {
"browser": "chrome"
},
"timestamp": "2012-12-02T00:31:38.208Z"
}
Ready to jump into June?
Once you've implemented the SDK, you're ready to jump into June.