Class: TheTracker::Trackers::AdForm

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

Instance Attribute Summary

Attributes inherited from Base

#active

Instance Method Summary collapse

Methods inherited from Base

#body_bottom, #body_top

Constructor Details

#initialize(options) ⇒ AdForm

AdForm info pm and id



6
7
8
9
10
# File 'lib/the_tracker/trackers/ad_form.rb', line 6

def initialize(options)
  @pm = options[:pm]
  @id = options[:id]
  super()
end

Instance Method Details

#headerObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/the_tracker/trackers/ad_form.rb', line 16

def header
  return if !active
  "<!-- Adform Tracking Code BEGIN -->\n<script type=\"text/javascript\">\nvar _adftrack = {\npm: \#{@pm},\nid: \#{@id}\n};\n(function(){var s=document.createElement('script');s.type='text/javascript';s.async=true;s.src='https://track.adform.net/serving/scripts/trackpoint/async/';var x = document.getElementsByTagName('script')[0];x.parentNode.insertBefore(s, x);})();\n</script>\n<noscript>\n<p style=\"margin:0;padding:0;border:0;\">\n<img src=\"https://track.adform.net/Serving/TrackPoint/?pm=\#{@pm}&amp;lid=\#{@id}\" width=\"1\" height=\"1\" alt=\"\" />\n</p>\n</noscript>\n<!-- Adform Tracking Code END -->\n"
end

#nameObject



12
13
14
# File 'lib/the_tracker/trackers/ad_form.rb', line 12

def name
  :adform
end