woopra_track 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -1
- data/lib/woopra_track/tracker.rb +6 -6
- data/lib/woopra_track/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0ec5bbcdfb259b824ad0450c7215c9449331b8a
|
4
|
+
data.tar.gz: f1bcdd1c44d0d42fd15c6416caaa48cffa69ccad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 76db189c30fabc451bfbd37154576b88eefca920665abb23f95b85483cd7a37d217ca5b230e67aabb2244f3f3d974640c0d3a4c872d600b059c3dbcfdeb276b1
|
7
|
+
data.tar.gz: 8583505c7b2891ddc8adbe6a3ea244cd18965a961dadc400b383f69411d6d06868659aa24526e62a85b1db9525a11b2447ca66171558c3f8ea090eb54013fe0b
|
data/README.md
CHANGED
@@ -143,7 +143,7 @@ and add the code in your template's header (here `home.html.erb`)
|
|
143
143
|
</html>
|
144
144
|
```
|
145
145
|
|
146
|
-
|
146
|
+
If you wish to track your users only through the back-end, you should set the cookie on your user's browser. However, if you are planning to also use front-end tracking, don't even bother with that step, the JavaScript tracker will handle it for you.
|
147
147
|
|
148
148
|
``` ruby
|
149
149
|
# During initialization
|
@@ -154,6 +154,12 @@ woopra(request, config, cookies)
|
|
154
154
|
@woopra.set_cookie(cookies)
|
155
155
|
```
|
156
156
|
|
157
|
+
Finally, if you want to enable logging for back-end tracking requests, just call `enable_logging`:
|
158
|
+
|
159
|
+
``` ruby
|
160
|
+
@woopra.enable_logging
|
161
|
+
```
|
162
|
+
|
157
163
|
## Development
|
158
164
|
|
159
165
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/woopra_track/tracker.rb
CHANGED
@@ -141,18 +141,18 @@ module WoopraTrack
|
|
141
141
|
request_headers = { 'User-Agent' => @request.env['HTTP_USER_AGENT'] }
|
142
142
|
request_response = Typhoeus.get(request_url, headers: request_headers)
|
143
143
|
|
144
|
-
log_request(request_response) if @logger
|
144
|
+
log_request(request_response, request_url) if @logger
|
145
145
|
end
|
146
146
|
|
147
|
-
def log_request(response)
|
147
|
+
def log_request(response, url)
|
148
148
|
if response.success?
|
149
|
-
@logger.info("Woopra") { "Success: #{
|
149
|
+
@logger.info("Woopra") { "Success: #{url}" }
|
150
150
|
elsif response.timed_out?
|
151
|
-
@logger.warn("Woopra") { "Timeout: #{
|
151
|
+
@logger.warn("Woopra") { "Timeout: #{url}" }
|
152
152
|
elsif response.code == 0
|
153
|
-
@logger.error("Woopra") { "#{response.return_message}, #{
|
153
|
+
@logger.error("Woopra") { "#{response.return_message}, #{url}" }
|
154
154
|
else
|
155
|
-
@logger.error("Woopra") { "WOOPRA Failed: #{response.code}, #{
|
155
|
+
@logger.error("Woopra") { "WOOPRA Failed: #{response.code}, #{url}" }
|
156
156
|
end
|
157
157
|
end
|
158
158
|
|
data/lib/woopra_track/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: woopra_track
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonian Guveli
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|