Rich-text Reply

Redirect running on original - Classic

ds 02-20-17

Redirect running on original - Classic

So I am having an issue setting up a redirect.  So ideally, variation 1 would go from *url*.com/new.*.-v1 (which is the original) to *url*.com/new.*.-v2. Have this set as a regular expression in the URL Targeting.


Under Variation 1 > Redirect to a New Page... - I have this in the URL: http://custom_asdf

 

Here is what I have in the Experimental JavaScript section.

 

/* _optimizely_redirect=http:// */

/* _optimizely_redirect=http://custom_asdf*/

var url = window.location;

var pathOfUrl = url.pathname;

if (pathOfUrl.indexOf("-v2") <= 0){

  var replacedPath = pathOfUrl.replace("-v1", "-v2");

  $("head").append("<style>body{display:none !important;}</style>");

  var redirect_url = 'http://' + url.hostname + replacedPath + url.search;

  window.location.replace(redirect_url);

}

 

I have 100% of the allocation going to Original, so it shouldn't redirect.

Any insight as to why it is going to http://custom_asdf every time?

 

ds
Level 1

RyanC 02-21-17
 

Re: Redirect running on original - Classic

Once a user has been bucketed into a variation, they will stay on that variation even though you re-allocate the traffic. You must duplicate the experiment if you want re-allocate the traffic percentage.
Ryan
------------------------------------------------
The best solution is the simplest.
Level 10
ds 02-21-17
 

Re: Redirect running on original - Classic

Even on new devices, it still forwards. I duplicated the experiment kept the allocation at 100/0.
ds
Level 1
RyanC 02-21-17
 

Re: Redirect running on original - Classic

Type in the following javascript api in your browser console and lookout for anything useful that might help you debug what is happening: optimizely.push(“log”)
Ryan
------------------------------------------------
The best solution is the simplest.
Level 10