Sha256: 538239c4cb23a7bbf8a3ca7edbcc83c9153cac16804079f246fc93722661174e

Contents?: true

Size: 623 Bytes

Versions: 2

Compression:

Stored size: 623 Bytes

Contents

module Analytical
  module Optimizely
    class Api
      include Analytical::Base::Api

      def initialize(parent, options={})
        super
        @tracking_command_location = :head_prepend
      end

      def init_javascript(location)
        init_location(location) do
          js = <<-HTML
          <!-- Analytical Init: Optimizely -->
          <script type="text/javascript">document.write(unescape("%3Cscript src='"+document.location.protocol+"//cdn.optimizely.com/js/#{options[:key]}.js' type='text/javascript'%3E%3C/script%3E"));</script>
          HTML
          js
        end
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
analytical-1.5.0 lib/analytical/optimizely.rb
analytical-1.4.0 lib/analytical/optimizely.rb