AEM Personalization events | Community
Skip to main content
November 3, 2016

AEM Personalization events

  • November 3, 2016
  • 3 replies
  • 8708 views

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 ****************"); });
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

3 replies

smacdonald2008
November 3, 2016

This is not documented - i am looking into this. 

Sham_HC
November 3, 2016

try with “teaser-loaded”

bfvaughnAuthor
November 3, 2016

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.

bfvaughnAuthor
November 3, 2016

So target-dom-loaded event fires as long as I do not set the engine.

Ratna_Kumar
November 3, 2016

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.

bfvaughnAuthor
January 4, 2017

The solution was to target 'segment-engine:teaser-loaded' event.

November 15, 2019

'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


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