amplitude / amplitude/Amplitude-TypeScript

Group identify is not working

未关闭
#199 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
TypeScript
星标
180
派生
68
平均合并
3 天 1 小时
30 天内合并 PR
29

描述

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

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。