Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

The 1st edition of the Target Community Lens newsletter is out now! Click to the right to find all the latest updates
SOLVED

English browser language audience set up

Avatar

Level 2

our website is translated into 4 different languages (english, german, french, japanese). For the most part, we run our tests on english versions of the page and I have tried to create a audience with the specifications of browser > language > equals > english. When I did that the test came up with zero traffic. However If I set up the audience as browser > language > does not equal > French, German, Japanese

I recieve usual traffic. why is this happening? and why can't I set it up as equals english? 

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Hi @Maple-Michelle1

Perhaps you've solved this already. Normally the out of the box Browser > Language audience rule options should work fine. However, if you find them not working as expected you could use a profile script to define an audience. The profile script could check for the four languages you care about and return which one is most preferred. Something like this:

var brL = user.header('accept-language') || "0";
if (brL.search(/^ja|^en|^fr|^de/) > -1) {
	return brL.substring(0,2);
}

Then in your English audience rule use: Visitor Profile > Name-of-your-profile-script equals: en

Hope that helps.

 

View solution in original post

2 Replies

Avatar

Correct answer by
Employee Advisor

Hi @Maple-Michelle1

Perhaps you've solved this already. Normally the out of the box Browser > Language audience rule options should work fine. However, if you find them not working as expected you could use a profile script to define an audience. The profile script could check for the four languages you care about and return which one is most preferred. Something like this:

var brL = user.header('accept-language') || "0";
if (brL.search(/^ja|^en|^fr|^de/) > -1) {
	return brL.substring(0,2);
}

Then in your English audience rule use: Visitor Profile > Name-of-your-profile-script equals: en

Hope that helps.

 

Avatar

Community Advisor

Hi @Ryan_Roberts_  I am getting "0" as the profile script value. does it mean this accept-language is not present in the user header?