Answered

Duplicate users when using Javascript SDK to track logged-in users

  • 8 June 2021
  • 1 reply
  • 5 views

Hi,

 

I'm having issues with duplicate users appearing in Intercom

 

The problem appears to be isolated to users who were previously leads on Intercom that have an 'email' and 'user_id' attributes. It appears that the user_id attribute is automatically created when they are created as leads.

 

When I use the tracking script as follows:

 

Intercom('boot', {

app_id: 'abc12345',

email: 'john.doe@example.com',

created_at: 1234567890,

name: 'John Doe',

});

 

It creates a new account for the user, presumably because the use cannot be identified by their email.

 

However when I add their user_id into the tracking script - it stops tracking their sessions altogether. Here is the script I'm using for this:

 

Intercom('boot', {

app_id: 'abc12345',

email: 'john.doe@example.com',

created_at: 1234567890,

name: 'John Doe',

});

 

Any ideas how to stop duplicate accounts being created for these users?

icon

Best answer by Roy 9 June 2021, 00:58

View original

1 reply

Userlevel 1
Badge

Hi @abrar​ 😎 ,

 

When you are providing Intercom user_id or e-mail in JavaScript API it will save it as a user record.

 

If you want to merge existing lead to the user profile, suggesting to take a look at the following article:

Merge lead and user profiles.

 

More information about JavaScript API and Data Attributes can be found here:

Javascript API: Attributes & Objects.

 

I hope this will be helpful, let me know if you have any further questions about this topic.

Always happy to help 😊

 

Best,

Roy

Reply