Skip to content

Commit

Permalink
Remove distinct id in properties
Browse files Browse the repository at this point in the history
  • Loading branch information
robbie-c committed Jan 23, 2025
1 parent 396334c commit edbb5dd
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ async function cookielessServerHashStepInner(
})

const newEvent = { ...event }
const newProperties: Properties = { ...event.properties }
const newProperties: Properties = { ...event.properties, $distinct_id: undefined }

newProperties['$device_id'] = hashToDistinctId(baseHashValue)
const identifiesRedisKey = getRedisIdentifiesKey(baseHashValue, teamId)
Expand Down Expand Up @@ -403,9 +403,7 @@ async function cookielessServerHashStepInner(
hashExtra,
})
// event before identify has been called, distinct id is the sentinel and needs to be replaced
const distinctId = hashToDistinctId(hashValue)
newEvent.distinct_id = distinctId
newProperties['$distinct_id'] = distinctId
newEvent.distinct_id = hashToDistinctId(hashValue)
} else {
const numIdentifies = await hub.db.redisSCard(identifiesRedisKey)

Expand Down

0 comments on commit edbb5dd

Please sign in to comment.