Development
-
Deno JS | Deno vs Node.JS
Deno is a Javascript and Typescript runtime from the creator of Node.js For anyone that doesn’t know Node.js is a server-side Javascript runtime. It’s used by millions of projects across the globe and powers the backends and API’s of many of the world’s leading websites. Then came Deno (aka Deno.js or Deno JS), an improved…
-
Lead Magnets, Autoresponders & Tripwires | The Modern Sales Funnel
This article is part of a free online course where you can learn digital marketing. Lead magnets, autoresponders and tripwires form key components of a very popular sales funnel. Traffic is pushed into the funnel from traffic sources such as paid ads, content marketing and social media outreach. The visitor is directed to a landing…
-
What is Online Marketing? | A Definitive Guide
This article is part of a free online course where you can learn digital marketing. Introduction In this document I explain how online marketing works, provide online marketing tips and show how online marketers make money. There is a deep dive into building web properties, which traffic sources are being used and how to scale…
-
ReasonLIGO | Building Smart Contracts & Dapps On Tezos
Tezos smart contracts are compiled from a custom low level language called Michelson. For web developers however learning a new low level programming language is a barrier to entry… Enter LIGO and specifically ReasonLigo. ReasonLIGO is the most accessible way to develop smart contracts for web developers. ReasonLIGO is based on ReasonML which is based…
-
How do you turn a website into an app in 7 steps
This is a step by step guide to using a open-source package called Cordova to turn a website into mobile app on Android and iOS. I’ll be using a windows device for this but all the packages are also available for a Mac. To publish an app to the iOS app store you need to…
-
8 Tips For The Perfect Blog Post
This is the revised 2020 complete guide to the best practices when creating content for your blog. You can use this framework to create a “perfect blog post” and move your site up the search engine rankings. James On YouTube The Title The title or headline of a blog post should be a close match…
-
How to encrypt text file in Visual Studio Code (VSCode)
I wanted a way to quickly encrypt and decrypt text files in VSCode using a memorised pass phrase so I created an easy to use plugin to encrypt text in Visual Studio Code. VSC has become the text editor of choice for most developers and it is relatively simple to create and publish a plugin…
-
Prevent Mobile Browsers From Turning Off
The following code has been published to prevent mobile browsers from turning off and going into sleep mode. This was affecting setTimeout functions as the javascript code in the browser is effectively paused preventing the event loop from processing once sleep mode is activated. I originally looked at nosleep.js but ended up simplifying the code…
-
Search For Satoshi
In 2008 an anonymous user with the alias Satoshi Nakamoto posted the original Bitcoin whitepaper to the Cryptography mailing list. Satoshi mined a lot of the early Bitcoin blocks and the rewards that are held in bitcoin wallets associated are estimated to be around 1 million BTC or 10 Billion USD. If Bitcoin eventually reaches…
-
Setting up HTTPS (SSL) with Cloudflare and WordPress
If you are just running a wordpress blog or simple website you can setup Cloudflare to manage SSL for you. Cloudflare acts as a proxy between your website and the user. I recently setup Cloudflare which provides a SSL certificate with their free account plan. Step 1. Setup Cloudflare Register for an account. Then select…
-
Capitalisation of Links (www.MySite.com) CRO Test
I thought an interesting split test would be to test if text links on a landing page that are capitalised get more clicks than ones that don’t. For example: https://www.jamesbachini.com/ – standard (control) https://www.JamesBachini.com/ – Capitalised This was for a site that wasn’t a personal name and contained a full directory and page like http://www.MyGreatWebSite.com/example/page.htm…
-
PHP Redirect with Parameters | Passing GET variables in a Redirect
Update March 2023 To do a 301 PHP redirect with parameters to another page we can use the following code: The entire query parameter string is stored in the following variable. Everything after the question mark. So for the URL: server.com/index.php?test=123&hi=hellothe $_SERVER[‘QUERY_STRING’] will contain this string “test=123&hi=hello” We can then pass this out when redirecting…
-
Wasabi AB Testing Platform
Update July 2020 – Wasabi is no longer maintained or supported. Check this article for more information on conversion rate optimisation. Wasabi AB Testing Platform Intuit have opensourced a enterprise grade A/B testing platform called Wasabi. This runs as an API on a separate server from your site/landers. It isn’t the easiest thing to setup…
-
robots.txt Disallow All | Block Bots
In this article we are going to look at how to block bot traffic using the robots.txt disallow all feature, then some of the more advanced uses of the robots.txt file. How To Disallow All in robots.txt Custom robots.txt for Specific Bots and Directories Complete List of Bots – robots.txt How To Disallow All in…
-
Vibrate Phone with Javascript
The following javascript uses the Vibrate API to make a phone vibrate when a page is loaded. You can time it with setTimeouts or onclick/onscroll if required. There’s more information available at: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/vibrate This can be used to draw a users attention to the landing page or to create message effects etc.
-
Node.js client for Moz API (MozScape)
Update 2020: This is outdated now and not maintained. I’d recommend using one of these packages: https://www.npmjs.com/package/moz-api https://www.npmjs.com/package/moz-api-wrapper Original Post: I was doing some work with SEO domains and realised there wasn’t a node.js client for the MozScape API… so after Googling and not finding what I was looking for I built one. What this…
-
REGEX | A Complete Guide With Examples
Regexes are a powerful way to do search queries on a text string. They can be used to replace text, sanitize user inputs and much more. Contents Introduction to REGEX REGEX Cheatsheet REGEX Examples REGEX Javascript Code An Introduction to REGEX A REGEX or regular expression is used to match text strings in many programming…
-
New: Facebook interest targeting brainstorm tool
This is more for my use but others might find it helpful when trying to come up with targeting ideas for interests on Facebook Ads. Facebook Ads Targeting Tool
-
Alert box on click through to offer
The following example will allow you to create an alert box when the user clicks through from your landing page to the offer page. This can be useful to remind users of your offers value proposition, sign-up requirements (double-opt in?) or just to increase conversion rate on the offer end. A working demo is available…
-
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. TIP: This uses a 301 redirect however you can do any type of programmatic variation based on the user agent. You can copy and paste this into…
-
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.…
-
RAM & CPU Usage PHP Script | Server Health Check
This single file server health check script works on Windows, Linux and possibly others. It is written in PHP to show CPU usage, RAM usage, Incoming Connections and Hard disk usage. Update September 2020 Server Check PHP was getting a lot of downloads so I’ve updated the code and open sourced it on Github. If…
-
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…
-
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;…
-
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) *…
-
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…
-
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…
-
Automatic Redirect for Mobile Landing Page
Want a mobile lander with a 90%+ “CTR”? Simply add the following javasript: <script> function go() { location.href = ‘http://www.jamesbachini.com’; } function init() { setTimeout(function() { confirm(‘You have two friends who recommended this app’); },3000); setTimeout(function() { go(); },5000); } </script> Then run the init function on body load like so: <body onload=”init();”> This does…
-
Checking landing page load times
Landing page load times can make a big difference to the conversion rate of an affiliate campaign. Here’s a great free site for checking load times and getting suggestions on how to improve the page load speed. http://gtmetrix.com As you can see I could do with tweeking wordpress to display the images a bit better…
-
Setting up Maxmind GEOIP2 Legacy Database with PHP or Javascript
This is the php code I use to access geoip data from Maxmind’s geoip database: <?php $gpath = getcwd() . “/GeoIPCity.dat”; if (isset($_SERVER[‘HTTP_X_FORWARDED_FOR’])) { $myip = $_SERVER[‘HTTP_X_FORWARDED_FOR’]; } if (isset($_SERVER[‘REMOTE_ADDR’])) { $myip = $_SERVER[‘REMOTE_ADDR’]; } include(“./geoipcity.inc”); $gi = geoip_open($gpath,GEOIP_STANDARD); $record = geoip_record_by_addr($gi,$myip); $city = $record->city; $countrycode = $record->country_code; geoip_close($gi); echo ‘countrycode = “‘.$countrycode.’”; city =…
-
Tool to generate a guest blog post request
This tool can be used to generate a guest blog post request for SEO purposes. This is a great way to not only build SEO juice but it also gets your name out there and helps interact with the community surrounding your niche. http://www.jamesbachini.com/misc/guestpostrequest.php Simply enter your name,site,niche and theirs and it will generate a…
-
Google Friendly Mobile Pages Test
Google have provided a tool which checks to see if a site renders clearly in a mobile browser. The tool looks like it is setup at 320px and if your site works at this you’ll get a “mobile-friendly” tag in your organic search listings. Here’s the link to check your sites: https://www.google.com/webmasters/tools/mobile-friendly/ Some other good…
-
A Simple Mobile Landing Page Template
Here’s a quick design template which is very flexible for mobile app / pin submit type offers. You can view the page at: http://jamesbachini.com/misc/simplemobile.htm And download it from: http://jamesbachini.com/misc/simplemobile.zip Obviously be careful that your button is above the fold on old and new phones. Big image + long headers can push it below which wouldn’t…
-
Daily Calcs Profit And Loss Spreadsheet Download For Affiliate Marketers
Here is the spreadsheet I use to monitor my profit and loss accounts on a daily basis. It’s provided here as a downloadable spreadsheet but I would recommend setting it up how you want and then uploading to Google Docs so it can be worked on from anywhere by anyone. This document works by inputting…
-
How Groupon’s landing page has evolved in two years
In 2012 Groupon was at the cutting edge of performance marketing. They had big budgets and were doing big business with affiliates. I thought it would be interesting to analyse a landing page from back then and then one they use today. The lander actually reminds me a bit of some of the dating landing…
-
Mobile eCPM’s still not competing with desktop
Here’s some stats I ran off today from a Google Adsense account I have for some old seo based domains with various sites and “general” mainstream traffic. It’s interesting to see that the eCPM’s for desktop traffic are still way above that of high end mobile devices: Platform Page views Clicks Page CTR CPC Page…
-
Upgrading to WordPress 4.0 a breeze
I always get the fear when doing major upgrades on any platform. Something is bound to be non-compatible and get messed up. In this instance upgrading to WordPress 4.0 took about 5 minutes, didn’t mess up the themes and everything is still where it should be… right? WordPress is, in my opinion, the best platform…
-
Passing Through Landing Page Variables
This was inspired by another post which is well worth a read at: http://affplaybook.com/blog/affiliate-marketing/the-ultimate-guide-to-landing-page-tricks/ So many traffic sources provide you with tags such as {keyword} {countrycode} {device} etc. You can add these variables to your url so it would look something like: http://www.myserver.com/landingpage.htm?kw={keyword}&device={device} Then in the code to your landing page you can access these…
-
Refactoring for ROI in affiliate marketing
The importance of refactoring is well documented in the programming world. But I haven’t seen it mentioned in an affiliate marketing context. So what is refactoring? Basically starting again from scratch. So instead adding variations to your banners or landing pages, start again and use everything you’ve learned to produce a better campaign. If you…
-
Simple PPC List Builder
I used to use a programme called JAH Simple PPC to build out wordlists for pay per click campaigns. Basically it would combine different key word variations. I couldn’t find it anymore so decided to build my own and get a bit of practice with javascript. Hope this is useful to someone. http://www.jamesbachini.com/misc/ppc.htm http://www.jamesbachini.com/misc/ppc.htm The…
-
Ideas for improving landing pages
The following is a list of proven methods that can improve the ctr and cvr of a landing page. Big Bright Buttons – Have you split tested different buttons, button text etc? Copy and Text – Persuasive text is key and an art form in itself. Images – Every image on that landing page should…
-
Using Google Fonts on Landing Pages
This is how you can use Google web fonts on your landing pages, blog posts and web pages. The benefit of this is that the font is loaded from a remote server include on the Google APIs so it does not depend on the local storage of that font on the users computer. This makes…
-
Online Banner Design Tool
Need to design/modify banners but don’t have Photoshop installed? Try this online image editor: http://pixlr.com/editor/ A great little tool for the affiliate that only does image editing once in a blue moon, you lucky souls. Pixlr – The online alternative to photoshop
-
Coding PHP for Affiliates | A Getting Started Guide
Coding for me is one of the most important skills you can have as an affiliate marketer. I’ve met plenty of affiliates that are running huge volume, making millions and can’t write a single line of code. “I just outsource it all” but for me I couldn’t imagine coming up with a tweak to a…
-
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…
-
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…
-
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…
-
Resizing images and adjusting landing pages based on screen resolution
So many browsers so many different screen resolutions. Here’s a way to modify html code based on the screen resolution of the browser. In this example I have changed an image but there is no reason why you cant change text, font size or even use it to redirect users who have mobile sized screens.…
-
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…
-
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…
-
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…
-
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…
-
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 =…
-
Script.aculo.us – Interactive Landing Pages
Interaction is key in modern web design and one of the tools I’ve found to be very helpful in making a more interactive environment is script.aculo.us It is basically a javascript inlcude which can provide you with a whole load of effects and functions to use on your landing pages. Check out a simple example…
-
Direct Response Marketing Pushing CPC Prices Up – The Future for Google Adwords
I was asked to setup a little campaign for an offline electrical company on “The Google”. The business they operate in is electrical testing or PAT testing as it is known here in the UK. It’s the kind of industry where I wouldn’t expect to find much competition when it comes to online marketing. That…
-
Ruby & Selenium Script to Check Google SERP ranks
Haven’t used this in a while but it used to work really well untill google would throw a captcha at you after the first 5000 queries. Might be of use to someone. It’s designed for linux and you’ll need selenium up and running to work it. #!/usr/bin/env ruby require ‘rubygems’ gem ‘selenium-client’ require ‘selenium/client’ system(‘java…
-
Captcha Cracker For PHPBB written in Ruby
It’s been a while since I’ve done much in SEO so I am going to start publishing some of my old scripts. This is a captcha cracker which uses gocr and image magick to decipher phpbb captchas. It’s written in ruby and was designed as part of a backlink building module. You’ll need linux, gocr,…
-
Rotating Offer Pages and Landing Pages in Prosper202
It is really easy to setup rotation of urls in Prosper but if you actually want to track which url is doing better or you want to test different landing pages it can be a little more challenging. One way to do this is to set each url or landing page up separately and then…
-
Prosper 202 Mods 2012
Prosper202 mods 1) increase session life – stops it logging you out every five minutes when you are trying to work add the following line just before session_start(); in 202-config/connect.php ini_set(‘session.gc_maxlifetime’,99999); 2) bypass adverts on first page – bit naughty but I prefer to jump straight into the spy section to see whats been going…
-
Using Adsense Section Targeting
If you are getting lots of Groupon and Three ads on your adsense niche site the chances are it isn’t optimised correctly. By simply writing a short, keyword rich, snippet of what your site is about and surrounding it in the following tags you can manipulate which ads are shown. <!– google_ad_section_start –> Jet internet…
-
Custom WordPress 404 Page For SEO
I have recently been purchasing used domain names from Godaddy Auctions and Dropcatch. When I get the domains the first thing we do is look at what traffic they were pulling for what topics via google cached web search. If there is some good content on there and things we want to keep we will…
-
Setting up twitter feed to post to Twitter and Facebook accounts
If you don’t already have a facebook and twitter account for your company they are really easy to setup. On facebook remember to click the “Create a Page for a celebrity, band or business” link on the homepage. Once you have those accounts setup head over to twitterfeed.com and sign up for an account. Enter…
-
Mixing php with javascrip – Heredoc
My main issue with javascript is the fact it is full of ‘ and ” which can be a real pain when coding. I’ve started using a method called heredoc to set a start and end point, example below. // Heredoc string // $sstring = <<<TEST Hello World TEST; The word TEST could be anything…
-
Poor mans GeoIP – Quick and Easy Geolocation
//poor mans geoip $country=trim(file_get_contents(“http://api.hostip.info/country.php?ip=”.$_SERVER[‘REMOTE_ADDR’])); //You can then redirect customers to different offers depending on country. I wouldn’t recommend this for critical or high volume use. if ($country == ‘MyCountry’) { yadda yadda yadda; }
-
Two php functions for scraping content and extracting links
////// Grab webpage ////// function webFetcher($url) { $crawl = curl_init(); curl_setopt ($crawl, CURLOPT_URL, $url); curl_setopt($crawl, CURLOPT_RETURNTRANSFER, 1); $resulting = $resulting.curl_exec($crawl); curl_close($crawl); return $result = $resulting; } //////////////////////////////// //// extract links //// function extract_links($text) { preg_match_all(‘/<\s*a[^<>]*?href=[\’”]?([^\s<>\’”]*)[\’”]?[^<>]*>(.*?)<\/a>/si’, $text, $match_array, PREG_SET_ORDER); $return = array() ; foreach ($match_array as $serp) { $full_anchor = $serp[0]; $href = $serp[1]; $anchortext =…
-
Three ways to debug php
Method 1 – error.log For this to work you need to be coding in a linux environment with php, apache etc setup. This is the best way I have found and what I currently use to debug my applications/web pages. open up a new terminal and type: tail -f /var/log/apache2/error.log This will give you a…
-
list to php array list2phparray
Code below for a script to take a list and turn it into an array. Comes in pretty useful. <?php if ($_POST[‘list’]) { $splist = explode(“\n”, $_POST[‘list’]); $out = ‘$x = array(‘; foreach ($splist as $line) { $out = $out.”‘$line’, “; } $out = substr($out,0,-1); $out = substr($out,0,-1); $out = $out.’);’; echo $out; } else…
-
Prosper202 Hacks and Modifications
JiM’s Prosper202 mods 1) increase session life (stops it locking you out every few minutes) add the following line just before session_start(); in 202-config/connect.php ini_set(‘session.gc_maxlifetime’,99999); 2) Cchange the first page you see. edit 202-login.php line 80: header(‘location: /202-account’); to header(‘location: /tracking202’); or /tracking202/spy/ If you are doing email submits or any volume loging into spy…
-
Dynamically modifying the landing page with TrafficVance using php
I ran into a silly issue today when dynamically modifying a landing page using TrafficVance. The script I was using was a pretty straight forward: <?php if ($_GET[‘t202kw’]) { $kw = strip_tags($_GET[‘t202kw’]); } if(strpos($kw,’jetinternetmarketing.co.uk’) !== false) { $page = ‘<h1>Dont target JiM on traffic Vance</h1>’; } ?> The problem was that the url I was…