lib/landable/traffic/tracker.rb in landable-1.9.2 vs lib/landable/traffic/tracker.rb in landable-1.10.0.rc1
- old
+ new
@@ -155,11 +155,11 @@
headers["DNT"] == "1"
end
def user_agent
- @user_agent ||= UserAgent[request.user_agent]
+ @user_agent ||= UserAgent[request_user_agent]
end
def referer
return @referer if @referer
return unless referer_uri
@@ -181,11 +181,11 @@
def attribution_hash
Attribution.digest attribution_parameters
end
def visitor_hash
- Digest::SHA2.base64digest [remote_ip, request.user_agent].join
+ Digest::SHA2.base64digest [remote_ip, request_user_agent].join
end
def referer_hash
Digest::SHA2.base64digest request.referer
end
@@ -287,9 +287,14 @@
@visitor ||= Visitor.with_ip_address(ip_address).with_user_agent(user_agent).first_or_create
end
def visit
@visit ||= @visit_id && Visit.find(@visit_id)
+ end
+
+ def request_user_agent
+ return Landable.configuration.blank_user_agent_string if request.user_agent.blank?
+ request.user_agent
end
end
end
end