Skip to content

Instantly share code, notes, and snippets.

@mberman84
Created October 25, 2013 17:40
Show Gist options
  • Save mberman84/7158727 to your computer and use it in GitHub Desktop.
Save mberman84/7158727 to your computer and use it in GitHub Desktop.
Load Mixpanel
def load_mixpanel
@mixpanel ||= Mixpanel::Tracker.new "#{mixpanel_key}", { :env => request.env }
if current_user
@mixpanel.append_people_identify mixpanel_distinct_id
mixpanel_set(mixpanel_distinct_id, current_user.mixpanel_properties)
@mixpanel.append("name_tag", current_user.email)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment