3

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>
Ctpelnar1988
  • 1,235
  • 3
  • 15
  • 38
  • 1
    I'm having the same issue. One of my apps which has geocoder installed directly as a gem is allowing me to get back the location params without any trouble on every visit, although that is a rails 4.2.6 application. My rails 5.1.3 app, which is configured the exact same way, is the one with the issues exactly to yours. – rebbailey Nov 22 '17 at 21:51

0 Answers0