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
  "  <script type=text/javascript>\n    var hostProtocol = ((\"https:\" == document.location.protocol) ? \"https\" : \"http\");\n    document.write('<scr'+'ipt src=\"', hostProtocol+\n      '://\#{@trackEvent}.xg4ken.com/media/getpx.php?cid=\#{@id}','\" type=\"text/JavaScript\"><\\/scr'+'ipt>');\n  </script>\n  <script type=text/javascript>\n    var params = new Array();\n    params[0]='id=\#{@token}';\n    params[1]='type=\#{@type}';\n    params[2]='val=\#{@val}';\n    params[3]='orderId=\#{@orderId}';\n    params[4]='promoCode=\#{@promoCode}';\n    params[5]='valueCurrency=\#{@valueCurrency}';\n    params[6]='GCID='; //For Live Tracking only\n    params[7]='kw='; //For Live Tracking only\n    params[8]='product='; //For Live Tracking only\n    k_trackevent(params,'\#{@trackEvent}');\n  </script>\n  <noscript>\n    <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\">\n  </noscript>\n  EOF\nend\n"

#nameObject



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

def name
  :kenshoo
end