Füge Debug-Option hinzu, um das Laden von Anzeigen zu erzwingen, und verbessere das Fehlerhandling beim Laden des Propeller-Skripts
This commit is contained in:
@@ -31,6 +31,9 @@ const isEnabled = computed(() => {
|
|||||||
// Small sticky header option (thin sticky header)
|
// Small sticky header option (thin sticky header)
|
||||||
const sticky = (import.meta.env.VITE_HEADER_STICKY || 'true') === 'true';
|
const sticky = (import.meta.env.VITE_HEADER_STICKY || 'true') === 'true';
|
||||||
|
|
||||||
|
// Debug bypass: allow forcing ad load with ?ads_debug=1
|
||||||
|
const debugForceLoad = typeof window !== 'undefined' && new URLSearchParams(window.location.search).get('ads_debug') === '1';
|
||||||
|
|
||||||
// A/B test config
|
// A/B test config
|
||||||
const abRatio = Number(import.meta.env.VITE_AB_RATIO || '50'); // percent for variant B
|
const abRatio = Number(import.meta.env.VITE_AB_RATIO || '50'); // percent for variant B
|
||||||
|
|
||||||
@@ -100,6 +103,13 @@ async function renderPropeller() {
|
|||||||
s.dataset.zone = propSlotId;
|
s.dataset.zone = propSlotId;
|
||||||
s.src = propScriptUrl;
|
s.src = propScriptUrl;
|
||||||
s.async = true;
|
s.async = true;
|
||||||
|
s.onload = () => {
|
||||||
|
console.log('Propeller script loaded:', propScriptUrl, 'zone:', propSlotId);
|
||||||
|
};
|
||||||
|
s.onerror = (e) => {
|
||||||
|
console.warn('Propeller script failed to load:', propScriptUrl, e);
|
||||||
|
try { window.dispatchEvent(new CustomEvent('ads:load-failed', { detail: { provider: 'propeller', zone: propSlotId, error: String(e) } })); } catch {}
|
||||||
|
};
|
||||||
|
|
||||||
// Append to the document (documentElement or body) like the snippet does
|
// Append to the document (documentElement or body) like the snippet does
|
||||||
const target = [document.documentElement, document.body].filter(Boolean).pop();
|
const target = [document.documentElement, document.body].filter(Boolean).pop();
|
||||||
|
|||||||
Reference in New Issue
Block a user