def record
      if @current_visit_seq
        track("visit_time", @t.to_i - @last_visit_end_time.to_i)
      else
        @current_visit_seq ||= counter("visits")
        track("visits", 1) # track core 'visit' metric
        if @first_visit_seq
          track("repeat_visits", 1)
        else
          @first_visit_seq ||= counter("unique_visits")
          track("first_visits", 1)
          track("unique_visits", 1)
        end
        exec_custom_methods('visit') # custom methods that are measured on a per-visit basis
      end
      exec_custom_methods('hit') # custom methods that are measured on a per-page-view (per-hit) basis
      track("page_views", 1) # track core 'page_view' metric
      track("second_page_views", 1) if @page_view_seq_no.to_i == 1 # @last_visit_start_time and (@last_visit_start_time.to_i == @last_visit_end_time.to_i)
      @rack_response
    end
def record
      if @current_visit_seq
        track("visit_time", @t.to_i - @last_visit_end_time.to_i)
      else
        @current_visit_seq ||= counter("visits")
        track("visits", 1) # track core 'visit' metric
        if @first_visit_seq
          track("repeat_visits", 1)
        else
          @first_visit_seq ||= counter("unique_visits")
          track("first_visits", 1)
          track("unique_visits", 1)
        end
        exec_custom_methods('visit') # custom methods that are measured on a per-visit basis
      end
      exec_custom_methods('hit') # custom methods that are measured on a per-page-view (per-hit) basis
      track("page_views", 1) # track core 'page_view' metric
      track("second_page_views", 1) if @page_view_seq_no.to_i == 1 # @last_visit_start_time and (@last_visit_start_time.to_i == @last_visit_end_time.to_i)
      @rack_response
    end
method used in analytics.rb to initialize visit
 called from analytics.rb