Home
What is June?
Install

Users

Identify
Track behaviour

Companies

Identify
Track behaviour
Log in

Browser

Integrate June with your web page

Installing

Install the tracking script in the <head> tag of your website.

You need to be logged in to begin!

Log in

Identifying users

You can use the identify method to identify your users. Replace USER_ID with the unique identifier for the user in your database.

1
window.analytics.identify('USER_ID', {
2
email: 'test@example.com',
3
});

Identifying companies (optional)

You can use the group method to identify your companies. Replace GROUP_ID and USER_ID with the unique identifier for the company and user in your database.

1
window.analytics.group('GROUP_ID', 'USER_ID', {
2
name: 'Acme Inc',
3
});

Send track events

In order to track user behaviour, you can use the track method.

Note: If you're identifying companies, you should pass the groupId in the track context, as shown in the example below. Replace GROUP_ID and USER_ID with the unique identifier for the company and user in your database.

1
window.analytics.track(
2
'Created Account',
3
{
4
plan: 'Pro',
5
},
6
{ context: { groupId: 'GROUP_ID' } },
7
);

Our SDK is based on Segment's SDK. You can find more documentation here: https://segment.com/docs/connections/sources/catalog/libraries/website/javascript