A/B test - Redirect to URL showing landing page first and then redirect to actual page using FEC

Avatar

Avatar

gokula

Avatar

gokula

gokula

10-08-2020

Hello Team, 

Recently I have tried to do the A/B testing using FEC -  If user load a particular page then he/she needs to be redirected to new page preserving the query string parameter. It's working correctly but it's showing the landing page for few seconds which I don't need it. 

 

For ex: 

If user hits the page  www.example.com/?abc=123 then immediately needs to be redirect on www.exampletarget.com/?abc=123 

but here in my solution its showing the www.example.com/?abc=123 for few seconds in browser which is noticeable and then redirection happens. This is not a good user experience and I don't want to show that to user.

 

In terms of setup - I'm using the latest at.js version in the form of Target extension in Adobe launch and in FEC have below script for redirection and preserving the Query string param 

 

<script>
var positionQueryString=window.location.href.indexOf("?");
var newURL="";
var querystringvalue="";
if(positionQueryString >= 0)
{
querystringvalue=window.location.href.substring(positionQueryString+1);
newURL="https://www.example.com/?"+querystringvalue;
}
else
{
newURL="https://www.example.com/";
}
window.location.replace(newURL);
</script>

 

 

Any idea or solution?  Thank you in advance. 

 

@surebee @mikewebguy Any thoughts ? Thank you 

View Entire Topic

Avatar

Avatar

karandhawan

Avatar

karandhawan

karandhawan

26-08-2020

@gokula We suggest you use the inbuilt redirect functionality within Target instead of a custom redirect script.

Let us know if this helps.

 

 

Regards,

Karan Dhawan