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
  <<-EOF
<!-- Adform Tracking Code BEGIN -->
<script type="text/javascript">
var _adftrack = {
pm: #{@pm},
id: #{@id}
};
(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);})();
</script>
<noscript>
<p style="margin:0;padding:0;border:0;">
<img src="https://track.adform.net/Serving/TrackPoint/?pm=#{@pm}&amp;lid=#{@id}" width="1" height="1" alt="" />
</p>
</noscript>
<!-- Adform Tracking Code END -->
EOF
end

#nameObject



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

def name
  :adform
end