Changed option to track_visits_immediately
Andrew Kane
committed Jun 18, 2014
commit bd68a6d40acb96617a84fe7965d32208e00c31ff
Showing 4
changed files with
9 additions
and 9 deletions
CHANGELOG.md
+1
-1
| @@ | @@ -1,7 +1,7 @@ |
| ## 1.0.0 | |
| - Added support for any data store, and Mongoid out of the box | |
| - | - Added `track_visits_on_server` option |
| + | - Added `track_visits_immediately` option |
| - Always have a `visit_id` and `visitor_id` available on the server | |
| - Visits expire after inactivity, not fixed interval | |
| - Added `visit_duration` and `visitor_duration` options | |
README.md
+5
-5
| @@ | @@ -303,17 +303,17 @@ class ApplicationController < ActionController::Base |
| end | |
| ``` | |
| - | ### Track Visits on the Server |
| + | ### Track Visits Immediately |
| - | The visitor and visit id are generated on the server, but the `track_visit` method is not called until the JavaScript library executes. This prevents users with cookies disabled from creating multiple visits and ensures visits are not created for API endpoints. Change this with: |
| + | Visitor and visit ids are generated on the first request (so you can use them immediately), but the `track_visit` method isn’t called until the JavaScript library posts to the server. This prevents browsers with cookies disabled from creating multiple visits and ensures visits are not created for API endpoints. Change this with: |
| ```ruby | |
| - | Ahoy.track_visits_on_server = true |
| + | Ahoy.track_visits_immediately = true |
| ``` | |
| **Note:** At the moment, geocoding is performed in the foreground, which can slow down the first page load. | |
| - | If you add this to your `ApplicationController`, be sure to exclude API endpoints with: |
| + | You can exclude API endpoints and other actions with: |
| ```ruby | |
| skip_before_filter :track_ahoy_visit | |
| @@ | @@ -523,7 +523,7 @@ class Ahoy::Store < Ahoy::Stores::ActiveRecordTokenStore |
| end | |
| ``` | |
| - | You made it! Now, take advantage of Ahoy’s awesome new features, like exception reporting. |
| + | You made it! Now, take advantage of Ahoy’s awesome new features, like easy customization and exception reporting. |
| ### 0.3.0 | |
ahoy.rb b/lib/ahoy.rb
+2
-2
| @@ | @@ -38,8 +38,8 @@ module Ahoy |
| mattr_accessor :cookie_domain | |
| - | mattr_accessor :track_visits_on_server |
| - | self.track_visits_on_server = false |
| + | mattr_accessor :track_visits_immediately |
| + | self.track_visits_immediately = false |
| mattr_accessor :quiet | |
| self.quiet = true | |
ahoy/controller.rb b/lib/ahoy/controller.rb
+1
-1
| @@ | @@ -28,7 +28,7 @@ module Ahoy |
| def track_ahoy_visit | |
| if ahoy.new_visit? | |
| - | ahoy.track_visit(defer: !Ahoy.track_visits_on_server) |
| + | ahoy.track_visit(defer: !Ahoy.track_visits_immediately) |
| end | |
| end | |