Skip to content

Instantly share code, notes, and snippets.

@jondkinney
Created July 22, 2013 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jondkinney/6054885 to your computer and use it in GitHub Desktop.
Save jondkinney/6054885 to your computer and use it in GitHub Desktop.
:javascript
analytics.identify(#{current_user.id}, {
email: '#{current_user.email}',
name: '#{current_user.display_name}',
company: '#{current_user.company.try(:name)}',
created: '#{current_user.created_at}',
roles: '#{current_user.roles.map(&:name).join(',')}',
accredited_investor: '#{current_user.accredited_investor?}',
pending_accreditation: '#{current_user.pending_accreditation?}',
accepted_terms: '#{current_user.accepted_terms?}',
current_campaign_name: '#{camp_name}',
current_campaign_status: '#{camp_status}',
rails_env: '#{Rails.env.to_s}'}, {
intercom: {
user_hash: '#{OpenSSL::HMAC.hexdigest("sha256", "#{Rails.env.production? ? 'r4pges3r' : 'oNsb84urGt4KXC9P54Xr4_cuwQv31yyAHs8yDGl0'}", current_user.id.to_s)}',
app_id: "#{Rails.env.production? ? 'lqs8w42b' : 'lalc679p'}"
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment