More token removal

Andrew Kane committed Jun 15, 2014
commit c9d643822cfc708ee5239cee0e4b510000be8725
Showing 5 changed files with 7 additions and 7 deletions
README.md +1 -1
@@ @@ -82,7 +82,7 @@ When someone visits your website, Ahoy creates a visit with lots of useful infor
- **technology** - browser, OS, and device type
- **utm parameters** - source, medium, term, content, campaign
- Use the `current_visit` method to access it, and the `visit_token` and `visitor_token` methods to get the tokens.
+ Use the `current_visit` method to access it, and the `ahoy.visit_id` and `ahoy.visitor_id` methods to get the ids.
### Events
app/controllers/ahoy/visits_controller.rb +1 -1
@@ @@ -3,7 +3,7 @@ module Ahoy
def create
ahoy.track_visit(trusted: false)
- render json: {visit_token: ahoy.visit_token, visitor_token: ahoy.visitor_token}
+ render json: {visit_id: ahoy.visit_id, visitor_id: ahoy.visitor_id}
end
end
ahoy/stores/active_record_store.rb b/lib/ahoy/stores/active_record_store.rb +2 -2
@@ @@ -5,8 +5,8 @@ module Ahoy
def track_visit(options, &block)
visit =
visit_model.new do |v|
- v.visit_token = ahoy.visit_token
- v.visitor_token = ahoy.visitor_token
+ v.id = ahoy.visit_id
+ v.visitor_id = ahoy.visitor_id
v.user = user if v.respond_to?(:user=)
v.started_at = options[:time]
end
generators/ahoy/stores/templates/mongoid_visit_model.rb b/lib/generators/ahoy/stores/templates/mongoid_visit_model.rb +1 -1
@@ @@ -5,7 +5,7 @@ class Visit
belongs_to :user
# required
- field :visitor_token, type: BSON::Binary
+ field :visitor_id, type: BSON::Binary
# the rest are recommended but optional
# simply remove the columns you don't want
vendor/assets/javascripts/ahoy.js +2 -2
@@ @@ -155,8 +155,8 @@
}
var data = {
- visit_token: visitId,
- visitor_token: visitorId,
+ visit_id: visitId,
+ visitor_id: visitorId,
platform: ahoy.platform || "Web",
landing_page: window.location.href,
screen_width: window.screen.width,