Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

[AEM Gems Webinar] Accelerating Experience Manager as a Cloud Service development with Rapid Development Environments
Adobe Summit 2023 | Complete list of AEM Sessions & Labs

AEM Personalization events

Avatar

Level 3

I need to perform some logic after a targeted component had been rendered on the page.  We are using a campaign, segments to display targeted content.  Is there a dom event I can listen to to know the personalized component has been added to the page?  I have the below code but it no long seem to work. 

$CQ('div').on('target-dom-loaded', function(event) { console.debug("*******************  target-dom-loaded ****************"); });
0 Replies

Avatar

Level 3

My engine choice is ContextHub and I'm using the default target option on the component.  I don't see 'teaser-loaded' getting called either.

Avatar

Community Advisor

Hi

Watch this Ask the community experts topic on personalization topic
// https://communities.adobeconnect.com/p9neqyup4j5/?launcher=false&fcsContent=true&pbMode=normal

Hope this might help to you

Thanks,
Ratna Kumar.

Avatar

Level 1

'bfvaughn' is correct in that the 'segment-engine:teaser-loaded' is the event fired.

I'm unsure as to whether this event is fired when 'all teasers' are loaded or 'just the first teaser' on a page is loaded.

This event was fired when using the 'Target Component' in AEM 6.2 using the 'ContextHub' Strategy.

The only way I was able to listen to this event inside a clientlib for a component was to use the ContextHub.Eventing as it did not get detected when using a normal jQuery.on() approach.

This is the snippet that worked for me:

window.ContextHub.eventing.on(ContextHub.SegmentEngine.PageInteraction.Teaser.prototype.info.loadEvent, function() {

  // for each component that now exists on the page...

});

Regards,

Ed

Avatar

Level 1

I am not able to detect "segment-engine:teaser-loaded" event on AEM6.1 SP2 and we have not enabled ContextHub. Any help is appreciated.

Avatar

Level 1

I think this event is fired every time any component is loaded, is it possible to know wich element triggered the event?

Avatar

Level 2

How did you get this code? Any sources we can check? OR just reading the source code?