Hi @JpVe1 ,
To resolve the "Identity cookie not found" and "sendEvent errors" in Adobe Launch, follow these steps:
Check Identity Cookie: Ensure the identity cookie is available before calling sendEvent. Use fallback or retry logic to handle cases where it's not set yet.
Use Async Block & Try-Catch: Wrap the sendEvent call in an async block with try-catch for error handling:
async function sendEventAsync() {
try {
await alloy.sendEvent(...);
} catch (error) {
console.error('sendEvent failed:', error);
}
}
sendEventAsync();
function sendEventWithRetry(retries = 3) {
if (window.adobeDataLayer) {
try { alloy.sendEvent(...); } catch (e) { console.error('sendEvent failed:', e); }
} else if (retries > 0) {
setTimeout(() => sendEventWithRetry(retries - 1), 1000);
}
}
sendEventWithRetry();
Ensure Proper SDK Initialization: Confirm that Adobe Alloy/SDK is fully initialized before calling sendEvent.
Test Across Browsers: Ensure cookie and network settings aren’t blocking the identity cookie, especially in privacy-conscious browsers.
This approach should minimize errors related to cookie loading and event sending.