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
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Dynamic Links Adobe Target tracking

johnuff
Level 2
Level 2

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

1 Accepted Solution
Eric_Vidana
Correct answer by
Level 8
Level 8

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);
});

View solution in original post

9 Replies
Eric_Vidana
Correct answer by
Level 8
Level 8

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);
});

View solution in original post

johnuff
Level 2
Level 2

Thank you @Eric_Vidana  for the answer, I did read you can make your own triggers, will this create the same action /event that selecting via the editor? Because when I look in dev tools ad see the delivery action in the network tab I don't see a 'mox' key from the the ones tagged via the editor?

 

 

delivery-mbox.PNG

Eric_Vidana
Level 8
Level 8
@johnuff can you open up that notification[0] property. There should be a mbox property in there which holds the name.
johnuff
Level 2
Level 2

@Eric_Vidanathe notification does show the mbox name, just having trouble changing the type from display to click, I have tried 

 

 window.adobe.target.trackEvent({ 'mobox': 'facetClick', type: 'click'})

 

and I assume to track this mbox in Goals and Settings I create a Conversion goal of Viewed an Mbox? 

Eric_Vidana
Level 8
Level 8
@johnuff correct. set it up as a viewed an mbox rather than click. I have noticed that click only seems to pertain to the same name as the entry mbox. I think you are on the right track.
Eric_Vidana
Level 8
Level 8
@johnuff also, window.adobe.target.trackEvent({'mbox':'facetClick'}) the mbox name 'facetClick' will be your input/mbox name on that settings page. You can name this whatever your want. Nothing special about facetClick.
zach_shearer
Level 3
Level 3
Just a note that forEach won't work in Internet Explorer 11, if that matters to you. https://caniuse.com/?search=foreach
Eric_Vidana
Level 8
Level 8
@ zach_shearer fair point. same goes for arrow functions. thanks for calling it out.
johnuff
Level 2
Level 2

@zach_shearer thanks yeah I know about forEach and ie11 and i would have loved to write the functionality in es6.