amplitude / amplitude/Amplitude-TypeScript

Group identify is not working

Open
#199 4 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
180
Forks
68
Avg merge
3d 1h
Merged PRs (30d)
29

Description

The group tracking (assigning a group, group properties) does not add data to the events in Amplitude.

## Expected Behavior
The following code should add data to `groups` and `group_properties` field of tracked events, but it does not do that.

```ts
amplitude.setGroup('Workspace', workspaceId)
const groupIdentity = new amplitude.Identify()
groupIdentity.set('workspaceId', workspaceId)
amplitude.groupIdentify('Workspace', workspaceId, groupIdentity, {
user_id: userId,
})

amplitude.track('CTA click', eventProperties, {
user_id: userId,
})
```

## Current Behavior

Since this new library is finally something for JS/Node that has implicitly documented group behavior, I thought it will work better or be less verbose than the older libraries. It turns out there is no group info getting to amplitude. Is there anything that I am missing?

There is nothing in groups and group properties in raw event data:
![Screenshot 2022-08-22 at 13 46 26](https://user-images.githubusercontent.com/3315662/185913906-98213f0d-e929-4266-bd75-bcb945ab3038.png)

There is no Group name (Group Type) in [Account lookup](https://analytics.amplitude.com/deepnote/account-activity)
![Screenshot 2022-08-22 at 13 45 07](https://user-images.githubusercontent.com/3315662/185913692-ca999556-bf8e-4079-820a-1cc5085f198e.png)

## Possible Solution
I don't know the culprit here, the whole group identity setup is pretty complex, all Amplitude client libraries do it differently, Segment does it differently. I am not sure if the mistake here is just in how the API is being called or there is some functionality not implemented yet.

## Steps to Reproduce
1. Run the code above.
2. Check raw event data in amplitude.

## Environment
- JS SDK Version: 0.4.0
- Installation Method: Yarn (3)
- Browser and Version: Brave 1.42.88

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.