universal-track-manager 0.5 → 0.6.1.alpha

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4312fd929dea85d8ab47c55a838559798b283ff744bccc41fdc520ed70b87f64
4
- data.tar.gz: ca80c8c79dfe048917d9bdbb9e18dd6eec77ff3fb4aed584a7e7bf4fc52cd634
3
+ metadata.gz: 6fead14dddac86eb0047bc7beb1db6a28581147f7f43e107365aa32185fbbcba
4
+ data.tar.gz: 69f8eaf957d1fb86c7a6c292afba6df115607334eeada1ac5a63be4437187932
5
5
  SHA512:
6
- metadata.gz: 4b78e693a629d239e00344c42d518e77610376bd458c2d3e90bb07e387e1f0d6f3e7701200ec2cc923d07e49f9d7a647db4c1df2acab7d73decfdfffa511c967
7
- data.tar.gz: c9e25b5b7bd96755ed6a889647662efa8c2c4d7ff723ace67783b4073b5b3c00c4395f8c5c6e4273bce81f85b23f53819a6df5cc9f27b6266a6047a5e4975934
6
+ metadata.gz: 1b50650f86698f0b48a0d586bf97889bb4f1dc80a5ea034cfcb3a24cd59783da3a4016609115e9b4d04161b8c7152034426ee360c32d14bc1711b0d80220625c
7
+ data.tar.gz: 77a25d36fb0dab94d0a3071636614183aee70d90f01253c4d3015250f00f25442c9da350617298d36c40f849436c63c34c19cf430439e60b6714f1640c9190f8
@@ -1,6 +1,5 @@
1
1
  module UniversalTrackManagerConcern
2
2
  extend ActiveSupport::Concern
3
-
4
3
  attr_accessor :visit_evicted
5
4
 
6
5
  included do
@@ -53,12 +52,14 @@ module UniversalTrackManagerConcern
53
52
  end
54
53
 
55
54
  def new_visitor
56
- visit = UniversalTrackManager::Visit.create!(
55
+ params = {
57
56
  first_pageload: now,
58
57
  last_pageload: now,
59
58
  ip_v4_address: ip_address,
60
- browser: find_or_create_browser_by_current,
61
- campaign: find_or_create_campaign_by_current)
59
+ campaign: find_or_create_campaign_by_current
60
+ }
61
+ params[:browser] = find_or_create_browser_by_current if request.user_agent
62
+ visit = UniversalTrackManager::Visit.create!(params)
62
63
  session[:visit_id] = visit.id
63
64
  end
64
65
 
@@ -114,14 +115,18 @@ module UniversalTrackManagerConcern
114
115
 
115
116
  def evict_visit!(old_visit)
116
117
  @visit_evicted = true
117
- visit = UniversalTrackManager::Visit.create!(
118
- first_pageload: now,
119
- last_pageload: now,
120
- original_visit_id: old_visit.original_visit_id.nil? ? old_visit.id : old_visit.original_visit_id,
121
- ip_v4_address: ip_address,
122
- browser: find_or_create_browser_by_current,
123
- campaign: find_or_create_campaign_by_current)
118
+ params = {
119
+ first_pageload: now,
120
+ last_pageload: now,
121
+ original_visit_id: old_visit.original_visit_id.nil? ? old_visit.id : old_visit.original_visit_id,
122
+ ip_v4_address: ip_address,
123
+ campaign: find_or_create_campaign_by_current
124
+ }
125
+
126
+ # fail silently if there is no user agent
127
+ params[:browser] = find_or_create_browser_by_current if request.user_agent
128
+ visit = UniversalTrackManager::Visit.create!(params)
124
129
 
125
130
  session[:visit_id] = visit.id
126
131
  end
127
- end
132
+ end
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module UniversalTrackManager
2
- VERSION = "0.5"
3
- end
2
+ VERSION = "0.6.1.alpha"
3
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: universal-track-manager
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.5'
4
+ version: 0.6.1.alpha
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Fleetwood-Boldt
@@ -92,11 +92,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
92
92
  version: '0'
93
93
  required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - ">="
95
+ - - ">"
96
96
  - !ruby/object:Gem::Version
97
- version: '0'
97
+ version: 1.3.1
98
98
  requirements: []
99
- rubygems_version: 3.0.3
99
+ rubygems_version: 3.0.8
100
100
  signing_key:
101
101
  specification_version: 4
102
102
  summary: A gem to track visitors to your website.