Skip to main content
Segment setup

Identify. Track. Group.

Updated over 7 months ago

Disclaimer:

Please note that you will only be able to get identify calls, group calls, and track events from your Segment data source. We do not support Segment's journeys, dashboards, etc.

There are 3 things you need to get started with Segment for June

1. Identify your users

In order to understand which users are using your product, you need to identify them with Segment's identify call. The best place to invoke the identify call is when a user signs up successfully or logs into your product.

Here's what a simple example of the code looks like:

// Please note that this only works for the Javascript SDK and the syntax depends on the SDK you decide to implement

analytics.identify("123", {
name: "Peter Gibbons",
email: "[email protected]",
plan: "premium",
logins: 5
});

2. Start instrumenting your product

There are multiple ways to instrument your product with Segment ⏤ track events and page events are the most popular methods.

Track events help you capture data based on your user's behaviour and what actions they take, e.g. when a user clicks on the signup button. How you instrument your product is up to you, but we recommend capturing the hot paths inside a user's journey inside your product.

Here's an example:

// Please note that this only works for the Javascript SDK and the syntax depends on the SDK you decide to implement

analytics.track("User Registered", {
plan: "Pro Annual",
accountType: "Facebook"
});

Page events are easiest to setup and capture all pages a user can visit inside your product. However, various browser ad blockers can impact page events.

3. Identify your companies (recommended for B2B)

The group call is identical to the identify call, except that it helps you identify companies (full workspaces) inside of your product instead of individual users. This will allow you to use our company-level reports inside of June and see which companies are using your product.

Make sure to pass the userId as well, so we can reconcile user and company data.

Here's an example:

// Please note that this only works for the Javascript SDK and the syntax depends on the SDK you decide to implement

analytics.group("0e8c78ea9d97a7b8185e8632", {
userId: 1,
name: "Initech",
industry: "Technology",
employees: 329,
plan: "enterprise",
"total billed": 830
});

4. Fine-tune your company tracking (recommended for B2B)

To make your company reports more accurate send the groupId in the context of your track calls.

// Please note that this only works for the Javascript SDK and the syntax depends on the SDK you decide to implement

analytics.track('Account upgraded', {
plan: "Pro
},
{
context: {
groupId: 2
}
});

❗️❗️ PS: June does not work with Screen events but only with Track Events❗️❗️

Did this answer your question?