Split testing offers on you're landing pages? Here's a quick tip.

sumohax0r

what that be like?
Nov 1, 2009
740
41
0
127.0.0.1
When your LP(s) has 15+ links to the offer, going through and changing all of them can be a unnecessary pain.

Here is a trick I use to speed up the process.

Place this snippet anywhere above the first offer link.
(it really can go anywhere above the first link, so for easiest use I even put it above the <html> tag so its the first thing you see)

Code:
<?php

$offer_one_name = 'OFFER ONE NAME';
$offer_one_link = 'offer1.php';

$offer_two_name = 'OFFER TWO NAME';
$offer_two_link = 'offer2.php';

?>

Then replace all the links on you're LP with the following snippets

Code:
// Example link for Offer One

<a href="<?php echo $offer_one_link ?>" target="_blank"><?php echo $offer_one_name ?></a>

// Example link for Offer Two

<a href="<?php echo $offer_two_link ?>" target="_blank"><?php echo $offer_two_name ?></a>

Obviously you can apply this to images, redirects, popups etc.

But when it comes to changing offers, it makes things much simpler! just edit the top snippet and all the links on your LP update.



More complex option:

If you're split testing multiple LP's you can also create a new file (e.g offers.php) that includes the first offer data snippit and just tell every LP to include that file with the following code:

Code:
<?php include 'offers.php' ?>

Then you only have to update one file to update the links on all your LP's that you're split testing.
 


fucking-variables-how-do-they-work.jpg
 
This is a good candidate for the "<?=$variable?>" syntax.

You don't have to use echo and it's easier to read.

Code:
<a href="<?=$offer_link?>" ><?=$offer_title?></a>

But yeah a bit too basic actually.
 
<?=$offer_link?>

Short tags, as they're known, IIRC are actually deprecated. Not that I give a shit, IMO they are much cleaner, and are worth using anyway.

Also, find&replace.
 
I do similar for split-testing AdSense on a WordPress-driven site. I added a couple of files (ie: adsense1.php and adsense2.php) and then threw in some code where I wanted the adds to appear to randomly include one of the two files like this:

Code:
<div style="float: left; margin: 10px 10px 10px 10px;">
<?php if (rand(1,2) == 1) include (TEMPLATEPATH . '/adsense_1.php');
else include (TEMPLATEPATH . '/adsense_2.php'); ?>
</div>
 
Thanks, does anyone know how to capture Keyword information coming from Ad network and auto insert into the affililiate Link inside a php file?

Like Ad network-click-myLP.html-insert dynamic keyword into the affiliate link PHP file on the LP?
 
Thanks, does anyone know how to capture Keyword information coming from Ad network and auto insert into the affililiate Link inside a php file?

Like Ad network-click-myLP.html-insert dynamic keyword into the affiliate link PHP file on the LP?

yea, you grab the ?keyword= out of the URL

Code:
http://yourdomain.com/landingpage.php?keyword=xxxx

Inside your template, on your call to action link, you can code it like this.

PHP:
<a href="out.php?keyword=<?php echo $_GET['keyword']; ?>">Click Here</a>

then out.php

Code:
<?php
$kw = $_GET['keyword'];
header("Location: http://afflink.com/?subid=$kw");

watch this vid: http://blog.themeforest.net/screencasts/diving-into-php-day-3/
 
Last edited:
...and if you want to split test offers, you can do this in out.php

PHP:
<?php
     $kw = $_GET['keyword']
     $offer = rand(0,1);
if($offer == 0){
     header("Location: http://afflink1.com/?subid=$kw");
     }
else{
     header("Location: http://afflink2.com/?subid=$kw");
     }
?>
 
I do similar for split-testing AdSense on a WordPress-driven site. I added a couple of files (ie: adsense1.php and adsense2.php) and then threw in some code where I wanted the adds to appear to randomly include one of the two files like this:

Code:
<div style="float: left; margin: 10px 10px 10px 10px;">
<?php if (rand(1,2) == 1) include (TEMPLATEPATH . '/adsense_1.php');
else include (TEMPLATEPATH . '/adsense_2.php'); ?>
</div>

You'd be surprised at how bad rand() actually is at being random. You're better off doing something that writes to a database/file that indicates which landing page showed up last, and showing the next one based off that, or you'll never get an even distribution. Run rand() then look at the amount of people that got to page 1 vs. page 2.
 
You'd be surprised at how bad rand() actually is at being random. You're better off doing something that writes to a database/file that indicates which landing page showed up last, and showing the next one based off that, or you'll never get an even distribution. Run rand() then look at the amount of people that got to page 1 vs. page 2.
I've noticed this as well. It's amazing how bad random is at being random, you'd think it would be pretty easy to do in the first place