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é
Views
Replies
Total Likes
Hi @Reneva2 ,
If your profile script in Adobe Target isn't creating user attributes correctly, it's likely because you're trying to access data directly from the page using JavaScript functions that aren't available server-side within the profile script; make sure to pass the necessary data into Target through an mbox request first, then access it us.
crs.get()
function to access passed data within your profile script, specifying the data source and attribute name correctly. crs.get()
and crs.set()
functions with the correct data source and attribute names.
Views
Replies
Total Likes
Hi @Reneva2 ,
Instead of using :
user.set('imageUrl', 'xxx.jpg');
Can you try using :
user.setLocal('imageUrl', 'xxx.jpg');
Let me know if it helps.
Best regards,
Vaibhav Mathur
Views
Replies
Total Likes
@Reneva2 suggest to use below
using java Script on your page
- Window onload event get language type from window.navigator
- then pass language value to target via target param
- read passed language param value at server side
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies