#Install ruby require 'rubygems' require 'mixpanel_client' #How to get totals visitors: config = {api_key: 'changeme', api_secret: 'changeme'} client = Mixpanel::Client.new(config) data = client.request('segmentation', { event: 'Kelisto', from_date: '2014-01-01', to_date: '2014-03-01', values: ['Direct', 'SEO Content', 'SEO Generic', 'SEO Community', 'SEM Branded'], on: 'properties["last_touch_source"]' type: 'general', unit: 'minute', }) puts data.inspect #How to get conversions from Car Insurance Process props = { event: "Car insurance process view", from_date: '2014-01-01', to_date: '2014-03-01', on: 'properties["last_touch_source"]', type: 'general', unit: 'minute' } props.merge!({where: 'properties["Page name CI"] == "Provider Redirect"'}) unless where.nil? data = client.request('segmentation', props) puts data.inspect #How to get conversions from Communications product props = { event: "Page interaction", from_date: '2014-01-01', to_date: '2014-03-01', on:'properties["last_touch_source"]', type: 'general', unit: 'minute' } props.merge!({where: '"communications" in properties["Referral type"]'}) data = client.request('segmentation', props) puts data.inspect #How to get conversions from Finances product props = { event: "Page interaction", from_date: '2014-01-01', to_date: '2014-03-01', on: 'properties["last_touch_source"]', type: 'general', unit: 'minute' } props.merge!({where: '"personal-finance" in properties["Referral type"]'}) data = client.request('segmentation', props) puts data.inspect