Sha256: bf86cf8b00faa30cdae1f2c7b7583793254757ef73648317591cd5f1d109a546

Contents?: true

Size: 1.15 KB

Versions: 16

Compression:

Stored size: 1.15 KB

Contents

class Ahoy::Visit
  include Mongoid::Document

  # associations
  has_many :events, class_name: "Ahoy::Event"
  belongs_to :user, index: true, optional: true

  # required
  field :visit_token, type: String
  field :visitor_token, type: String

  # the rest are recommended but optional
  # simply remove the columns you don't want

  # standard
  field :ip, type: String
  field :user_agent, type: String
  field :referrer, type: String
  field :referring_domain, type: String
  field :landing_page, type: String

  # technology
  field :browser, type: String
  field :os, type: String
  field :device_type, type: String

  # location
  field :country, type: String
  field :region, type: String
  field :city, type: String
  field :latitude, type: Float
  field :longitude, type: Float

  # utm parameters
  field :utm_source, type: String
  field :utm_medium, type: String
  field :utm_term, type: String
  field :utm_content, type: String
  field :utm_campaign, type: String

  # native apps
  field :app_version, type: String
  field :os_version, type: String
  field :platform, type: String

  field :started_at, type: Time

  index({visit_token: 1}, {unique: true})
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
ahoy_matey-4.2.1 lib/generators/ahoy/templates/mongoid_visit_model.rb.tt
ahoy_matey-4.2.0 lib/generators/ahoy/templates/mongoid_visit_model.rb.tt
ahoy_matey-4.1.0 lib/generators/ahoy/templates/mongoid_visit_model.rb.tt
ahoy_matey-4.0.3 lib/generators/ahoy/templates/mongoid_visit_model.rb.tt
ahoy_matey-4.0.2 lib/generators/ahoy/templates/mongoid_visit_model.rb.tt
ahoy_matey-4.0.1 lib/generators/ahoy/templates/mongoid_visit_model.rb.tt
ahoy_matey-4.0.0 lib/generators/ahoy/templates/mongoid_visit_model.rb.tt
ahoy_matey-3.3.0 lib/generators/ahoy/templates/mongoid_visit_model.rb.tt
ahoy_matey-3.2.0 lib/generators/ahoy/templates/mongoid_visit_model.rb.tt
ahoy_matey-3.1.0 lib/generators/ahoy/templates/mongoid_visit_model.rb.tt
ahoy_matey-3.0.5 lib/generators/ahoy/templates/mongoid_visit_model.rb.tt
ahoy_matey-3.0.4 lib/generators/ahoy/templates/mongoid_visit_model.rb.tt
ahoy_matey-3.0.3 lib/generators/ahoy/templates/mongoid_visit_model.rb.tt
ahoy_matey-3.0.2 lib/generators/ahoy/templates/mongoid_visit_model.rb.tt
ahoy_matey-3.0.1 lib/generators/ahoy/templates/mongoid_visit_model.rb.tt
ahoy_matey-3.0.0 lib/generators/ahoy/templates/mongoid_visit_model.rb.tt