Skip to content

Commit

Permalink
Added instructions for GeoLite2 database
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Feb 28, 2018
1 parent 89cfce7 commit f956194
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,27 @@ Change the job queue with:
Ahoy.job_queue = :low_priority
```

#### Geocoding Performance

To avoid calls to a remote API, download the [GeoLite2 City database](https://dev.maxmind.com/geoip/geoip2/geolite2/) and configure Geocoder to use it.

Add this line to your application’s Gemfile:

```ruby
gem 'maxminddb'
```

And create an initializer at `config/initializers/geocoder.rb` with:

```ruby
Geocoder.configure(
ip_lookup: :geoip2,
geoip2: {
file: Rails.root.join("lib", "GeoLite2-City.mmdb")
}
)
```

### Token Generation

Ahoy uses random UUIDs for visit and visitor tokens by default, but you can use your own generator like [Druuid](https://github.com/recurly/druuid).
Expand Down

0 comments on commit f956194

Please sign in to comment.