Class: Consently::Providers::Hotjar

Inherits:
Base
  • Object
show all
Defined in:
lib/consently/providers/hotjar.rb

Constant Summary

Constants inherited from Base

Base::SAFE_OPTION

Instance Attribute Summary

Attributes inherited from Base

#category, #key, #options

Instance Method Summary collapse

Methods inherited from Base

build, cookie, cookie_manifest, #cookies, google?, #google?, #initialize, #noscript, provider_key, provider_key=, register, registry, #to_s

Constructor Details

This class inherits a constructor from Consently::Providers::Base

Instance Method Details

#scriptsObject



10
11
12
13
14
15
16
17
# File 'lib/consently/providers/hotjar.rb', line 10

def scripts
  [ Script.new(inline: <<~JS.strip) ]
    (function(h,o,t,j,a,r){h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};
    h._hjSettings={hjid:#{id},hjsv:#{version}};a=o.getElementsByTagName('head')[0];
    r=o.createElement('script');r.async=1;r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;
    a.appendChild(r);})(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');
  JS
end