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

Use DTM to create an audience in Target

philipk92120636
Level 4
Level 4

Hi there,

I want to save a cookie as a data element in DTM and then use this to create a parameter in Target which can be used to create a simple audience of visitors that have the cookie and visitors that don't.

I've done the easy part and created the data element, but I don't know what to do next.

We have a huge direct call rule that seems to be creating all our custom Target parameters (?) and most of the rules take the format as below. Would this work?

if (_satellite.getVar("customCookie") != "") {

    mboxrequestparams.push('"user.productName.customCookie=' + _satellite.getVar("customCookie") + '"');

    mboxparams["user.productName.customCookie"] = _satellite.getVar("customCookie");

}

1 Accepted Solution
Vijaya_Vignesh1
Correct answer by
Level 2
Level 2

Hey Philipk,

For sending data to Target we use the targetPageParamsAll() function inside the Adobe Target Tool > Library management > custom code

function targetPageParams() {

/*this function define will add those parameters in mbox request*/

return {

"cookieName": cookieValue,

}

};

Documentation Link: Methods

View solution in original post

2 Replies
Vijaya_Vignesh1
Correct answer by
Level 2
Level 2

Hey Philipk,

For sending data to Target we use the targetPageParamsAll() function inside the Adobe Target Tool > Library management > custom code

function targetPageParams() {

/*this function define will add those parameters in mbox request*/

return {

"cookieName": cookieValue,

}

};

Documentation Link: Methods

View solution in original post

philipk92120636
Level 4
Level 4

Hi Vijaya,

Many thanks for this. When I want to reference these in audience rules in Target would they still be accessible using mbox.param and the name I send through in the function above e.g. mbox.param("cookieName")?

As a side note, I realised that in my initial code snippet that was a bunch of custom code written by our integrator (I thought they were common Target methods).

What I did in the end was add the cookie and the related data element to the global mbox parameters in the Target tool configuration in DTM.