Optimize
1.5K members online now
1.5K members online now
Discover how to select who is eligible to be in your experiment, and when they’re served experiment variations.
Guide Me
star_border
Reply

How to make two Optimize tests related?

Follower ✭ ☆ ☆
# 1
Follower ✭ ☆ ☆

Hello!

 

Any copy related A/B test I do, I need to do 2 versions because my site is run in 2 languages. 

I would like that these 2 tests are related, so that a person who sees B version in one language should also see B version in the other languange, in case they would check both languages for some reason.

 

How to make two Optimize tests related? 

 

BR,

Karin

How to make two Optimize tests related?

Follower ✭ ✭ ☆
# 2
Follower ✭ ✭ ☆

Hello Karin,

 

Could you please share your website's url,So I can check your domain and languages then tell you what we can do?

 

Thanks,

 

D.

How to make two Optimize tests related?

Follower ✭ ☆ ☆
# 3
Follower ✭ ☆ ☆

Hi!

 

It's tele2.ee and tele2.ee/ru for other language.

But does it matter what the URL is? Because I have also done tests where similar kind of information is displayed on different pages (but in the same language). So create a 2 different tests for both URLs in the same language and I would like that these two tests are connected the same way - if a customer sees B version on one URL, he sees also B in the other URL.


BR,

Karin 

How to make two Optimize tests related?

Follower ✭ ✭ ☆
# 4
Follower ✭ ✭ ☆

Hi again Karin,

 

Your website has 2 language,Estonia and Russia.When you are creating an experiement,You can decide which url that you test page on.--> http://prntscr.com/fggit9

 

If you are not testing just wording, test effects the both language if class names are the same.

 

But creating a different testes for different languages is better.

 

Thanks,

 

D.

Re: How to make two Optimize tests related?

Follower ✭ ✭ ✭
# 5
Follower ✭ ✭ ✭

I'm not sure if there's a more straight-forward approach using what's been built into Optimize (it'd be great to hear some feedback from Google), but below is a fool-proof way to make your changes all in one test.

 

First, click on the Select elements icon in your variant. Next, type head then choose ADD CHANGE and select the JavaScript option. Then, simply paste this code, and change the text, the selector where the text edit is being made, and the URLs accordingly (I commented the areas you need to change):

 

// You can add more elements as needed

var languageEdits = {
	
	someElement: document.getElementsByClassName('YOUR-ELEMENT-SELECTOR')[0], // You might have to change getElementsByClassName to getElementById without the [0] at the end depending on what the element you are changing is
	
	makeChanges: function(){
		if(languageEdits.urlIsEnglish){
			languageEdits.someElement.innerHTML = 'My English is bad'; // The new English text
		}
		if(languageEdits.urlIsRussian){
			languageEdits.someElement.innerHTML = 'Я плохо говорю по-русски'; // The new Russian text
		}
	},
	
	urlIsEnglish: function(){
		if(window.location.href.toLowerCase().indexOf('yourEnglishURL.com')>-1) { return true; } // Change yourEnglishURL.com to your English URL in all lowercase
	},
	
	urlIsRussian: function(){
		if(window.location.href.toLowerCase().indexOf('yourRussianURL.com')>-1) { return true; } // Change yourRussianURL.com to your Russian URL in all lowercase
	}

};

languageEdits.makeChanges();