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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

How to pass param via DTM script

eric9876588
Level 3
Level 3

¸¸Hi,

I want to update my target-global-mbox via a dom ready/non sequential js but I'm not sure about the syntax.

Because of some race condition, I can't create a data element and use it like this

  • user.categoryId = <mydataElement>

I must call everything as low as possible in my page.

Unless someone have an idea how to get rid of the race condition, while using the standard data element call from a page load rule, I need to confirm if the right syntax to update the target-global-mbox really is like so:

mboxUpdate('target-global-mbox','user.categoryId=dummyValue');

Thanks a lot

-Eric

1 Accepted Solution
ryanr701
Correct answer by
Employee
Employee

Hi Eric,

If I understand correctly you'd like to pass categoryId information to Target. That information isn't available until the "bottom of the page". So you're not able to capture that value at the top of the page for the Target global mbox request.

Here's an option for sending information to Target from data layers, or variables that aren't present until the bottom of the page.

Create a page load rule in DTM. Run at bottom of page. Add a custom Javascript tag that fires a secondary call to Target with the user.categoryId info. Your data element should return a value at the bottom of the page, or you could directly reference the variable.

This is a sample for the script you can use:

adobe.target.trackEvent({mbox:'dataCapture', params:{'user.categoryId':_satellite.getVar(dataElementName)}});

View solution in original post

4 Replies
ryanr701
Correct answer by
Employee
Employee

Hi Eric,

If I understand correctly you'd like to pass categoryId information to Target. That information isn't available until the "bottom of the page". So you're not able to capture that value at the top of the page for the Target global mbox request.

Here's an option for sending information to Target from data layers, or variables that aren't present until the bottom of the page.

Create a page load rule in DTM. Run at bottom of page. Add a custom Javascript tag that fires a secondary call to Target with the user.categoryId info. Your data element should return a value at the bottom of the page, or you could directly reference the variable.

This is a sample for the script you can use:

adobe.target.trackEvent({mbox:'dataCapture', params:{'user.categoryId':_satellite.getVar(dataElementName)}});

View solution in original post

eric9876588
Level 3
Level 3

Hi, in Adobe Experience Cloud Debugger, I'm assuming that it is normal now that for each page view I see two calls (one for target-global-mbox and one for datacapture).  Does this create an issue in terms of stats or in terms of first load behavior for a user?

But in network tab (".tt.") it's normal that in response I only see the sessionId?

ryanr701
Employee
Employee

Yes that is expected an normal. Should be not issues with the secondary call. Any Target call that isn't part of an activity will only have a sessionid as the response.