Sha256: 3e9c5a18ae271d7152f4695deccbd694f43fa63f6926968496776cb7e29f6f3a

Contents?: true

Size: 623 Bytes

Versions: 24

Compression:

Stored size: 623 Bytes

Contents

module Analytical
  module Modules
    class Optimizely
      include Analytical::Modules::Base

      def initialize(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

24 entries across 24 versions & 2 rubygems

Version Path
analytical-2.2.0 lib/analytical/modules/optimizely.rb
analytical-2.1.0 lib/analytical/modules/optimizely.rb
analytical-2.0.0 lib/analytical/modules/optimizely.rb
analytical-1.9.0 lib/analytical/modules/optimizely.rb