James Bachini

Stupidly Simple AB or Multivariate Testing

Here’s a simple way you can setup a simple multivariate or A/B split test without any software just using the subid variables provided by an affiliate network and some really basic php.

<?php
$out = 'http://www.myaffiliatelink.com/page1.php?affid=123&subid1=';

if (rand(0,1) == 0) { $out.=’g1′; $girlimg = ‘1.png’;
} else {
$out.=’g2′; $girlimg = ‘2.png’; } // this randomly chooses an image and adds either g1 or g2 to the outlink.

if (rand(0,1) == 0) { $out.=’h1′; $himg = ‘warning.gif’;
} else {
$out.=’h2′; $himg = ‘warning2.gif’; }

echo ‘<html><img src=”‘.$girlimg.’” /><a href=”‘.$out.’”><img src=”‘.$himg.’” /></a>
?>

So this will split test each combination of the images and then when you check stats you can download your converted subids and count g1 and g2 and see which you have more off. It’s quick simple and so easy to setup you can do it even if you are just testing an offer or fiddling with something trying to get it to work.

You are only limited by the number of chars allowed in the subid so you could in theory test hundreds of thousands of possibilities with this method. Really it is more suited to quick, rough tests and changes where you just want to get an idea of how a particular idea will work.

There really is no excuse not to be split testing your campaigns whether it be with an advanced mutlivariate testing programme or just simple php and subid tracking like the above. Testing different concepts and ideas maximises your ROI and most importantly you learn from your own tests and develop your own knowledge of what does and does not convert.


Get The Blockchain Sector Newsletter, binge the YouTube channel and connect with me on Twitter

The Blockchain Sector newsletter goes out a few times a month when there is breaking news or interesting developments to discuss. All the content I produce is free, if you’d like to help please share this content on social media.

Thank you.

James Bachini

Disclaimer: Not a financial advisor, not financial advice. The content I create is to document my journey and for educational and entertainment purposes only. It is not under any circumstances investment advice. I am not an investment or trading professional and am learning myself while still making plenty of mistakes along the way. Any code published is experimental and not production ready to be used for financial transactions. Do your own research and do not play with funds you do not want to lose.