How do we know when the Adobe Target activity finished loading on to the DOM | Community
Skip to main content
New Member
July 10, 2024
Solved

How do we know when the Adobe Target activity finished loading on to the DOM

  • July 10, 2024
  • 1 reply
  • 1470 views

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>


 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Gokul_Agiwal

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/functions-overview/atjs-custom-events 

Hope this helps. 

1 reply

Gokul_Agiwal
Community Advisor
Gokul_AgiwalCommunity AdvisorAccepted solution
Community Advisor
July 11, 2024

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/functions-overview/atjs-custom-events 

Hope this helps. 

New Member
July 18, 2024

Thank you @gokul_agiwal . Yes that worked.

Gokul_Agiwal
Community Advisor
Community Advisor
July 19, 2024

Hi @indivarija  Glad to know that its worked for you. 

Thanks