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
Solved! Go to Solution.
Views
Replies
Total Likes
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>
Views
Replies
Total Likes
Hi Are you using mbox.js or at.js?
Views
Replies
Total Likes
I am using mbox.js
Views
Replies
Total Likes
Views
Replies
Total Likes
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);
});
Views
Replies
Total Likes
Hi,
When I select the DOB from the form page
I can see the DOB is passed in mbox parameter
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?
Views
Replies
Total Likes
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>
Views
Replies
Total Likes
Views
Like
Replies