I want to dispatch a custom event from Adobe Target, once the Adobe Target Activity has been fully loaded on the DOM. (For example an Experience Fragment from Adobe Target replacing an AEM XF, and dispatchEvent should be triggered only once this is completed)
From AEM end, then the code will listen to this custom event and start processing something.
I've already tried adding a script from Adobe Target like this, but it didn't work as I expected.
Appreciate any advice on this.
<script>
window.onload = function() {
const event = new Event("targetContentLoaded");
window.dispatchEvent(event);
}
</script>
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @IndivariJa
I think you can make a use of adobe target (at.js) custom events called Content Rendering Succeeded
Constant: adobe.target.event.CONTENT_RENDERING_SUCCEEDED
String Value: at-content-rendering-succeeded
Description: Offer rendering was successful. DOM changes have been applied.
and then from AEM end you can listen and process next
Here is the link for more info - https://experienceleague.adobe.com/en/docs/target-dev/developer/client-side/at-js-implementation/fun...
Hope this helps.
Hi @IndivariJa
I think you can make a use of adobe target (at.js) custom events called Content Rendering Succeeded
Constant: adobe.target.event.CONTENT_RENDERING_SUCCEEDED
String Value: at-content-rendering-succeeded
Description: Offer rendering was successful. DOM changes have been applied.
and then from AEM end you can listen and process next
Here is the link for more info - https://experienceleague.adobe.com/en/docs/target-dev/developer/client-side/at-js-implementation/fun...
Hope this helps.
Thank you @Gokul_Agiwal . Yes that worked.
Views
Replies
Total Likes
Views
Like
Replies