Dynamic Links Adobe Target tracking

Avatar

Avatar

johnuff

Avatar

johnuff

johnuff

13-11-2020

I am trying to track dynamic links via AT, in the editor i have the right selectors see image, these link are dynamically added to the pages after page load so don't receive the AT class .at-element-click-tracking. Any ideas how i can track these links?

 

selected-links.PNG

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Eric_Vidana

Avatar

Eric_Vidana

Eric_Vidana

13-11-2020

Are you trying to have all of those function as conversion mbox events? Could just put a click handler on all of them via client side js and fire off a trackEvent call.

 

Something like

 

function fireConversion() {
    window.adobe.target.trackEvent({'mbox':'facetClick'})
}

document.querySelectorAll('div.someclass').forEach((d)=> {
    d.addEventListener("click", fireConversion);
});

Answers (0)