hummy Posted February 25, 2011 Share Posted February 25, 2011 Hi All, I'm doing some testing using Google Website Optimiser and i have a problem which i wonder if you might be able to help me with. Basically with website optimiser you need a common conversion page that all variations land at to track conversions. My problem is this that the pages i want to test are all very different in design and have different conversion (thankyou) pages based on teh site design. So i'm wondering if i can put some sort of bridge page that all conversion come through to before being redirected to the thank you page. so for example index1.html goes to conversion.php page which then redirects to thanks1.html index2.html goes to conversion.php page then redirecting to thanks2.html this would get over the issue of having one common conversion page. I know to redirect a page i can use the following code: <?php header( 'Location: http://www.yoursite.com/new_page.html' ) ; ?> But i need to add this to redirect specific incoming pages to different thank you pages. Any ideas? Thanks Link to comment https://forums.phpfreaks.com/topic/228814-php-redirection-page/ Share on other sites More sharing options...
n00bl3z Posted February 25, 2011 Share Posted February 25, 2011 Is this what you're looking for? if not sorry, just an idea. in the URL You could try http://domain.com/page.php?thankyou=payment <?php $thankyou = $_GET['thankyou']; switch($thankyou) { case payment: header( 'Location: http://www.yoursite.com/thankyouPayment.html' ) ; break; case donation: header('Location: http://www.yoursite.com/thankyouDonation.html'); break; case else: header('Location http://www.yoursite.com/'); break; } Link to comment https://forums.phpfreaks.com/topic/228814-php-redirection-page/#findComment-1179647 Share on other sites More sharing options...
hummy Posted February 25, 2011 Author Share Posted February 25, 2011 Thanks. So let me just make sure i understand. I create one php page with the code you have specified above. And i put in the urls to both thank you pages with the relvant conditions. In you example ytou have the conditions being payment & donation. Then on the landing pages i put the url redirect path to be http://domain.com/page.php?thankyou=payment on one page and http://domain.com/page.php?thankyou=donation on the other page. Is that right? That sounds like it could work. Sorry i'm not a PHP developer but just trying to learn this stuff myself. Within this php code am i able to put the google conversion code as well? Is that within the php tags...or do i need to create new tags for that. Link to comment https://forums.phpfreaks.com/topic/228814-php-redirection-page/#findComment-1179679 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.