Class: TheTracker::Trackers::Kenshoo

Inherits:
Base
  • Object
show all
Defined in:
lib/the_tracker/trackers/kenshoo.rb

Instance Attribute Summary

Attributes inherited from Base

#active

Instance Method Summary collapse

Methods inherited from Base

#body_bottom, #header

Constructor Details

#initialize(options) ⇒ Kenshoo

Kenshoo info



6
7
8
9
10
11
12
13
14
15
# File 'lib/the_tracker/trackers/kenshoo.rb', line 6

def initialize(options)
  @token         = options[:token]
  @type          = options[:type]
  @val           = options[:val]
  @orderId       = options[:orderId]
  @promoCode     = options[:promoCode]
  @valueCurrency = options[:valueCurrency]
  @trackEvent    = options[:trackEvent]
  super()
end

Instance Method Details

#body_topObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/the_tracker/trackers/kenshoo.rb', line 21

def body_top
  return if !active
  <<-EOF
  <script type=text/javascript>
    var hostProtocol = (("https:" == document.location.protocol) ? "https" : "http");
    document.write('<scr'+'ipt src="', hostProtocol+
      '://#{@trackEvent}.xg4ken.com/media/getpx.php?cid=#{@id}','" type="text/JavaScript"><\/scr'+'ipt>');
  </script>
  <script type=text/javascript>
    var params = new Array();
    params[0]='id=#{@token}';
    params[1]='type=#{@type}';
    params[2]='val=#{@val}';
    params[3]='orderId=#{@orderId}';
    params[4]='promoCode=#{@promoCode}';
    params[5]='valueCurrency=#{@valueCurrency}';
    params[6]='GCID='; //For Live Tracking only
    params[7]='kw='; //For Live Tracking only
    params[8]='product='; //For Live Tracking only
    k_trackevent(params,'#{@trackEvent}');
  </script>
  <noscript>
    <img src="https://1191.xg4ken.com/media/redir.php?track=1&token=#{@token}&type=#{@type}&val=#{@val}&orderId=#{@orderId}&promoCode=#{@promoCode}&valueCurrency=#{@valueCurrency}&GCID=&kw=&product=" width="1" height="1">
  </noscript>
  EOF
end

#nameObject



17
18
19
# File 'lib/the_tracker/trackers/kenshoo.rb', line 17

def name
  :kenshoo
end