I have been working in custom preference centre and one of the requirement is to translate the page based on the browser language. The difficulty here is detecting the browser language "Navigator.language" returns the browser language however its a client side function. The translations are managed through AMP Script, how can we get this language value passed to AMP Script?


It's possible:

  1. With GetUserLanguages SSJS function - but from initial testing this works only in Microsites, not on CloudPages
  2. Getting Accept-Language header with GetRequestHeader SSJS function - this will work for both Microsites and CloudPages
  3. With HTTPRequestHeader Ampscript function - same header as above

You can pass values from SSJS to Ampscript with SetValue

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.