Home > Paid Traffic Sources > POP / PPV / Redirect

How Do I pass keywords along when using a php split test script (6)


06-24-2011 07:56 PM #1 jamesruhles (Member)
How Do I pass keywords along when using a php split test script

so i want to split test 2 landing pages for my PPV campaign... I have been previously using this script to split test with non-ppv campaigns cause I can just manually put in the keywords like so:

[PHP]<?php
if(rand(0,1) == 0) {
header("Location: http://www.YourURL.com/t202id=keyword1");
} else {
header("Location: http://www.YourURL.com//t202id=keyword2");
}
?>[/PHP]

but with ppv i am not sure if the keyword will pass through... is there any way to make it pass through the split test redirect?

I am using leadimpact btw


06-24-2011 08:02 PM #2 index (Member)

Yea, you just have to add 1 line that grabs and stores the variable...then pass it into your redirect

[PHP]<?php
$keyword = $_GET['keyword']
if(rand(0,1) == 0) {
header("Location: http://www.YourURL.com/t202id=keyword1-$keyword");
} else {
header("Location: http://www.YourURL.com//t202id=keyword2-$keyword");
}
?>[/PHP]

$keyword = $_GET['keyword'] <----this line grabs the domain out of the URL (ex: hxxp://domain123.com?keyword=abcd.com )


06-24-2011 08:16 PM #3 heavyt (Senior Member)

or
[PHP]<?php
$lp1 = "http://www.YourURL.com/t202id=" . $_GET['t202id'];
$lp2 = "http://www.YourURL.com/t202id=" . $_GET['t202id'];

if(rand(0,1) == 0) {
header("Location: $lp1");
} else {
header("Location: $lp2");
}

[/php]


06-24-2011 08:27 PM #4 jamesruhles (Member)

ok so just to make sure I got this right... my link that I submit to leadimpact would be like:

http://mydomain.com?keyword=

and by adding that line of code to the redirect script it would change $keyword to whatever my keyword is that triggered the pop-up. so my redirect code should look like this:

[PHP]<?php
$keyword = $_GET['keyword']
if(rand(0,1) == 0) {
header("Location: http://www.YourURL.com/t202id=$keyword");
} else {
header("Location: http://www.YourURL.com//t202id=$keyword");
}
?>[/PHP]

thanks for both of those scripts!


06-24-2011 09:24 PM #5 vidivo (Member)

Get cpv lab... its better and easier to manage


06-24-2011 09:43 PM #6 jamesruhles (Member)

Quote Originally Posted by vidivo View Post
Get cpv lab... its better and easier to manage
planning on it once I get the extra funds, got an excessive amount of bills to pay this month :


Home > Paid Traffic Sources > POP / PPV / Redirect