ga_events 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -87,7 +87,8 @@ end
87
87
 
88
88
  Yes please! Use pull requests.
89
89
 
90
- ## More docs
90
+ ## More docs and tools
91
91
 
92
92
  * [Google Analytics: Event Tracking](https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide)
93
93
  * [Google Tag Manager: Custom Events](http://support.google.com/tagmanager/answer/2574372#GoogleAnalytics)
94
+ * [Chrome Web Store: Event Tracking Tracker](https://chrome.google.com/webstore/detail/event-tracking-tracker/npjkfahkbgoagkfpkidpjdemjjmmbcim)
data/REVIEW CHANGED
@@ -1,3 +1,3 @@
1
- Daniel: 2013-01-30 10:54
1
+ Daniel: 2013-01-31 09:00
2
2
  Flo: 2013-01-28 17:40
3
3
  Sven: 2013-01-29 10:10
@@ -32,11 +32,22 @@ class GaEvents.Event
32
32
  data =
33
33
  action: @action
34
34
  category: @category
35
- data.label = @label if @is_valid_value(@label)
36
- data.value = @value if @is_valid_value(@value)
35
+ data.label = @label if @is_present @label
36
+
37
+ if @is_present @value
38
+ # @value is a number and of type integer.
39
+ if isFinite(@value) and Number(@value) % 1 is 0
40
+ # Google Analytics expects a positive integer
41
+ if (value = parseInt @value) > -1
42
+ data.value = value
43
+ else
44
+ throw "Negative integers are not supported at this time."
45
+ else
46
+ throw "The parameter 'value' must be of type integer."
47
+
37
48
  @klass.adapter().push data
38
49
 
39
- is_valid_value: (value) -> value? and value != ''
50
+ is_present: (value) -> value? and value != ""
40
51
 
41
52
  jQuery =>
42
53
  @may_flush = true
data/ga_events.gemspec CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |gem|
8
8
  'daniel.bayerlein@nix-wie-weg.de']
9
9
  gem.description =
10
10
  %q{Google Analytics' Event Tracking everywhere in your Rails app}
11
- gem.summary = 'This gem alllows you to annotate events everywhere in ' \
12
- 'the code of your Rails app. A rack middleware is ' \
11
+ gem.summary = 'This gem allows you to annotate events everywhere in ' \
12
+ 'the code of your Rails app. A rack middleware is ' \
13
13
  'automatically inserted into the stack. It transports ' \
14
14
  'the event data to the client. Normal requests get a ' \
15
15
  'DIV injected, AJAX requests get a data-pounded custom ' \
@@ -1,3 +1,3 @@
1
1
  module GaEvents
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ga_events
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-01-30 00:00:00.000000000 Z
14
+ date: 2013-02-02 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -73,13 +73,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  version: '0'
74
74
  requirements: []
75
75
  rubyforge_project:
76
- rubygems_version: 1.8.24
76
+ rubygems_version: 1.8.25
77
77
  signing_key:
78
78
  specification_version: 3
79
- summary: This gem alllows you to annotate events everywhere in the code of your Rails
80
- app. A rack middleware is automatically inserted into the stack. It transports
81
- the event data to the client. Normal requests get a DIV injected, AJAX requests
82
- get a data-pounded custom HTTP header appended. The asset pipeline-ready CoffeeScript
79
+ summary: This gem allows you to annotate events everywhere in the code of your Rails
80
+ app. A rack middleware is automatically inserted into the stack. It transports the
81
+ event data to the client. Normal requests get a DIV injected, AJAX requests get
82
+ a data-pounded custom HTTP header appended. The asset pipeline-ready CoffeeScript
83
83
  extracts this data on the client side and pushes it to Google Analytics via ga.js
84
84
  or Google Tag Manager.
85
85
  test_files: []