Profile Script to create user Attributes not working?
Hi all,
we want to use Adobe Target to personalize a Banner on our Website. Our Website is set up in 25 languages.
We already implemented Adobe Target and can personalize our Banner using Audiences and a JSON-Offer. This works fine. So e.g. i choose the audience "de" for Germany and the customer_segment "xs", i create the JSON-Offer for this Audience and everything works fine.
The problem is that i need to create for each language and customer_segment combination a new experience. If i have 4 customer segments -> then i have to create 4 x 25 (languages) = 100 Experiences.
I think it would be better to have only 4 Experiences (the 4 customer segment audiences) and the experience/ JSON-Offer uses dynamic values for the correct translation of each element.
Our implemented mbox is sending the "userLanguage" with the value of e.g. "de".
The idea is that we use "Profile Scripts" to create the translation dependent on the "userLanguage"
So the final offer JSON offer contains placeholders:
{
"imageUrl": "${user.imageUrl}",
"headline": "${user.headline}",
"subHeadline": "${user.subHeadline}",
"buttonText": "${user.buttonText}",
"buttonUrl": "${user.buttonUrl}"
}
The current problem. The placeholders are empty. Which means i don´t have the profile attributes...
So the problem probably sits in this profile script i use to accomplish this...
if (mbox.name == 'cockpit_banner') {
var lang = mbox.param('userLanguage');
if (lang == 'de') {
user.set('imageUrl', 'xxx.jpg');
user.set('headline', 'DE Headline');
user.set('subHeadline', 'DE Subheadline');
user.set('buttonText', 'DE Button Text');
user.set('buttonUrl', 'https://www.123.de');
} else {
user.set('imageUrl', 'xxx.jpg');
user.set('headline', 'Default Headline');
user.set('subHeadline', 'Default Subheadline');
user.set('buttonText', 'Default buttonText');
user.set('buttonUrl', 'https://www.123.com');
}
}I already double and triple checked that userLanguage is transferred and also checked that the mbox name is cockpit_banner.
The script isn´t showing any errors.
I checked the implementation multiple times, as mentioned when using the placeholders the values are empty (so the banner is not shown), but technically the rest is working..., so the problem is that the profile script is not setting the user attributes.. but why?
In general, is this the right approach?
Is this logic in general possible, or do i have misunderstood some adobe documentation?
Best Regards and thank you for looking into this,
René