## Tracking groups

## See what groups are doing inside your product

## Groups

## Have you started identifying your groups?

If you haven't implemented the `.group` call for groups, please do that first before implementing the `.track` method for groups.

[See how to identify groups →](/content/docs/advanced/group/index.html)

## Overview

This guide will teach you how to successfully track how your groups (workspaces, departments, projects, etc.) are being used in your product. You can associate events with multiple groups simultaneously, creating a hierarchy of relationships. For example, you can track an event that belongs to a specific workspace, department, and project all at once.

**Note**: If you have already implemented the `.track` call for users, you can just add the `groups` object within the `properties` with the right group types and group IDs. There is no need to add additional `.track` calls for groups.

## Code

Replace `USER_ID` with your user identifier, and include a `groups` object within the `properties` with the right group types and group IDs. You can associate events with multiple group types by including their respective IDs.

```javascript
window.analytics.track('signed_in', {
  method: 'sso',
  plan: 'enterprise',
  groups: {
    group: 'group_id',
    department: 'department_id',
    project: 'project_id'
  }
});
```

```javascript
analytics.track('signed_in', {
  method: 'sso',
  plan: 'enterprise',
  groups: {
    group: 'group_id',
    department: 'department_id',
    project: 'project_id'
  }
});
```

```javascript
analytics.track({
  userId: 'USER_ID',
  event: 'signed_in',
  properties: {
    method: 'sso',
    plan: 'enterprise',
    groups: {
      group: 'group_id',
      department: 'department_id',
      project: 'project_id'
    }
  }
});
```

```python
analytics.track(
  user_id="USER_ID",
  event="signed_in",
  properties={
    "method": "sso",
    "plan": "enterprise",
    "groups": {
      "group": "group_id",
      "department": "department_id",
      "project": "project_id"
    }
  }
)
```

```coffeescript
Analytics.track(
  user_id: 'USER_ID',
  event: 'signed_in',
  properties: {
    method: 'sso',
    plan: 'enterprise',
    groups: {
      group: 'group_id',
      department: 'department_id',
      project: 'project_id'
    }
  }
)
```

```curl
curl https://api.june.so/sdk/track
-H "Content-Type: application/json"
-H "Authorization: Basic YOUR_WRITE_KEY"
-X POST

{
  "userId": "USER_ID",
  "event": "signed_in",
  "properties": {
    "method": "sso",
    "plan": "enterprise",
    "groups": {
      "group": "group_id",
      "department": "department_id",
      "project": "project_id"
    }
  },
  "timestamp": "2012-12-02T00:31:38.208Z"
}
```

## Ready to jump into June?

Once you've implemented the SDK, you're ready to jump into June.

[Go to June →](https://analytics.june.so/)
