Created
June 24, 2013 21:51
-
-
Save cmorss/5853935 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
identify: (options = {}) => | |
callback = options.callback | |
delete options.callback | |
attrs = _.extend options, "Account": App.name | |
if App.params.utm_campaign | |
attrs["Campaign Type"] = App.params.utm_medium | |
attrs["Campaign"] = App.params.utm_campaign | |
if App.user | |
attrs = _.extend attrs, | |
email : App.user.get("email") | |
name : App.user.get("name") || App.user.licensingContact?.get("name") | |
created : App.user.get("created") | |
"Demographics" : (App.user.get("demographics") || []).join(", ") | |
"Tags" : App.user.tags.join(", ") | |
analytics.identify App.user.get("id"), attrs, callback | |
else | |
analytics.identify attrs, callback |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment