ga_events 2.0.0 → 2.1.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.
- checksums.yaml +4 -4
- data/README.md +9 -0
- data/Rakefile +0 -2
- data/app/assets/javascripts/ga_events.js.coffee +4 -0
- data/lib/ga_events/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 205433864fd2efabf0cf787da0be314c9bc48fd644773d8df29f6ca66327ba43
|
|
4
|
+
data.tar.gz: fa05cd8ee83f4b73fa23a3562e19d0ec2fcbb1a684c7ee49c357d0e78a54c3a7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 472515474d12c53c4f3d43b8c577a45776ed983149c8347940294ca1128e907d101f48054eee7c00468cafdc3f1e7aba33c3cdfa08f43d81ebc0bd25c91f884f
|
|
7
|
+
data.tar.gz: 483bbdb595f20e852ec8f6b74366251e91e84b76cde7454721136d42cfd31586e36c88bd015ac6cbf321a673e2779e5f29b96cb345924d7606f648e36da67aa9
|
data/README.md
CHANGED
|
@@ -70,6 +70,15 @@ GaEvents.Event.adapter = function() {
|
|
|
70
70
|
}
|
|
71
71
|
```
|
|
72
72
|
|
|
73
|
+
### Optional consent settings
|
|
74
|
+
|
|
75
|
+
Events are flushed immediatly by default. If you need to wait for user consent
|
|
76
|
+
you can set `GaEvents.Event.require_user_consent = true`.
|
|
77
|
+
|
|
78
|
+
With `require_user_consent` enabled all events are buffered until
|
|
79
|
+
`GaEvents.Event.user_consent_given = true` is set. Events are flushed as soon
|
|
80
|
+
as `GaEvents.Event.flush()` is called.
|
|
81
|
+
|
|
73
82
|
### Testing
|
|
74
83
|
|
|
75
84
|
For your testing pleasure we included `NullAdapter`.
|
data/Rakefile
CHANGED
|
@@ -9,6 +9,8 @@ class GaEvents.Event
|
|
|
9
9
|
@may_flush: false
|
|
10
10
|
@header_key: "X-GA-Events"
|
|
11
11
|
@html_key: "ga-events"
|
|
12
|
+
@require_user_consent: false
|
|
13
|
+
@user_consent_given: false
|
|
12
14
|
klass: @
|
|
13
15
|
|
|
14
16
|
# Decompose a event-string (ruby side) into an event object.
|
|
@@ -23,6 +25,8 @@ class GaEvents.Event
|
|
|
23
25
|
|
|
24
26
|
# Events should not be send to an adapter unless the DOM has finished loading.
|
|
25
27
|
@flush: ->
|
|
28
|
+
return if @require_user_consent && !@user_consent_given
|
|
29
|
+
|
|
26
30
|
if @list.length > 0 and @may_flush
|
|
27
31
|
$.map @list, (event) -> event.push_to_adapter()
|
|
28
32
|
@list = []
|
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: 2.
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Florian Dütsch
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2021-09-07 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rails
|