debug: add explicit dispatch of load event
This commit is contained in:
@@ -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")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user