|
require 'mixpanel-ruby'
class Analytics
def self.track(user_id, event_name, url = '')
tracker = Mixpanel::Tracker.new('8f581bbd244b7ee0f4762d322ac617e8')
# Tracks an event, 'Sent Message',
# with distinct_id user_id
if url != ''
tracker.track(user_id, event_name, { 'lookup_url' => url})
else
tracker.track(user_id, event_name)
end
end
end
|