ga_events 0.1.6 → 0.1.7

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.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ODBkOTkyODRlNzNiN2Y0YmExMDdkZmVmOGYyZThjZTliMzVjMjIyYw==
5
+ data.tar.gz: !binary |-
6
+ ZTY5NzA1ODEyZjZiZmJjZjhiZjgxYzM3MzdhMzQ1M2E0NzRmOWE2Mg==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ YjIzMWFjMjU0MjZjYmE0ZDQ2MGZlMWZlZTUyMzI0OTQ4YzA1MzVlNDcwNzNl
10
+ ZDQyMmQ5ZDIxYjJjOTgyNmJiMjhiZDc1MTkxOWJjOTA4N2RkZWE3ZThiZGI5
11
+ NmZjY2RhZmQzZjA5Yzc0MjMyYjFiZjE3OGY4OTE1NWI5N2YzY2I=
12
+ data.tar.gz: !binary |-
13
+ ZmNmNDRlMTI1ZDQ3NTk5YThjZjE4MTY3Zjk2NThlMmQ5ZjhjMjFmYWU2OWVl
14
+ ZGQ1MjljNmMzZGI5ZWM2ZjZmODM1YTYxZGQ0NTIwNTZlNGQwM2YzYWE0NDc0
15
+ NzM1ZGI0ZWU1ZTFiODVkYTZiNmQ2MWE1YjRmYjliYThmN2E2YTA=
@@ -14,7 +14,7 @@ class GaEvents.Event
14
14
  # Decompose a dom-string (ruby side) into an event object.
15
15
  @from_string: (string) ->
16
16
  $.map string.split("$"), (part) =>
17
- [category, action, label, value] = part.split("|")
17
+ [category, action, label, value] = part.split "|"
18
18
  new @(category, action, label, value)
19
19
 
20
20
  # Events should not be send to an adapter unless the DOM has finished loading.
@@ -58,25 +58,26 @@ class GaEvents.Event
58
58
  @flush()
59
59
 
60
60
  $(document).ajaxComplete (event, xhr) =>
61
- xhr_events = xhr.getResponseHeader(@header_key)
62
- @from_string(xhr_events) if xhr_events?
61
+ xhr_events = xhr.getResponseHeader @header_key
62
+ @from_string xhr_events if xhr_events?
63
63
 
64
- dom_events = $("div[data-#{@html_key}]").data(@html_key)
65
- @from_string(dom_events) if dom_events?
64
+ dom_events = $("div[data-#{@html_key}]").data @html_key
65
+ @from_string dom_events if dom_events?
66
66
 
67
67
  class GaEvents.GoogleTagManagerAdapter
68
68
  constructor: (@event = "ga_event") ->
69
69
  push: (data) ->
70
70
  data["event"] = @event
71
71
  data["non_interaction"] = true
72
- window.dataLayer.push(data)
72
+ window.dataLayer.push data
73
73
 
74
74
  class GaEvents.GoogleAnalyticsAdapter
75
75
  push: (obj) ->
76
76
  data = ["_trackEvent", obj["category"], obj["action"]]
77
- data.push(obj["label"]) if obj.label?
78
- data.push(obj["value"]) if obj.value?
79
- window._gaq.push(data)
77
+ data.push obj["label"]
78
+ data.push obj["value"]
79
+ data.push true # opt_noninteraction
80
+ window._gaq.push data
80
81
 
81
82
  class GaEvents.NullAdapter
82
83
  push: (obj) -> console.log obj if console?
@@ -1,3 +1,3 @@
1
1
  module GaEvents
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ga_events
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
5
- prerelease:
4
+ version: 0.1.7
6
5
  platform: ruby
7
6
  authors:
8
7
  - Florian Dütsch
@@ -11,12 +10,11 @@ authors:
11
10
  autorequire:
12
11
  bindir: bin
13
12
  cert_chain: []
14
- date: 2013-03-20 00:00:00.000000000 Z
13
+ date: 2013-04-02 00:00:00.000000000 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: rails
18
17
  requirement: !ruby/object:Gem::Requirement
19
- none: false
20
18
  requirements:
21
19
  - - ~>
22
20
  - !ruby/object:Gem::Version
@@ -24,7 +22,6 @@ dependencies:
24
22
  type: :runtime
25
23
  prerelease: false
26
24
  version_requirements: !ruby/object:Gem::Requirement
27
- none: false
28
25
  requirements:
29
26
  - - ~>
30
27
  - !ruby/object:Gem::Version
@@ -54,33 +51,26 @@ files:
54
51
  - lib/ga_events/version.rb
55
52
  homepage: https://github.com/Nix-wie-weg/ga_events
56
53
  licenses: []
54
+ metadata: {}
57
55
  post_install_message:
58
56
  rdoc_options: []
59
57
  require_paths:
60
58
  - lib
61
59
  required_ruby_version: !ruby/object:Gem::Requirement
62
- none: false
63
60
  requirements:
64
61
  - - ! '>='
65
62
  - !ruby/object:Gem::Version
66
63
  version: '0'
67
- segments:
68
- - 0
69
- hash: -1534076695967929618
70
64
  required_rubygems_version: !ruby/object:Gem::Requirement
71
- none: false
72
65
  requirements:
73
66
  - - ! '>='
74
67
  - !ruby/object:Gem::Version
75
68
  version: '0'
76
- segments:
77
- - 0
78
- hash: -1534076695967929618
79
69
  requirements: []
80
70
  rubyforge_project:
81
- rubygems_version: 1.8.25
71
+ rubygems_version: 2.0.3
82
72
  signing_key:
83
- specification_version: 3
73
+ specification_version: 4
84
74
  summary: This gem allows you to annotate events everywhere in the code of your Rails
85
75
  app. A rack middleware is automatically inserted into the stack. It transports the
86
76
  event data to the client. Normal requests get a DIV injected, AJAX requests get