Fix OpenPanel consent tracking bootstrap

This commit is contained in:
2026-05-14 15:51:06 +02:00
parent 87bd5af809
commit ffb368670c
2 changed files with 4 additions and 2 deletions
+1
View File
@@ -129,6 +129,7 @@ import { cookieBannerCopy } from "../data/locales";
if (existing) { if (existing) {
applyPreference(existing); applyPreference(existing);
closeBanner(); closeBanner();
window.dispatchEvent(new CustomEvent("dg:cookie-consent", { detail: { preference: existing } }));
return; return;
} }
+3 -2
View File
@@ -70,10 +70,11 @@ const chromeCopy = getChromeCopy({ activeSlug, issueDate, articleKey });
/> />
<title>{title}</title> <title>{title}</title>
<script is:inline> <script is:inline>
window.op=window.op||function(){var n=[];return new Proxy(function(){arguments.length&&n.push([].slice.call(arguments))},{get:function(t,r){return"q"===r?n:function(){n.push([r].concat([].slice.call(arguments)))}},has:function(t,r){return"q"===r}})}; window.op=window.op||function(){var n=[];return new Proxy(function(){arguments.length&&n.push([].slice.call(arguments))},{get:function(t,r){return"q"===r?n:function(){n.push([r].concat([].slice.call(arguments)))}},has:function(t,r){return"q"===r}})}();
(function(){ (function(){
var cfg={apiUrl:'https://analytics.bluenotelogic.com/api',clientId:'6a6d90f8-66ea-413e-9b3d-9b7278ac6c09',trackScreenViews:true,trackOutgoingLinks:true,trackAttributes:true}; var cfg={apiUrl:'https://analytics.bluenotelogic.com/api',clientId:'6a6d90f8-66ea-413e-9b3d-9b7278ac6c09',trackScreenViews:true,trackOutgoingLinks:true,trackAttributes:true};
function initOP(){window.op('init',cfg);var s=document.createElement('script');s.src='https://analytics.bluenotelogic.com/op1.js';s.defer=true;s.async=true;document.head.appendChild(s);} var opLoaded=false;
function initOP(){if(opLoaded)return;opLoaded=true;window.op('init',cfg);var s=document.createElement('script');s.src='https://analytics.bluenotelogic.com/op1.js';s.defer=true;s.async=true;document.head.appendChild(s);}
if(document.documentElement.getAttribute('data-cookie-analytics')==='true'){initOP();} if(document.documentElement.getAttribute('data-cookie-analytics')==='true'){initOP();}
window.addEventListener('dg:cookie-consent',function(e){var p=e.detail&&e.detail.preference||'';if(p==='all'||p.indexOf('analytics')!==-1){initOP();}}); window.addEventListener('dg:cookie-consent',function(e){var p=e.detail&&e.detail.preference||'';if(p==='all'||p.indexOf('analytics')!==-1){initOP();}});
})(); })();