Sha256: b36b7f65a73e6213f8e15b180a5f7a13f537428773aa2086f53e2d6f43cbfa07

Contents?: true

Size: 1.49 KB

Versions: 8

Compression:

Stored size: 1.49 KB

Contents

module Analytical
  module Modules
    class ClickTale
      include Analytical::Modules::Base

      def initialize(options={})
        super
        @tracking_command_location = [:body_prepend, :body_append]
      end

      def init_javascript(location)
        init_location(location) do
          case location.to_sym
            when :body_prepend
              js = <<-HTML
              <!-- Analytical Init: ClickTale Top part -->
              <script type="text/javascript">
              var WRInitTime=(new Date()).getTime();
              </script>
              <!-- ClickTale end of Top part -->
              HTML
              js
            when :body_append
              js = <<-HTML
              <!-- Analytical Init: ClickTale Bottom part -->
          		<div id="ClickTaleDiv" style="display: none;"></div>
          		<script type='text/javascript'>
          		document.write(unescape("%3Cscript%20src='"+
          		 (document.location.protocol=='https:'?
          		  'https://clicktale.pantherssl.com/':
          		  'http://s.clicktale.net/')+
          		 "WRb6.js'%20type='text/javascript'%3E%3C/script%3E"));
          		</script>
          		<script type="text/javascript">
          		var ClickTaleSSL=1;
          		if(typeof ClickTale=='function') ClickTale(#{@options[:project_id]},#{@options[:site_traffic]},"www");
          		</script>
          		<!-- ClickTale end of Bottom part -->
              HTML
              js
          end
        end
      end

    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
gsiener-analytical-2.10.2 lib/analytical/modules/click_tale.rb
gsiener-analytical-2.10.1 lib/analytical/modules/click_tale.rb
gsiener-analytical-2.10.0 lib/analytical/modules/click_tale.rb
analytical-2.9.0 lib/analytical/modules/click_tale.rb
analytical-2.8.0 lib/analytical/modules/click_tale.rb
analytical-2.7.2 lib/analytical/modules/click_tale.rb
analytical-2.7.1 lib/analytical/modules/click_tale.rb
analytical-2.7.0 lib/analytical/modules/click_tale.rb