0

In our localized product recommendation display we want the button text to have the language in which the recommendation is rendered. I've written some Einstein AMPscript to capture the countrycode of the URL, which I want to base the button text language on. The code looks like this:

ProductLinkSplit.At2Split/At0

This works fine, when I output it onto the display it returns nl, de, co.uk, etc. However when I want to compare this value to the string value "nl" for instance, the condition doesn't go the path I expect. I suspect this has something to do with the way I compare the string, this is the complete conditional statement:

%%[if ProductLinkSplit.At2Split/At0 == 'nl' then]%%
Bekijk
%%[else]%%
View
%%[endif]%%

The link in the preview contains a "nl" so this statement should return "Bekijk". However, when I change the "nl" in the string comparison with "de" the condition still returns "Bekijk" when it should return "View". I've tried putting the nl between double quotes or without quotes at all, but it still doesn't work. Does anyone has any experience with this and is able to help me out? Thanks

1

I would recommend using localized fields. Then in the rec call you would pass ?locale=nl-nl to pull the display for the correct locale

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.