Expand my Community achievements bar.

SOLVED

Adobe Target: mbox Paramter Update

Avatar

Level 3

I have wrote script like whenever user enters the Date of Birth the mbox will update with DOB:"06/06/2017" means DOB parameter will be pass in mbox.

My concerns is I am updating DOB on form page and I need to show the DOB value in the home page which user has already selected on form page.

Please guide to solve this issue

1 Accepted Solution

Avatar

Correct answer by
Level 2

Hi Ruchika,

If you wish to persist DOB for the user then you need to store DOB in profile based on your mbox settings it will last for 30 days or more and you can use it on different page.

while creating mbox or updating mbox you can use below syntax to store it in profile.

<script>

  mboxCreate('mboxName','mboxName','profile.DOB=06/23/2017','param2=value2');

</script>

or

<script>

mboxDefine('someId','mboxName','profile.DOB=06/23/2017','param2=value2');

mboxUpdate('mboxName','param3=value3','param4=value4');

</script>

once it's stored in profile at your home page offer code can read it with below code

<script>

mboxFactoryDefault.addOnLoad(function(){

        //use strDOB variable and set it in banner.

        var strDOB = "${profile.DOB}";

        console.log("skus" +strDOB);

});

</script>

View solution in original post

6 Replies

Avatar

Level 2

Hi Are you using mbox.js or at.js?

Avatar

Level 10

Hi Ruchika,

Thanks for reaching out to Adobe Target Community.

Løjmannryanr8 Can you please provide your expert inputs on the above query ?

Regards

Parit Mittal

Avatar

Level 2

Hi Ruchika,

you can use code as given below.

Using "${}" you can access all profile and mbox variables in offer code.

on mbox load I am accessing DOB variable using $ and storing value in strDOB

mboxFactoryDefault.addOnLoad(function(){

        var strDOB = "${mbox.DOB}";

        console.log("skus" +skus);

    });

Avatar

Level 3

Hi,

When I select the DOB from the form page

1237810_pastedImage_0.png

I can see the DOB is passed in mbox parameter

1237901_pastedImage_1.png

Now this is happening on form page but My requirement is to show a banner on home page based on DOB if selected on form page so if user comes next day on home page, I can show the customize one to person falls before June and after June on Home. How can I achieve that?

Avatar

Correct answer by
Level 2

Hi Ruchika,

If you wish to persist DOB for the user then you need to store DOB in profile based on your mbox settings it will last for 30 days or more and you can use it on different page.

while creating mbox or updating mbox you can use below syntax to store it in profile.

<script>

  mboxCreate('mboxName','mboxName','profile.DOB=06/23/2017','param2=value2');

</script>

or

<script>

mboxDefine('someId','mboxName','profile.DOB=06/23/2017','param2=value2');

mboxUpdate('mboxName','param3=value3','param4=value4');

</script>

once it's stored in profile at your home page offer code can read it with below code

<script>

mboxFactoryDefault.addOnLoad(function(){

        //use strDOB variable and set it in banner.

        var strDOB = "${profile.DOB}";

        console.log("skus" +strDOB);

});

</script>