How do we know when the Adobe Target activity finished loading on to the DOM | Adobe Higher Education
Skip to main content
New Member
July 10, 2024
해결됨

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

  • July 10, 2024
  • 1 답변
  • 1476 조회

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>


 

 

 

이 주제는 답변이 닫혔습니다.
최고의 답변: 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 답변

Gokul_Agiwal
Community Advisor
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. 

IndivariJa작성자
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