Skip to content

Instantly share code, notes, and snippets.

@tomafc330
Created February 8, 2014 00:13
Show Gist options
  • Save tomafc330/8874570 to your computer and use it in GitHub Desktop.
Save tomafc330/8874570 to your computer and use it in GitHub Desktop.
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