Friday 4 January 2013

The most valuable piece of code I ever wrote

    Thinking about a planned interactive feature for the OxfordWords Blog recently I was reminded of a little piece of Javascript which is probably the most valuable piece of code I ever wrote. Valuable in terms of revenue generated for the customer that is rather than value to me, for it took a very short time to write.
    It was a mid afternoon in 2007 or 2008 when one of my customers at the time rang up with an idea for a little feature for his web site. His company is a rather large second-hand vehicle specialist and he's one of those customers for whom I have a lot of respect. No-bullshit, but fair in return and one of those guys you can learn stuff from.
    The second hand vehicle business works over the telephone, if they can get you on the phone they're pretty good at persuading you to part with your cash to drive away in one of their machines. Their conversion problem therefore lies in getting the customer on the phone in the first place.
    So their site, a large catalogue of vehicles, was and still is plastered with their phone number. No need for a shopping cart or online payments, their industry has enthusiastically gone online but their customers still like to deal with someone directly when parting with cash.
    The problem facing my customer was that his conversion rates were still pretty low. Our spiffy site was generating him lots of traffic so he knew the customers were interested, but they were browsing and shopping around rather than giving him a ring in sufficient numbers.
    His idea was a simple one. If they stop on the page for a particular vehicle for any length of time, they must be interested in it. So he asked me to make a little pop-up that asked the question "Do you want us to call you about this vehicle?" the first time a customer stopped on an individual vehicle for more than a minute. Fill in your name and number, click the "Yes" button, and an email went off to his salesmen who'd give you a ring.
    Coding it took about half an hour. A hidden div containing the HTML form, a little bit of Javascript with a timer to unhide it after a minute, a bit of code to set a cookie so the user didn't get bothered by the form more than once, and an extra address for his form-to-email script. Nowadays I'd use a line or two of jQuery code and probably a fade or something, but back then it was straight Javascript. Still, hardly a big job, and I had it ready for his approval by the end of the day and live on the site the next day.
    A second-hand vehicle dealer like my customer buys his vehicles at auction, mostly not very old vehicles in bulk from the fleets run by large corporates. He then services them and gives them a current MOT test and warranty before offering them to his customers. His is the reputable end of the second-hand vehicle market so his customers pay a premium for good quality vehicles with a provable history, something they can't get from dodgy used car lots. He thus has quite a high turnover and running cost, but the margin on each vehicle sold is also fairly large. If he sells a vehicle by a means that didn't cost him much money, he's made a four figure sum.
    Hence my half-hour piece of Javascript was the most valuable piece of code I've ever written. Because it provided him with many more conversions from his web site at a very low cost, the first vehicle sold through it paid for it many times over and it made him many thousands of pounds thereafter. I'm guessing over the years it will have generated an astounding amount of money, for even though the company I worked for then has since folded in the recession and the customer's site now runs on a different platform it still features an updated version of my pop-up form.
    I'm glad that it was such a small piece of code that did so well for my customer. The customer went away happy and rewarded us with more business and lots of word-of-mouth recommendation, and I learned something important about calls to action and that not all industries fit the same web shop model.
    If only all my code proved to be of such value to the people paying for it!

No comments:

Post a Comment