Class: Analytical::Modules::Hubspot
- Inherits:
-
Object
- Object
- Analytical::Modules::Hubspot
- Includes:
- Base
- Defined in:
- lib/analytical/modules/hubspot.rb
Instance Attribute Summary
Attributes included from Base
#command_store, #initialized, #options, #tracking_command_location
Instance Method Summary collapse
- #init_javascript(location) ⇒ Object
-
#initialize(options = {}) ⇒ Hubspot
constructor
A new instance of Hubspot.
Methods included from Base
#init_location, #init_location?, #process_queued_commands, #protocol, #queue
Constructor Details
#initialize(options = {}) ⇒ Hubspot
6 7 8 9 |
# File 'lib/analytical/modules/hubspot.rb', line 6 def initialize(={}) super @tracking_command_location = :body_append end |
Instance Method Details
#init_javascript(location) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/analytical/modules/hubspot.rb', line 11 def init_javascript(location) init_location(location) do js = " <!-- Analytical Init: Hubspot -->\n <script type=\"text/javascript\" language=\"javascript\">\n var hs_portalid=\#{options[:portal_id]};\n var hs_salog_version = \"2.00\";\n var hs_ppa = \"\#{options[:domain]}\";\n document.write(unescape(\"%3Cscript src='\" + document.location.protocol + \"//\" + hs_ppa + \"/salog.js.aspx' type='text/javascript'%3E%3C/script%3E\"));\n </script>\n HTML\n js\n end\nend\n" |