1window.analytics.identify('USER_ID', { 2email: 'test@example.com', 3});
Install the tracking script in the <head>
tag of your website.
You can use the identify
method to identify your users. Replace USER_ID
with the unique identifier for the user in your database.
1window.analytics.identify('USER_ID', { 2email: 'test@example.com', 3});
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.
1window.analytics.group('GROUP_ID', 'USER_ID', { 2name: 'Acme Inc', 3});
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.
1window.analytics.track( 2'Created Account', 3{ 4plan: '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