Home
What is June?
Install

Users

Identify
Track behaviour

Companies

Identify
Track behaviour
Log in

Identify your companies

See which companies are using your product

Have you started identifying your users?

If you haven't implemented the .identify call, please do that first before implementing the .group method.

See how to identify users →

Overview

If you're a B2B product, you most likely have multiple users using your product in a "workspace". This document provides guidance on using the group method to successfully identify companies using your product.

This will allow you to track usage at the company level in June, as well as viewing individual company profiles and the users that belong to each company. It is recommended to include this code snippet in the section of your code next to your identify call, i.e. where users sign up or login.

Code

Replace USER_ID and GROUP_ID with a unique identifier, preferably the user ID and workspace ID from your database. Including the company's name is also suggested, along with any additional "traits" like avatar_url, company_size etc. This information will appear on the companies profile and can be used to filter companies in reports.

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.

1
window.analytics.group('GROUP_ID', {
2
name: 'Acme Inc',
3
// Optional
4
avatar_url: 'https://avatar.com/asd809sdhoif9as10nc29.png
5
// Add anything else about the company here
6
});

Next: Track company behaviour

Once you've implemented the group method in your codebase, it's time to track what your companies are doing in your product.

See how to track company behaviour →