Anmelden
Zugang zu Bibliothek, Punkten und Rewards.
Noch kein Konto? Jetzt registrieren
(function() {
var adsInitialized = false;
function loadAdsenseScript() {
if (adsInitialized || window.adsbygoogle) return;
var clientMeta = document.querySelector('meta[name="eira-adsense-client"]');
var client = clientMeta ? clientMeta.getAttribute('content') : '';
if (!client) return;
var script = document.createElement('script');
script.async = true;
script.src = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=' + encodeURIComponent(client);
script.crossOrigin = 'anonymous';
document.head.appendChild(script);
adsInitialized = true;
}
function mountAdsInSlots() {
document.querySelectorAll('.ad-slot[data-ad-enabled="1"]').forEach(function(slot) {
if (slot.getAttribute('data-ad-mounted') === '1') return;
var variant = slot.getAttribute('data-ad-variant') || 'inline';
var client = slot.getAttribute('data-ad-client') || '';
var chosenSlot = variant === 'feed'
? (slot.getAttribute('data-ad-slot-feed') || '')
: (slot.getAttribute('data-ad-slot-inline') || '');
var box = slot.querySelector('.ad-slot__body');
if (!box || !client || !chosenSlot) return;
var ins = document.createElement('ins');
ins.className = 'adsbygoogle';
ins.style.display = 'block';
ins.setAttribute('data-ad-client', client);
ins.setAttribute('data-ad-slot', chosenSlot);
if (variant === 'feed') {
ins.setAttribute('data-ad-format', 'fluid');
ins.setAttribute('data-ad-layout-key', '-gw-3+1f-3d+2z');
} else {
ins.setAttribute('data-ad-format', 'auto');
ins.setAttribute('data-full-width-responsive', 'true');
}
box.innerHTML = '';
box.appendChild(ins);
try { (adsbygoogle = window.adsbygoogle || []).push({}); } catch (e) {}
slot.setAttribute('data-ad-mounted', '1');
});
}
window.eiraApplyAdsConsent = function() {
var allowed = !!window.eiraMarketingConsent;
document.querySelectorAll('.ad-slot').forEach(function(slot) {
slot.setAttribute('data-ad-consent', allowed ? 'granted' : 'denied');
});
if (!allowed) return;
loadAdsenseScript();
mountAdsInSlots();
};
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', function() {
if (window.eiraApplyAdsConsent) window.eiraApplyAdsConsent();
});
} else {
if (window.eiraApplyAdsConsent) window.eiraApplyAdsConsent();
}
})();