Intercom user creation/updates seems very non-deterministic

We’ve integrated the Intercom messenger into our single page app with the react-intercom library. We instantiate the component by providing the email and user_id of the user. As best I can tell, you guys create a new user in the dashboard when someone signs into the app for the first time based on this information correct? When the app first loads after sign-in I can see two POST calls go out to https://api-iam.intercom.io/messenger/web/ping that contain the user data in the following format:

{"email":"ethan.bower@candidpartners.com","user_id":"58d642e3-665a-4010-8ff8-0d62fb80053d","anonymous_id":"b916760d-cd4a-4076-b2c9-f44ffe1c1dc7"}

If I refresh the app while already logged in, I see both calls go out with a fully populated user_data object like that. However, when I first log in one of the POST calls is dispatched early and goes out with an empty user_data object that looks like

{"email":"","anonymous_id":"b916760d-cd4a-4076-b2c9-f44ffe1c1dc7"}

When it goes right, the user is created in the dashboard with the email and user_name fields populated respectively, and the name field populated with the email.

The issue I’m seeing is that sometimes the email address doesn’t seem to make it through as described above. So the user is created in the dashboard with the user_id field populated, the email field set to “Unknown” and the name field populated with the user_id. This can even happen on subsequent logins with an existing user.

For example: I had a user logged in and was able to see both the email and user_id properly populated in the dashboard. I logged out with that user, then logged back in, and the dashboard updated WITHOUT the email for that user. It was replaced with the user_id. So not only does the dashboard not seem to be always getting complete information, but it’s overwriting existing information WITH the incomplete information.

The thing that is really confusing is the fact that I’ve never seen an instance of the user_id being sent without the email. It’s either both or neither. So I’m lost as to how the user_id could even show up in the dashboard without the email also being there.

The main reason this is an issue for us is that if someone initiates a conversation through the messenger, and for whatever reason their email isn’t set in the dashboard they’re identified by their user_id which is just a UUID, so not very helpful as far as knowing who we’re talking to.

I’m not sure if this is an issue on our end or yours. Maybe we should be explicitly sending the name field in order to populate it with the email? I was just hoping you guys could help clear this up and maybe shed some light into how exactly users are created/updated in Intercom when they log into our app.

Thanks!

Hey Ethan, first off welcome to the forum!

While we don’t officially support React, if you write into the Messenger on your Intercom workspace one of our engineers can take a look at the logs that are coming in to give you a better idea of how this process is occurring.

We’ll be on the lookout for a message from you :+1: