Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
this.createOrGetUser = function () {
if (!localStorage.vs_user) {
localStorage.vs_user = Math.random().toString(36).substring(3);
mixpanel.identify(localStorage.vs_user);
mixpanel.people.set({
"$created": new Date(),
"$last_login": new Date()
});
}
return localStorage.vs_user;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment