Rich-text Reply

Same experiment across different languages

jbuehl 12-23-14
Accepted Solution

Same experiment across different languages

Hi Forum


I just ran into a conceptual problem that someone might already have experienced (and hopefully solved Smiley Wink).


So, if you want to change e.g. a specific CTA across multiple languages, has anyone found a good solution how to set this up? The way I guess this needs to be set up, are in different experiments, thus:

  • -> change English CTA in experiment 1
  • -> change French CTA in experiment 2

The problem I encounter with this setup is the following: Assume is the default language and landing page before selecting a different language and the CTA is already visible on that page, separate experiments might lead to inconsistencies after selecting e.g. the French version. Thus, it might occur that user 1 sees the original CTA on the English pages but after switching to French, he sees the variation of the CTA in French.


The optimal solution from my perspective would be, if you could link the experiments and define dependencies (same variation for all linked experiments). However, I don't think that Optimizely has such a feature, right? Does anyone have a smart idea how to get around that?


Thanks a lot!


Level 1

JDahlinANF 12-23-14

Re: Same experiment across different languages

[ Edited ]

Your editor may be limited to only one specific page (language), but your code runs on all pages that match your URL targeting.  So set your URL targeting to represent the page on each site that you want to update.


Regular Expression example:




In the "edit code" window, uses window.location.pathname to make language-specific changes to each specific language:

if (window.location.pathname.indexOf('/en') == 0) {
  // code here to update the English page

if (window.location.pathname.indexOf('/fr') == 0) {
  // code here to update the French page


jbuehl 12-29-14

Re: Same experiment across different languages

Hi Napoleon

Thanks a lot for your input! Looks like a good solution to the problem.

Best regards,
Level 1
ben 12-30-14

Re: Same experiment across different languages

Hi Joel,
I use a method that is almost the same as Napoleon suggested. Another thing I do for multi language tests is I also target my tests with two audiences. One for FR and one for EN. That helps me segment my results quickly.
Ben Cole
Optimization Co-ordinator at Widerfunnel

Level 2