Sha256: b140ddb191e66d4a42c396627ac61b74905b09ea714299e7a3f8c4bcfd5aed1c

Contents?: true

Size: 1.24 KB

Versions: 1

Compression:

Stored size: 1.24 KB

Contents

class Ahoy::Visit
  include Mongoid::Document

  # associations
  has_many :events, class_name: "Ahoy::Event"
  belongs_to :user, index: true<%= rails5? ? ", optional: true" : nil %>

  # 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 :landing_page, type: String

  # traffic source
  field :referring_domain, type: String
  field :search_keyword, type: String

  # technology
  field :browser, type: String
  field :os, type: String
  field :device_type, type: String
  field :screen_height, type: Integer
  field :screen_width, type: Integer

  # location
  field :country, type: String
  field :region, type: String
  field :city, type: String

  # 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

1 entries across 1 versions & 1 rubygems

Version Path
ahoy_matey-2.2.0 lib/generators/ahoy/templates/mongoid_visit_model.rb.tt