ga_events 0.1.1 → 0.1.2
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.
- data/README.md +2 -1
- data/REVIEW +1 -1
- data/app/assets/javascripts/ga_events.js.coffee +14 -3
- data/ga_events.gemspec +2 -2
- data/lib/ga_events/version.rb +1 -1
- metadata +7 -7
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
|
@@ -32,11 +32,22 @@ class GaEvents.Event
|
|
|
32
32
|
data =
|
|
33
33
|
action: @action
|
|
34
34
|
category: @category
|
|
35
|
-
data.label = @label if @
|
|
36
|
-
|
|
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
|
-
|
|
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
|
|
12
|
-
'the code of your Rails app.
|
|
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 ' \
|
data/lib/ga_events/version.rb
CHANGED
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.
|
|
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-
|
|
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.
|
|
76
|
+
rubygems_version: 1.8.25
|
|
77
77
|
signing_key:
|
|
78
78
|
specification_version: 3
|
|
79
|
-
summary: This gem
|
|
80
|
-
app.
|
|
81
|
-
|
|
82
|
-
|
|
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: []
|