debug: add explicit dispatch of load event

This commit is contained in:
Arvid Norlin
2024-03-05 15:49:44 +01:00
parent 40ec10698f
commit f19b79f732

View File

@@ -83,11 +83,7 @@ export default function Tracking({ pageData }: TrackingProps) {
console.log("Cookiebot onAccept callback fired ✅") console.log("Cookiebot onAccept callback fired ✅")
setConsentCookie(window._satellite.cookie.get("CookieConsent")) setConsentCookie(window._satellite.cookie.get("CookieConsent"))
if (window.Cookiebot?.changed && window.adobe) { if (window.Cookiebot?.changed && window.adobe) {
if ( if (consentCookie?.includes("statistics:true")) {
window._satellite.cookie
.get("CookieConsent")
.includes("statistics:true")
) {
window.adobe.optIn.approve( window.adobe.optIn.approve(
window.adobe.OptInCategories.ANALYTICS, window.adobe.OptInCategories.ANALYTICS,
true true
@@ -99,7 +95,8 @@ export default function Tracking({ pageData }: TrackingProps) {
) )
} }
window.adobe.optIn.complete() window.adobe.optIn.complete()
console.log("optin complete") window.dispatchEvent(new Event("load"))
console.log("dispatched load event")
} }
} }
) )