I am doing it as per the recommendation in this thread: How to attach anonymous data to existing user after they log in?