Segment alias + identify ( server / client )

#1

Hey,

I noticed Expo’s Segment doesn’t support alias.

Segment creates an anonymous id for the session
When a user registers, we’re supposed to call alias.

alias takes the anonymousId and sets it to previousId
alias takes the newly generated user id and sets it to the userId

Since alias isn’t supported on the client, I have to call alias on the server, but since I don’t know the anonymous id, I can’t get the anonymousId to sync the users.

Our workflow is simple:
The first thing you have to do is enter a phone #, then get a confirmation code.
You are either a new user (call alias) or a previous user (just call identify)

Does anyone have any suggestions for how I can make this work? We have soo many duplicate users in mixpanel

Thanks!

1 Like

#2

I can be totally wrong but, previousId seems to be something I can set.

I think my workflow will be:

  • User enters phone number

  • (CLIENT) Segment.identify(phone)

  • User confirms sms token sent to phone

  • (SERVER) If new user: Segment.alias(previous: phone, userId: newly generated user id)

  • Send new id to client

  • (CLIENT) Segment.identifyWithTraits(new user Id)

0 Likes

#3

Also running into this, doesn’t seem possible in-app to use the aliasing or autotrack from https://segment.com/docs/destinations/mixpanel/

1 Like

#4

Created a canny feature request

https://expo.canny.io/feature-requests/p/missing-segmentalias

1 Like

closed #5

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

0 Likes