How robot auctions are shaking up digital advertising
How long does it take to load a webpage? Half a second or less, depending on the speed of your internet connection?
Well, in that fraction of a second, something extraordinary is happening behind the scenes.
A hyper-fast auction is taking place, involving tens of thousands of media buyers bidding for the right to launch advertising on that page - ads targeted at you.
All this happens automatically in just a few milliseconds.
It's called programmatic advertising - a catch-all term for the automation of many aspects of digital advertising - and it's making advertisers think twice about how they spend their money.
"We get an opportunity to bid on your eyeballs," explains Martin Kelly, chief executive of Infectious Media, a programmatic advertising specialist.
"We'll know what type of computer you're using, where you are roughly, the bit of the website you're looking at, but we won't have any personally identifiable information.
Everything is data-driven marketing now
"If we have one of our cookies on your machine we might know which websites you've previously visited, and the website might give us some information, too, such as which other sections you regularly visit.
"We then crunch that data and decide whether or not to bid for that ad in an auction."
This is a huge shift in behaviour, says Daniel Knapp, senior director of advertising research at consultancy IHS.
"How ads have been bought and sold had remained the same since the Mad Men age of the Fifties," he says. "It was done face-to-face or over the telephone - it was incredibly antiquated."
In the past, agencies wanting to reach a certain demographic - women aged 35-45, say - would use audience measurement services to find out where best to place their ads. They'd then buy the ads weeks in advance.
"Now those ads are sold in real time," says Mr Kelly.
While automation technology - much of it borrowed from the high-speed trading world of investment banks - has been around for several years, programmatic is taking off now due to an explosion in the amount of data advertisers and publishers have about us, and huge increases in computing power and storage.
Cloud-based platforms such as the Rubicon Project have made the process much easier.
"Advertisers can be a lot smarter about how they use their budgets," says David Frew, senior programmes manager at the Internet Advertising Bureau (IAB) UK, a trade body. "And publishers also benefit because they can use their ad spaces more effectively."
In the UK, 45% (£960m) of online and mobile display ads were sold programmatically in 2014, up from 28% in 2013, says IAB UK.
And IHS forecasts that by 2020, 90% of global online banner advertising will be bought and sold programmatically, equating to a spend of $92.6bn (£60bn).
On top of this, advertisers, such as supermarkets or large retailers, have huge databases that are goldmines of information about the buying habits and location of their customers.
Integrate these with data sets from mobile phone and credit card companies, social media, public records and other sources, and you have the means to build up a very detailed picture of the people who are visiting a website.
This means you can show them ads that are much more likely to chime with their interests, buying power and previous purchasing habits.
Say you bought something recently from your favourite sports shop, you may then find ads for tennis racquets, trainers or fitness trackers pinged at you the next time you log on to Facebook.
"The best customer is a past customer - 20% of customers drive 80% of retailers' revenue," says Tim Vanderhook, chief executive of ad company Viant.
"So now a retailer can tell Facebook that if any of the five million people who've bought from me in the past show up, then serve this ad to them. Everything is data-driven marketing now."
Mr Vanderhook says his marketer clients in the US are enjoying returns "30 times better than what they were doing previously" after moving to this approach.
He points out that for marketing purposes our personal identities are anonymised using a cryptographic hashing process that assigns each of us a long number code - a unique digital ID.
These codes are then shared by advertisers and publishers to identify us as the person who did this, liked that, bought this, and visited that website.
Not so smart
While the buying and selling of ads is certainly benefiting from automation, the system is still a little clumsy.
The satirical magazine Private Eye has a section called Malgorithms devoted to examples of unsuitable ads placed next to news stories because the ad-serving program has not understood the context correctly.
"Targeting ads on keywords alone is a blunt instrument," says Mr Kelly. "You can end up with an ad for luggage company Samsonite running next to a story about a body being found in a suitcase, for example. Brands are understandably wary about this."
In a similar vein, Amazon customers have often become annoyed by ads for a similar product to the one they have just bought, making a nonsense of its so-called recommendation engine.
"These glitches tell us that the ad industry is much less sophisticated than it likes to think," says Mr Knapp.
Fraud has also been a problem for programmatic advertising, with robots pretending to be real people visiting websites - some of them fake - to boost artificially the number of ad views and click-through rates.
The industry has set up an anti-fraud taskforce in a bid to tackle the issue.
Gremlins aside, it certainly seems that momentum is building behind the automated buying and selling of ads.
But what this technology cannot guarantee is that such advertising will have any creative merit. Humans are not totally redundant yet.
You can follow Matthew on Twitter: @matthew_wall