I just installed the ahoy gem into my Rails 5.1.3 application. I am getting back the visit
and the event
, but the visit location attributes always return country: "Reserved"
, region: nil
, city: nil
, postal_code: nil
. This is what I have implemented following the directions on the Ahoy github. Any body can shed some light on what it is I am missing or doing incorrectly? This is occurring in both production and development env's.
application.js
$(document).ready(function(){
ahoy.trackAll();
});
Gemfile
gem 'ahoy_matey'
# Did not include geocoder because it is detailed in the documents as a dependency.
Example of a Visit:
[2] pry(main)> Visit.last
Visit Load (0.5ms) SELECT "visits".* FROM "visits" ORDER BY "visits"."id" DESC LIMIT $1 [["LIMIT", 1]]
=> #<Visit:0x007fd045e04b48
id: 2,
visit_token: "7750594c-7163-46c1-8ec7-18f3069619d0",
visitor_token: "efdcb332-742a-4de3-971b-c141f24ff0f6",
ip: "74.174.236.84",
user_agent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36",
referrer: nil,
landing_page: "http://my_website.com/users/sign_in",
user_id: nil,
referring_domain: nil,
search_keyword: nil,
browser: "Chrome",
os: "Mac OS X",
device_type: "Desktop",
screen_height: 800,
screen_width: 1280,
country: "Reserved",
region: nil,
city: nil,
postal_code: nil,
latitude: 0.0,
longitude: 0.0,
utm_source: nil,
utm_medium: nil,
utm_term: nil,
utm_content: nil,
utm_campaign: nil,
started_at: Wed, 22 Nov 2017 21:10:52 UTC +00:00>