Sha256: 64f50e791df4c1e90b7ea17b3208bbcffec68a9faf869d76430b6ac1e92213c1

Contents?: true

Size: 825 Bytes

Versions: 1

Compression:

Stored size: 825 Bytes

Contents

require 'landable/traffic/tracker'
require 'landable/traffic/crawl_tracker'
require 'landable/traffic/ping_tracker'
require 'landable/traffic/scan_tracker'
require 'landable/traffic/scrape_tracker'
require 'landable/traffic/user_tracker'
require 'landable/traffic/noop_tracker'

module Landable
  module Traffic
    def track_with_landable!
      yield and return if request.headers["DNT"]
      begin
        @tracker = Tracker.for self
        @tracker.track
      rescue => e
        Rails.logger.error e
        if respond_to? :newrelic_notice_error
          newrelic_notice_error e
        end
      end

      yield

      begin
        @tracker.save
      rescue => e
        Rails.logger.error e
        if respond_to? :newrelic_notice_error
          newrelic_notice_error e
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
landable-1.10.0.rc1 lib/landable/traffic.rb