Commit f615ee9b authored by Axel García's avatar Axel García

Include OneTrust script on JS to avoid templates

parent 3390ca52
- if one_trust_enabled?
<!-- OneTrust -->
= javascript_include_tag "https://cdn.cookielaw.org/consent/#{extra_config.one_trust_id}/OtAutoBlock.js"
%script{ :src => "https://cdn.cookielaw.org/scripttemplates/otSDKStub.js", :charset => "UTF-8", :"data-domain-script" => extra_config.one_trust_id, :defer => true, :nonce => content_security_policy_nonce }
= javascript_tag nonce: content_security_policy_nonce do
:plain
const oneTrustScript = document.createElement('script');
oneTrustScript.src = 'https://cdn.cookielaw.org/scripttemplates/otSDKStub.js';
oneTrustScript.dataset.domainScript = '#{extra_config.one_trust_id}';
oneTrustScript.nonce = '#{content_security_policy_nonce}'
oneTrustScript.charset = 'UTF-8';
oneTrustScript.defer = true;
document.head.appendChild(oneTrustScript);
function OptanonWrapper() { }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment