Skip to content

Instantly share code, notes, and snippets.

@kpnemo
Created April 29, 2015 15:11
Show Gist options
  • Select an option

  • Save kpnemo/bc67a64160e381d191b1 to your computer and use it in GitHub Desktop.

Select an option

Save kpnemo/bc67a64160e381d191b1 to your computer and use it in GitHub Desktop.
var Users = CTV_T.getModule('Users');
if (Users != null && Users.fetchCurrentUser != null) {
var currentUser = Users.fetchCurrentUser();
if (currentUser.isLoggedIn()) {
CTV_T._analytics.identify(currentUser.toJSON().id, {
name: currentUser.get('name'),
email: currentUser.get('email'),
created_at: currentUser.get('created_at'),
loginTime: currentUser.get('loginTime')
});
CTV_T._analytics.people.set();
CTV_T._analytics.alias(currentUser.toJSON().id, CTV_T._analytics.get_distinct_id());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment