woopra_track 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/woopra_track/tracker.rb +15 -13
- data/lib/woopra_track/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6f8af52ee61a1780238ffeec9b7c40cae2665bd
|
4
|
+
data.tar.gz: d7edb8e3eae839dd050b21a906385feed6fe21a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9aedd1e1a1f7349aec21833689971ea0f0878ffe6c05b2082264b86cd6eb608354747bcc570d2fa52007ab0c041971c6025294ce9556d8fe3747ab0c46ef2cd7
|
7
|
+
data.tar.gz: f1819d294c03fdf567667e869807330c10ec90090d17232da5ba6aaea259da530bd8d100614330e39251d4be683bdb71de98b2d94fa0a0fb469a8652337bc5cc
|
data/lib/woopra_track/tracker.rb
CHANGED
@@ -20,18 +20,18 @@ module WoopraTrack
|
|
20
20
|
ignore_query_url: true,
|
21
21
|
hide_campaign: false,
|
22
22
|
ip_address: nil,
|
23
|
-
cookie_value: nil
|
24
|
-
disable_tracking: false
|
23
|
+
cookie_value: nil
|
25
24
|
}
|
26
25
|
|
27
26
|
def initialize(request)
|
28
|
-
@request
|
29
|
-
@current_config
|
30
|
-
@custom_config
|
31
|
-
@user
|
32
|
-
@events
|
33
|
-
@user_up_to_date
|
34
|
-
@has_pushed
|
27
|
+
@request = request
|
28
|
+
@current_config = @@default_config
|
29
|
+
@custom_config = { app: @@application_id }
|
30
|
+
@user = {}
|
31
|
+
@events = []
|
32
|
+
@user_up_to_date = true
|
33
|
+
@has_pushed = false
|
34
|
+
@disable_tracking = false
|
35
35
|
|
36
36
|
@current_config[:domain] = @request.host
|
37
37
|
@current_config[:cookie_domain] = @request.host
|
@@ -44,10 +44,12 @@ module WoopraTrack
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def config(data)
|
47
|
-
data
|
48
|
-
|
47
|
+
data = Hash(data)
|
48
|
+
custom = data.select { |k, _v| k.in? @@default_config.keys }
|
49
|
+
custom = custom.except(:ip_address, :cookie_value)
|
49
50
|
|
50
|
-
@custom_config.merge
|
51
|
+
@custom_config = @custom_config.merge(custom)
|
52
|
+
@disable_tracking = data[:disable_tracking].is_a? TrueClass
|
51
53
|
end
|
52
54
|
|
53
55
|
def identify(user)
|
@@ -176,7 +178,7 @@ module WoopraTrack
|
|
176
178
|
end
|
177
179
|
|
178
180
|
def disable_tracking?
|
179
|
-
@
|
181
|
+
@disable_tracking.is_a? TrueClass
|
180
182
|
end
|
181
183
|
end
|
182
184
|
end
|
data/lib/woopra_track/version.rb
CHANGED