Expand my Community achievements bar.

SOLVED

Reco - Need to pass entity.categoryId in globalMbox via script

Avatar

Level 3

Hi,

We're using DTM to fetch elements in the DOM of the page and put this in dataelement.  To use criteria to show recommended articles based off of the category of the viewed article, I need to pass entity.categoryId to target-global-mbox

For race condition reasons, I can't use the fields in the Adobe Target widget of the page load rule, so I use the Javascript / Third Party Tags widget to do this, on a "onLoad" condition, to make sure that my dataelement is populated.  Note that if I use static value, I can use the Adobe Target widget, but it's not an option since we have a lot of categories and this would translate in creating multiple rules, multiple criteria, multiple Target activities... not scalable.

I'm using this to pass the categoryId to target-global-mbox

adobe.target.trackEvent({

    mbox:'target-global-mbox',

    params:{

      'entity.categoryId':_satellite.getVar("schemaPageCategory")

    }

  }

  );

Now, with this, I see that Target has a second call to target-global-mbox with entity.categoryId in it, but my mboxTrace continues to state that Target can't locate a categoryId value.

My reasoning of this problem is that the reco engine only fires on the first target-global-mbox call (where there is no entity.categoryId yet) and is not taking into account the second call (where I send that value).

Two questions for you:

  1. Could this be because the recs criteria doesn't understand the second target-global-mbox call?
  2. How could I make sure the recs engine retrieves the entity.categoryId at the right time?

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 10

Eric,

  • Can you see the desired/expected behaviour on the 3rd mbox call?
  • If you want to see the expected behaviour on the 2nd mbox call and you are happy with possible flickering effect (I presume the page is loaded/rendered at the time the 2nd call is sent), then consider replacing the event call with the getOffer/applyOffer call.

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Eric,

  • Can you see the desired/expected behaviour on the 3rd mbox call?
  • If you want to see the expected behaviour on the 2nd mbox call and you are happy with possible flickering effect (I presume the page is loaded/rendered at the time the 2nd call is sent), then consider replacing the event call with the getOffer/applyOffer call.

Avatar

Level 1

Have you been able to solve your problem?  I'm facing the same one and wonder if you would like to share your solution.