Category: Code

Direct Linking and Retargeting

Direct Linking and Retargeting

Here is how to do it, you’ll still need a server and a domain. Point all your traffic towards a php file i.e. http://www.mydomain.com/trackandforward.php Then place all your retargeting pixels in to the trackandforward.php file and put a meta refresh at the the end. The page will load the retargeting cookies will be placed and then the user will be sent on his way to the affiliate offer without even...

Automatic backup of MySQL database

Automatic backup of MySQL database

Would you like to have a backup of your critical MySQL database emailed to you automatically? The following script was moified from backup2mail and needs setting up as a cron job, instructions are in the code. Download it for free here This is what the code looks like: <?php /// Setup /// // Test it in a browser first and make sure it works. // To set it to run...

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)...

Redirection Methods and Referer Passing

Redirection Methods and Referer Passing

The following are some methods you can use to redirect users from one place to another. I generally use 301 redirects for anything where I want the referer passed through because this is the fastest. Double meta refresh for anything where blank referer is important and a custom script which incorporates the form submit redirect to fake the referer where this is necessary. Getting the right redirect is important to...

Combining Maxmind GeoIP with Google Maps iFrame

Combining Maxmind GeoIP with Google Maps iFrame

This is a quick script which uses Maxminds geoip location db downloadable for free from here with Google Maps iFrame. I haven’t tested this enough to find out if Google restrict the number of requests by referrer but you could always put a meta refresh page in the iframe to blank the referrer if thats a problem. <?php // you might have to change the first three lines $gpath =...

Loading a conversion pixel on click through

Loading a conversion pixel on click through

Mobile campaign optimisation throws up a number of issues in regard to tracking. One thing I’ve found really useful is to load a conversion pixel on click through from the landing page to the offer page. This can be a traffic source pixel which can then be used to give some indication of site/device/carrier quality etc. It’ll be tracking click throughs rather than conversions so it’s not perfect but it...

iframe to a specific div id on a landing page

iframe to a specific div id on a landing page

Below is the code to iframe an offer page but cut out all the stuff you don’t need. This is useful if you just want to iframe the form while using your own images etc. This is setup so you just enter the url and div id you want to jump to at the top of the php page. The height and width of the iframe can be adjusted further...

Mobile Multivariate Testing with SubID’s

Mobile Multivariate Testing with SubID’s

Due to slow page load speeds it is advised to keep tracking software to minimum when running mobile campaigns. This caused me a problem when trying to develop and optimise a mobile landing page. Because I wasn’t using prosper or any other tracking software I couldn’t plug in my custom multivariate testing scripts. I was direct linking straight to Neverblue’s platform which has multiple subid’s. I decided the best way...

Prosper202 Mod – Set preferences before crashing server

Prosper202 Mod – Set preferences before crashing server

Had a bit of an issue with Prosper crashing once the database got too big. I would log out and leave the analysis preferences set to my biggest traffic source and when I logged back in the server would crash as it tries to pull a report before you can modify the search critieria. I knocked up a quick mod so you can set preferences before attempting to run a...

What was that Country Code?

What was that Country Code?

Have problems remembering all the different country codes for geolocation scripts etc? Switzerland gets me everytime! Here’s a handy list you can use to check before you code. I use Maxmind but this will be accurate for any software that uses the ISO 3166 standard. AD = Andorra AE = United Arab Emirates AF = Afghanistan AG = Antigua and Barbuda AI = Anguilla AL = Albania AM = Armenia...