3 Replies Latest reply on Jun 27, 2017 2:01 AM by ParitMittal

    How to target on browser Language using Expression Targets?

    xbarcelona Level 1

      Hi there

      I want to target base on browser language (ex. German) but are not sure how to create a correct Expression-Target for this?

      Not sure if user.header or user.browser should be used and how the correct syntax should look like? Then there is also user.header('accept-language') and user.header('accept') which both seem to fit somehow?

      I created these 3 Expression Targets but am not sure about which one is correct?

      1.return user.header('accept-language')=="de";

      2.return (user.header.indexOf('de') != -1);

      3. return (user.browser.indexOf('de') != -1);

       

      thanks for your help.

      Nicolas

      • 0. Re: How to target on browser Language using Expression Targets?
        Shekhar_Dhiman Adobe Employee

        Hi Nicolas,

        Thank you for reaching out to Adobe Community.

        I would request you to kindly try and use the below code and see if it helps:

        return user.header('accept-language').indexOf('de') > -1

        Thanks!

        • 2. Re: How to target on browser Language using Expression Targets?
          TheQuinn

          Do you know when this list of languages will be increased as it is incredibly restricted.

          Screen Shot 2017-06-23 at 14.04.29.png

          • 3. Re: How to target on browser Language using Expression Targets?
            ParitMittal Level 5

            Hi Mike,

             

            Thanks for reaching out to Adobe Target community .

             

            Can you please let us know the browser language on which you want to base your targeting activity?

             

            Regards

            Parit