Ruby access to the Mixpanel web analytics tool.
gem install mixpanel_client
or if you use a Gemfile
gem 'mixpanel_client'
require 'rubygems'
require 'mixpanel_client'
config = {'api_key' => 'changeme', 'api_secret' => 'changeme'}
client = Mixpanel::Client.new(config)
data = client.request do
# Available options
resource 'events/properties'
event '["test-event"]'
name 'hello'
values '["uno", "dos"]'
type 'general'
unit 'hour'
interval 24
limit 5
bucket 'contents'
from_date '2011-08-11'
to_date '2011-08-12'
on 'properties["product_id"]'
where '1 in properties["product_id"]'
buckets '5'
end
puts data.inspect
- Added options used in segmentation resources.
- Manually tested compatibility with Mixpanel gem.
- Added JSON to gemspec for ruby versions less than 1.9.
- Reverted to namespacing via module name because it's a better practice.
I.e. Use
Mixpanel::Client
instead ofMixpanelClient
. - Added 'values' as an optional parameter
gem install mixpanel_client --pre
- Minor housekeeping and organizing
- Refactored specs
- Changed "Mixpanel" class name to "MixpanelClient" to prevent naming collision in other libraries. a710a84e8ba4b6f018b7
Keolo Keagy (Author)
Mike Ferrier
Grzegorz Forysinski
Nathan Chong
Paul McMahon
Chad Etzel
Copyright (c) 2009+ Keolo Keagy. See LICENSE for details.