Rich-text Reply

No relevant optimizely-data in redirect experiments

SerjoPepper 11-18-14

No relevant optimizely-data in redirect experiments

I have a redirect-experiment with url targeting, which exclude redirect page. Also I tune events for redirect page (i read this guide https://help.optimizely.com/hc/en-us/articles/200040675-Redirect-experiments-Test-separate-URLs-). Therefore an experiment works fine.

But when I appear on a target redirect page, I see that JS variable "optimizely.data.state.activeExperiments" doesn't not contain my current redirect-experiment, so i can't send the experiment data of current visitor to the server. How can I solve this?

JDahlinANF 11-18-14
 

Re: No relevant optimizely-data in redirect experiments

1- include the redirected-to URL in your URL targeting
2- "edit code" for your variation that performs the redirect and place that code inside an "if-then" so that it does not run if the current URL is the page that you are trying to redirect to.

e.g.,

if (window.location.pathname == '/path/to/redirectedpage/goesHere'){
  //do nothing, I am on the new page already
} else {
  //place code that does the redirect here 
}