Solved

Why are Does an Updated Email revert to Original Email?

  • 20 October 2021
  • 2 replies
  • 95 views

Badge +2

I'm seeing some weird behavior. I’m using nothing at all except identify in js ($email, no $id) and updateProfile on the backend.

 

  1. Create a new user first@email.com. That user is added to Klaviyo via identify in js using $email and not $id.
  2. The user shows up in Klaviyo as expected
  3. Change the email address. I get Klaviyo’s internal id for the user via a search for the email address. Then I call updateProfile with the internal id retrieved and update nothing but the email address, i.e. second@email.com
  4. Klaviyo shows the user renamed to second@email.com
  5. Browse to another page. Identify js passes in second@email.com
  6. Klaviyo creates a new profile for first@email.com
  7. After that, it’s all second@email.com, but first@email.com is still left over as a duplicate from step 5/6.

 

To recap: The updateProfile is working as expected, but the very next js identify is somehow recreating the previous email address even though I’m supplying the new email address to it. It's like the identify call insists on using the old email address just one last time.

 

Any help would be appreciated.

icon

Best answer by Taylor Tarpley 22 October 2021, 00:31

View original

2 replies

Userlevel 7
Badge +60

Hi @ryanklav

 

Welcome to the Community and thanks for sharing your question! 

 

It seems that the issue here centers around the email that was originally cookied in your webpage. The webpage you are using is already being cookied as first@email.com and although you are using API to change and update the email, because the browser is first cookied as the first email on the front end, navigating to another page will cause the cookie to follow over and be identified again. This is what’s causing a new profile to be created for first@email.com

 

Thanks for being a part of the Community! Hope this helps understand the issue! 

-Taylor 

 

Badge +2

Thank you @Taylor Tarpley . Immediately deleting the cookie when changing email address seems to work well.

Reply