by hummy
5 replies
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
#page #php #redirection
  • Profile picture of the author Jahnold
    You could use a session variable. In index1.php you'd have:

    Code:
    session_start();
    $_SESSION['redirect'] = "thanks1.php";
    then in conversion.php you'd have:

    Code:
    header( 'Location: http://www.yoursite.com/'.$_SESSION['redirect'] ) ;
    Matt
    {{ DiscussionBoard.errors[3430860].message }}
  • Profile picture of the author hummy
    Hi Matt,

    I'm not sure i quite understand you. Sorry i'm not a coder just trying to do a quick fix really.
    My main landing pages are HTML based. I'm not sure i quite understand how to implement what you are saying and how the redirect works.
    {{ DiscussionBoard.errors[3431501].message }}
  • Profile picture of the author dudeontheweb
    You can pass a variable though the url.

    Like conversion.php?page=1

    So on index1.html you would link conversion.php?page=1

    Then your php script would redirect to the appropriate thank you page.

    A simple if() statement would be all that it takes.
    Signature

    Need a QR Code? Check out my QR Code Generator. It's FREE!

    {{ DiscussionBoard.errors[3432956].message }}
    • Profile picture of the author TwilioExperts
      Banned
      [DELETED]
      {{ DiscussionBoard.errors[3444707].message }}
      • Profile picture of the author stianris
        This is an example if the visitor is coming from Facebook.com or Twitter.com. Just change those values to whatever you want to track.

        <?php
        $ref_url = $_SERVER['HTTP_REFERER'];

        if( (preg_match("/facebook.com/", $ref_url, $matches) == 1) ) {

        // You need to add your full URL in here, I am just not allowed to post links yet hehe.
        $link = 'domain.com/?ref=FB';

        }
        else if( (preg_match("/twitter.com/", $ref_url, $matches) == 1) ) {

        $link = 'domain.com/?ref=Twitter';

        }

        header('Location: $link');
        ?>

        Does this help?

        Regards,

        Stian
        Signature

        Need help with the technical aspects of your Affiliate Marketing?
        Check out our Free Prosper202 and Site Setup Videos at Affiliate Tech Support!

        {{ DiscussionBoard.errors[3469498].message }}
  • Profile picture of the author llumina
    For the redirection of pages in PHP you can use header() function.

    header('location': page url);
    {{ DiscussionBoard.errors[3475158].message }}

Trending Topics