README.rdoc in mixpanel-0.6.1 vs README.rdoc in mixpanel-0.7.0

- old
+ new

@@ -1,11 +1,11 @@ == What is Mixpanel (the service) ? Mixpanel is a real-time analytics service that helps companies understand how users interact with web applications. http://mixpanel.com -== What does this Gem? +== What does this Gem do? * Track events with properties directly from your backend. * Track events with properties through javascript using a rack middleware. @@ -20,13 +20,19 @@ Rails::Initializer.run do |config| config.middleware.use "MixpanelMiddleware", "YOUR_MIXPANEL_API_TOKEN" +If you want to use the asynchronous version of Mixpanel's javascript API + + Rails::Initializer.run do |config| + + config.middleware.use "MixpanelMiddleware", "YOUR_MIXPANEL_API_TOKEN", :async => true + In your application_controller class add a method to instance mixpanel. - before_filer :initialize_mixpanel + before_filter :initialize_mixpanel def initialize_mixpanel @mixpanel = Mixpanel.new("YOUR_MIXPANEL_API_TOKEN", request.env) end @@ -38,11 +44,22 @@ To track events after response with javascript... @mixpanel.append_event("Sign in", {:some => "property"}) +To execute any javascript API call + @mixpanel.append_api("register", {:some => "property"}) + @mixpanel.append_api("identify", "Unique Identifier") + + == Notes It is strongly recommended to call Mixpanel#track_event using an async lib like delayed job or similar, otherwise you will delay your server responses with mixpanel responses. + +== Collaborators and Maintainers + +* {Alvaro Gil}[https://github.com/zevarito] (Author) +* {Nathan Baxter}[https://github.com/LogicWolfe] +* {Jake Mallory}[https://github.com/tinomen]