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.
Solved! Go to Solution.
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.
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...
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.
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
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!
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
Views
Replies
Total Likes
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:
Thanks,
Tom
Views
Replies
Total Likes
Views
Like
Replies