Skip to content

Commit

Permalink
feat(server): add segment user id (#3193)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeepc authored Sep 28, 2023
1 parent 2350cb8 commit 1926818
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/analytics/segment.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,14 @@ func (t segmentTracker) Track(name string, props map[string]string) error {
p = p.Set(k, v)
}

userID := t.serverID
if p["user_id"] != nil {
userID = p["user_id"].(string)
}

return t.client.Enqueue(segment.Track{
Event: name,
UserId: t.serverID,
UserId: userID,
Properties: p,
Context: &segment.Context{
Direct: true,
Expand Down

0 comments on commit 1926818

Please sign in to comment.