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:

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

Segment's identify docs

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:

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

Segment's track event docs

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.

Segment's page event docs

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:"0e8c78ea9d97a7b8185e8632", { 
userId: 1,
name: "Initech",
industry: "Technology",
employees: 329,
plan: "enterprise",
"total billed": 830

Segment's group docs

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.

analytics.track('Account deleted', { 
userId: 1,
context: {
groupId: 2

Segment's context doc

Did this answer your question?