Sha256: ed07b6fdd15a52df4c56eda569560c103a30783b6bbf4a5de761a005fb870ba8

Contents?: true

Size: 1.12 KB

Versions: 13

Compression:

Stored size: 1.12 KB

Contents

module Analytical
  module Modules
    class Adroll
      include Analytical::Modules::Base

      def initialize(options={})
        super
        @tracking_command_location = :body_append
      end

      def init_javascript(location)
        init_location(location) do
          js = <<-HTML
          <!-- Analytical Init: Adroll -->
          <script type="text/javascript">
          adroll_adv_id = "#{options[:adv_id]}";
          adroll_pix_id = "#{options[:pix_id]}";
          (function () {
          var oldonload = window.onload;
          window.onload = function(){
             __adroll_loaded=true;
             var scr = document.createElement("script");
             var host = (("https:" == document.location.protocol) ? "https://s.adroll.com" : "http://a.adroll.com");
             scr.setAttribute('async', 'true');
             scr.type = "text/javascript";
             scr.src = host + "/j/roundtrip.js";
             document.documentElement.firstChild.appendChild(scr);
             if(oldonload){oldonload()}};
          }());
          </script>
          HTML
          js
        end
      end

    end
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
analytical-3.0.12 lib/analytical/modules/adroll.rb
analytical-3.0.11 lib/analytical/modules/adroll.rb
analytical-3.0.9 lib/analytical/modules/adroll.rb
analytical-3.0.8 lib/analytical/modules/adroll.rb
analytical-3.0.7 lib/analytical/modules/adroll.rb
analytical-3.0.6 lib/analytical/modules/adroll.rb
gsiener-analytical-2.10.2 lib/analytical/modules/adroll.rb
gsiener-analytical-2.10.1 lib/analytical/modules/adroll.rb
analytical-2.11.0 lib/analytical/modules/adroll.rb
analytical-2.10.0 lib/analytical/modules/adroll.rb
gsiener-analytical-2.10.0 lib/analytical/modules/adroll.rb
analytical-2.9.0 lib/analytical/modules/adroll.rb
analytical-2.8.0 lib/analytical/modules/adroll.rb