Sha256: 49970ee572eff8081375901da81bf53e776b4c8ad02dcc8fd3723839423b14c4
Contents?: true
Size: 1.23 KB
Versions: 7
Compression:
Stored size: 1.23 KB
Contents
module Analytical module Modules class Reinvigorate 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: Reinvigorate --> <script type="text/javascript"> document.write(unescape("%3Cscript src='" + (("https:" == document.location.protocol) ? "https://ssl-" : "http://") + "include.reinvigorate.net/re_.js' type='text/javascript'%3E%3C/script%3E")); </script> HTML js end end def identify(id, *args) data = args.first || {} "var re_name_tag = \"#{id}\";" end def context(data) return '' if data.blank? if data[:email] "var re_context_tag = \"mailto:#{data[:email]}\";" elsif data[:url] "var re_context_tag = \"http://#{data[:url]}\";" else "var re_context_tag = \"#{data.first.last}\";" end end def track(data, *args) "try { reinvigorate.track(\"#{options[:key]}\"); } catch(err) {}" end end end end
Version data entries
7 entries across 7 versions & 2 rubygems