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 = MixpanelAPI::Client.new(config)
data = client.request('events/properties', {
event: 'splash features',
name: 'feature',
values: '["uno", "dos"]',
type: 'unique',
unit: 'day',
interval: 7,
limit: 5,
})
puts data.inspect
require 'rubygems'
require 'mixpanel_client'
config = {api_key: 'changeme', api_secret: 'changeme', parallel: true}
client = MixpanelAPI::Client.new(config)
first_request = client.request('events/properties', {
...
})
second_request = client.request('events/properties', {
...
})
third_request = client.request('events/properties', {
...
})
...
client.run_parallel_requests
puts first_request.response.handled_response
puts second_request.response.handled_response
puts third_request.response.handled_response
List of rake tasks.
rake -T
Run specs.
rake spec
Run external specs.
cp config/mixpanel.template.yml config/mixpanel.yml
vi config/mixpanel.yml
rake spec:externals
Update version
vi lib/mixpanel/version.rb
Commit and push local changes
git commit -am "Some message."
git push
git status
Create tag v2.0.2 and build and push mixpanel_client-2.0.2.gem to Rubygems
rake release
- Parallel requests option.
- NOTE: This version breaks backwards compatibility.
- Use a regular ruby hash instead of metaprogramming for mixpanel options.
- Added some more options.
- Added some more options.
- Added support for the raw data export API.
- BASE_URI is now https.
- Changed funnel to funnel_id.
- Updated json dependency to 1.6.
- Added timezone to available options.
- All exceptions can be caught under MixpanelAPI::Error.
- 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
MixpanelAPI::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
Feel free to add your name and link here.
Keolo Keagy (Author)
Bill DeRusha
Jason Logsdon
James R
Mike Ferrier
Grzegorz Forysinski
Nathan Chong
Paul McMahon
Chad Etzel
Copyright (c) 2009+ Keolo Keagy. See LICENSE for details.