Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Redirect a Landing Page

patterhl
Level 1
Level 1

Hello -

We are trying to set up a test to redirect customers that land on a specific page to a new URL. We are concerned looping could occur. Essentially, the customer will continue to be redirected to the redirect page. Is there any way to limit the redirect only to occur 1 time (only on the first hit)?

Thank you in advance for your help.

1 Accepted Solution
Shruthi_N
Correct answer by
Employee
Employee

patterhl​ , If you are redirecting visitors landing on www.domain1.com to www.domain2.com, and activity location is www.domain1.com, then there shouldn't be any infinite redirect loop. If you setup an XT activity and use  use a custom profile script to capture that the hit no, then you could restrict the visitors to get redirected only once as on second visit they would be re-evaluated and no longer match the criteria.

Ref: Switching Experiences in Experience Targeting

View solution in original post

0 Replies
Andrey_Osadchuk
Community Advisor
Community Advisor

Patterhl,

Could you elaborate more on why you think the "looping could occur"?

What is the scenario that you want to set up only a single time redirect for? — it does not look to be an experience targeting or a/b test...

Shruthi_N
Correct answer by
Employee
Employee

patterhl​ , If you are redirecting visitors landing on www.domain1.com to www.domain2.com, and activity location is www.domain1.com, then there shouldn't be any infinite redirect loop. If you setup an XT activity and use  use a custom profile script to capture that the hit no, then you could restrict the visitors to get redirected only once as on second visit they would be re-evaluated and no longer match the criteria.

Ref: Switching Experiences in Experience Targeting

View solution in original post

mikewebguy
Employee
Employee

patterhl​,

I've seen this before it usually happens when the URL you are redirecting to matches one of the rules for activity entry URL condition. Please investigate the Activity Entry URL and any additional URLs to see if they match the redirect to URL and let me know if that was the case here.

Mihnea Docea | Technical Support Consultant | Customer Experience | Adobe | (:: 1 (800) 497-0335

patterhl
Level 1
Level 1

This is an example of the issue we are having.

Let's say we have an affiliate link that lands on the homepage of a website. We want to redirect this affiliate link to a different page that is. Now if the customer clicks on the homepage, they will then get redirected to the new page. So, my question is how do we limit this to occur only on the first hit to the site, so the customer does not get stuck in a constant loop.

Thanks!

mikewebguy
Employee
Employee

patterhl​,

Here are some steps to follow:

1. Customize the affiliate link landing page so that it is unique and different from the homepage URL something like URL1: "http://www.homepage.com/affiliate"

2. Set up the activity with entry url of: "http://www.homepage.com/affiliate" not: "http://www.homepage.com""

3. Set up the redirect form URL1: "http://www.homepage.com/affiliate" to "http://www.homepage.com/page2"

4. If the customers go back to the homepage: "http://www.homepage.com/" redirect will not happen becuase you gave the affiliate link a custom URL and set up the activity entry to that custom URL only.

If this satisfies your query please like, mark as helpful and mark as answer. Otherwise lets keep the conversation going. Hope you have a wonderful day.

Mihnea Docea | Technical Support Consultant | Customer Experience | Adobe | (:: 1 (800) 497-0335

Tom_Pope
Level 1
Level 1

Hey,

 

Using a profile script you can create a variable to store whether that user has seen the page. For this you can use a page count logic (as in my experience the profile script ran before the test so a boolean "did the user see the page true/false" always resolved to true and therefore didn't work):

 

Profile script named "PageCount"

 

var UserPageCount = user.get("PageCount") || 0; // initialises at 0 if not currently attached to the user

if (
  /* your redirect logic i.e. mbox.param('pageName') === 'the redirected from page' */ &&
  UserPageCount <= 1 // using 1 instead of 0 because script runs before test (so basically starts at 1 despite the variable being initialised at 0
) {
  return UserPageCount + 1;
}

 

 

Then in your test you can handle the redirect using custom code as follows: 

 

<script>
if (${user.PageCount} <= 1){
  	window.location.replace("the URL you're redirecting to");
}
</script>

 

 

window.location.replace is redirect method according to documentation here:

https://docs.adobe.com/content/help/en/target/using/experiences/vec/redirect-offer.html 

 

${} syntax is how you can link to dynamic profile information in your tests according to documentation here:

https://docs.adobe.com/content/help/en/target/using/experiences/offers/passing-profile-attributes-to... 

 

Thanks,

Tom