lib/mixpanel/tracker.rb in mixpanel-0.9.0 vs lib/mixpanel/tracker.rb in mixpanel-1.0.0

- old
+ new

@@ -20,10 +20,12 @@ def append_api(type, *args) queue << [type, args.map {|arg| arg.to_json}] end def track_event(event, properties = {}) - params = build_event(event, properties.merge(:token => @token, :time => Time.now.utc.to_i, :ip => ip)) + options = { :token => @token, :time => Time.now.utc.to_i, :ip => ip } + options.merge!(properties) + params = build_event(event, options) parse_response request(params) end def ip @env.has_key?("REMOTE_ADDR") ? @env["REMOTE_ADDR"] : ""