When I make an identify call with a customer id sent as the userId, and email as a trait, this creates a new user entry in Klaviyo. When an email is opened by the same email, a new user is created. I now have two user entries for the same email in Klaviyo. One created with userId as the primary identifier, and the other created using email.
As far as I can see you would never want to identify a user in Klaviyo with anything other than email, as this leads to multiple users for the same email address. As Segment recommends not identifying on email, it would be great if this integration had the option to send the email trait as userId. I'm imagining a toggle in the Segment integration UI, 'Use email as userId', I'm not sure what it would require in the code here.
This is from Klaviyo support:
When integrating with Segment, you should always have the email address as the primary identifier. If you use an ID number as the primary identifier, Klaviyo has no way of automatically preventing duplicates โ that would have to be done by a custom script on your end to check for duplicates before sending an identify call to Klaviyo. In other words, Klaviyo by default does alias users on email address, but submitting data based on unique ID from Segment overrides that behavior.
The existing work around is to make two identify calls, one to Klaviyo, the other to the rest of your integrations. But this kind of defeats the point of Segment.