mixpanel 0.9.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@
3
3
  Mixpanel is a real-time analytics service that helps companies understand how users interact with web applications.
4
4
  http://mixpanel.com
5
5
 
6
- == What does this Gem does?
6
+ == What does this Gem do?
7
7
 
8
8
  * Track events with properties directly from your backend.
9
9
  * Track events with properties through javascript using a rack middleware.
@@ -22,7 +22,9 @@ module Mixpanel
22
22
  end
23
23
 
24
24
  def track_event(event, properties = {})
25
- params = build_event(event, properties.merge(:token => @token, :time => Time.now.utc.to_i, :ip => ip))
25
+ options = { :token => @token, :time => Time.now.utc.to_i, :ip => ip }
26
+ options.merge!(properties)
27
+ params = build_event(event, options)
26
28
  parse_response request(params)
27
29
  end
28
30
 
@@ -69,11 +69,7 @@ module Mixpanel
69
69
  <script type='text/javascript'>
70
70
  var mpq = [];
71
71
  mpq.push(["init", "#{@token}"]);
72
- (function() {
73
- var mp = document.createElement("script"); mp.type = "text/javascript"; mp.async = true;
74
- mp.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + "//api.mixpanel.com/site_media/js/api/mixpanel.js";
75
- var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(mp, s);
76
- })();
72
+ (function(){var b,a,e,d,c;b=document.createElement("script");b.type="text/javascript";b.async=true;b.src=(document.location.protocol==="https:"?"https:":"http:")+"//api.mixpanel.com/site_media/js/api/mixpanel.js";a=document.getElementsByTagName("script")[0];a.parentNode.insertBefore(b,a);e=function(f){return function(){mpq.push([f].concat(Array.prototype.slice.call(arguments,0)))}};d=["track","track_links","track_forms","register","register_once","identify","name_tag","set_config"];for(c=0;c<d.length;c++){mpq[d[c]]=e(d[c])}})();
77
73
  </script>
78
74
  EOT
79
75
  else
@@ -2,7 +2,7 @@ files = ['README.rdoc', 'LICENSE', 'Rakefile', 'mixpanel.gemspec', '{spec,lib}/*
2
2
 
3
3
  spec = Gem::Specification.new do |s|
4
4
  s.name = "mixpanel"
5
- s.version = "0.9.0"
5
+ s.version = "1.0.0"
6
6
  s.rubyforge_project = "mixpanel"
7
7
  s.description = "Simple lib to track events in Mixpanel service. It can be used in any rack based framework."
8
8
  s.author = "Alvaro Gil"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mixpanel
3
3
  version: !ruby/object:Gem::Version
4
- hash: 59
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
+ - 1
7
8
  - 0
8
- - 9
9
9
  - 0
10
- version: 0.9.0
10
+ version: 1.0.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alvaro Gil
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-06-20 00:00:00 -03:00
18
+ date: 2011-09-28 00:00:00 -03:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency