Reco - Need to pass entity.categoryId in globalMbox via script | Community
Skip to main content
New Participant
March 28, 2019
Solved

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

  • March 28, 2019
  • 2 replies
  • 1935 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Andrey_Osadchuk

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.

2 replies

New Participant
July 6, 2021

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

Andrey_Osadchuk
Andrey_OsadchukAccepted solution
New Participant
April 4, 2019

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.