Sha256: 48bc64144bbe9c5d1f2f200713e936a0b3593462ca4602b3ade71ea4ccdb2475

Contents?: true

Size: 519 Bytes

Versions: 11

Compression:

Stored size: 519 Bytes

Contents

class Rack::Tracker::FacebookPixel < Rack::Tracker::Handler
  self.position = :body
  self.allowed_tracker_options = [:id]

  class Event < OpenStruct
    def write
      options.present? ? type_to_json << options_to_json : type_to_json
    end

    private

    def type_to_json
      type.to_json
    end

    def options_to_json
      ", #{options.to_json}"
    end
  end

  class Track < Event
    def name
      'track'
    end
  end

  class TrackCustom < Event
    def name
      'trackCustom'
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
rack-tracker-1.13.0 lib/rack/tracker/facebook_pixel/facebook_pixel.rb
rack-tracker-1.12.1 lib/rack/tracker/facebook_pixel/facebook_pixel.rb
rack-tracker-1.12.0 lib/rack/tracker/facebook_pixel/facebook_pixel.rb
rack-tracker-1.11.2 lib/rack/tracker/facebook_pixel/facebook_pixel.rb
rack-tracker-1.11.1 lib/rack/tracker/facebook_pixel/facebook_pixel.rb
rack-tracker-1.11.0 lib/rack/tracker/facebook_pixel/facebook_pixel.rb
rack-tracker-1.10.0 lib/rack/tracker/facebook_pixel/facebook_pixel.rb
rack-tracker-1.9.0 lib/rack/tracker/facebook_pixel/facebook_pixel.rb
rack-tracker-1.8.0 lib/rack/tracker/facebook_pixel/facebook_pixel.rb
rack-tracker-1.7.0 lib/rack/tracker/facebook_pixel/facebook_pixel.rb
rack-tracker-1.6.0 lib/rack/tracker/facebook_pixel/facebook_pixel.rb