1window.analytics.track('Signed In', { 2browser: 'chrome' 3});
If you haven't implemented the .identify
call, please do that first before implementing the .track
method.
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.
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.
1window.analytics.track('Signed In', { 2browser: 'chrome' 3});
1analytics.track({ 2userId: 'USER_ID', 3event: 'Signed In', 4properties: { 5browser: 'chrome' 6} 7});
1analytics.track({ 2userId: 'USER_ID', 3event: 'Signed In', 4properties: { 5browser: 'chrome' 6} 7});
1analytics.track( 2user_id="USER_ID", 3event="Signed In", 4properties={"browser": "chrome"}, 5)
1Analytics.track( 2user_id: 'USER_ID', 3event: 'Signed In', 4properties: { 5browser: 'chrome' 6} 7)
1curl https://api.june.so/sdk/track 2-H "Content-Type: application/json" 3-H "Authorization: Basic YOUR_WRITE_KEY" 4-X POST 5 6{ 7"userId": "USER_ID", 8"event": "Signed in", 9"properties": { 10"browser": "chrome", 11}, 12"timestamp": "2012-12-02T00:31:38.208Z" 13}
If you're a B2B product, you most likely have multiple users using your product in a "workspace". June allows you to view your analytics at the "company" level.
See how to identify companies →Once you've implemented the .identify
method and are sending track events and don't need to track company behaviour, you're ready to jump into June.