Author: James

0

A simple iOS / Android traffic splitter in PHP

The following basic PHP code will split traffic by device with iOS traffic going to the first out link, Android to the second and leftovers to the third. <?php     $ua = strtolower($_SERVER[‘HTTP_USER_AGENT’]);     if (strpos($ua,’iphone’) !== false || strpos($ua,’ipod’) !== false || strpos($ua,’ipad’) !== false) {         $out = ‘https://iosoutlink.com/’;     } elseif (strpos($ua,’android’) !== false) {         $out = ‘https://androidoutlink.com’;     } else {       ...

0

No More Forced Tablet Traffic On Adwords

At last Google has put an end to the way it was allowing bid adjustments for mobile and desktop but not tablets. For years this has meant that Adwords advertisers were forced into getting unwanted tablet traffic and paying the same rate for it as desktop. Here is the blog announcement from Google: http://adwords.blogspot.co.uk/2016/05/ads-and-analytics-innovations-for-a-mobile-first-world.html If you are running Adwords campaigns get in there quick and set the tablet bid adjustment...

0

Splitting traffic to different offers on mobile

If you are buying bulk traffic to a mobile offer the chances are that you can split some of your traffic off to different offers. For example if  you have a pin submit that only accepts android but has a much higher payout then you can separate your android traffic and increase your bottom line. There are a few ways to do this using popular tracking software but I prefer...

0

RAM & CPU usage PHP script

I needed a script to do a basic server health check and built the following which can be viewed here: http://jamesbachini.com/misc/ram.php and downloaded here: http://jamesbachini.com/misc/ram.zip It measures RAM, CPU, Hard disk usage, Established and total connections, a few other bits and pieces. It has a traffic light system which is setup for my needs but you can fiddle with as necessary if you want to change the parameters. Here’s a...

0

Basic exit intent pop up script

The following script will launch a pop up and redirect if the user moves the mouse off the page. You can add this to your landing page targeted at desktop users, on mobile it wont work obviously. This is just a basic version but you can change the popUp() function to load an email capture box, redirect to the offer page, load a different lander/angle, play a sound or video,...

0

Resize youtube/vimeo iframe to maximum available height and width

Here is the code to make a flexible youtube.com or vimeo.com video fit both the height and width of the containing div. Like a flexible adsense unit it will take up the maximum available space on the page or be constrained within a containing object such as a div. CSS: .vcontainer { position:relative; padding-bottom:56.25%; padding-top:30px; height:0; overflow:hidden; } .vcontainer iframe, .vcontainer object, .vcontainer embed { position:absolute; top:0; left:0; width:100%; height:100%;...

0

Book Review Finch Premium Posts 2016

It’s really hard to find any kind of information from experienced performance marketers. You generally have to wade through all the gurus who have no real idea or sign up to a paid forum full of newbies. Finch is an English guy I believe who now lives in Thailand, has been doing affiliate marketing for ever and now runs a smallish team. The guy obviously knows his stuff and there...

0

Calculate distance between two geocooridnates

Here is a javascript function to calculate the distance between two latitude and longitude coordinates. function deg2rad(deg) { return deg * (Math.PI/180) } function calcDistance(lat1,lon1,lat2,lon2) {   var R = 6371; // Radius of the earth in km   var dLat = deg2rad(lat2-lat1);   var dLon = deg2rad(lon2-lon1);   var a =     Math.sin(dLat/2) * Math.sin(dLat/2) +     Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) *     Math.sin(dLon/2) * Math.sin(dLon/2)     ;   var...

2

Building Basic Websites

Every now and again you just need a basic site setup to have an internet presence. Normally this occurs for me when a friend or family member tells people I “do websites” and I get roped in to helping them out. So what options are there for a basic, modern website template. The obvious answer is WordPress. It’s a great content management system which anyone can use. Once it’s setup...

0

Option to Disable Adsense Ads

In some cases it is beneficial to provide a link or option for visitors to a site not to see the adsense ads the first time they visit a page. Ads can sometimes be viewed negatively and for the first visit or under certain circumstances it is best to temporarily disable them. Here is the code so that you can just add ?noads=1 to the end of your url and...