How an ad server algorithm works !!!

Posted on 2010-08-25
Last Modified: 2013-11-13
Hi Experts,

   In a nutshell please explain me how and what are the algorithm an adserver works. i know the simple working procedure ie, picks up the best relevant ads from a list of ads and displays accordingly, yet saying relevant ads isnt enough to explain its procedure, If  i want to implement something like that in php programming how should i take the things, just do a match and display , shuffle the ads and display or display as per the advertisers $$. or what ...  These things are confusing me. If you were to build a scalable ad server, interms of happy advertisers how will you code it in php . saying happy advertisers coz such situations arises when it collides between a targetted campaign advertiser and a global targetted advertiser. Acccording to algorithm both ads are eligible to be viewed by a normal user. Discriminating anyone of them makes them withdraw service from me. So please answer keeping this complicacy.

Too much of questions , sorry, but just curious,
Question by:pvsbandii
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
  • 2
  • +1
LVL 22

Assisted Solution

8080_Diver earned 332 total points
ID: 33531071
Essentially, each adserver is going to have its own algorythm and heuristic.  You have indicated that you have the basic understanding of the process, so you must surely realize that, even if someone explains how a particular adserver works, you will probably have no idea with regard to exactly how the next one works.
As for the rest of your request regarding how we would code one, you are, essentially, asking for someone to provide you with the code for one for free.  There is a reason that you don't seem to be able to find the source code for adservices (or, at least, the ones you are interested in ;-) on line . . . someone has paid a lot of money for and others have spent a lot of time in the development of these things.
The answer to your questions with regard to how you should do it come down to a line I frequently get from my wife, "You do what you think is best."  (Usually, that means that she thinks what I have suggested is not how to best do things, though. ;-)  In other words, there are a million ways to do this, some may be better than others but you have to make some choices and then see how it works out.  If you simulate the ads and their target audiences, you can work out some of the kinks . . . but, eventually, it comes down to you working out the algorythm and heuristic that you and your advertisers like best.

Accepted Solution

sourceweb earned 168 total points
ID: 33532865
Many factors are considered in such algorithms.
Good ads algorithms compare first the theme of the advertisement with the theme of the available web sites.
Based on relevance, they calculate a value.
Then they calculate based on existing data from the website (visitors, CPM, CTR ...) another value.
In addition, good algorithms have another number for all advertising pages in the database, which shows how valuable a site is.
Thus, for example, a pure advertising site could have the number 1, while the number of the page "experts-exchange" could be 10.
At the end of the algorithm is calculated a cost-per-click price from the collected data.

The advertisement is displayed, a visitor clicks on it and then the calculated price will be paid to the webmaster (only if a real visitor and no bot clicked on the advertisment).
There is another algorithm necessary in order to differentiate between real visitors and bots.

Hope I could help.

Expert Comment

ID: 33533040
My answer above should give only a first impression of this topic.
There are probably many factors to consider, which can not be explained here in a forum in 2 sentences.
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.


Expert Comment

ID: 33533302
One more thing:

It isn't displayed always the most relevant advertisement on a webpage.
If so, all the time would be displayed the same advertisement on the same page (until the advertiser would be bankrupt).

Therefore, it is necessary to program the algorithm so that it selects from the most appropriate ads one ad by random.

Author Comment

ID: 33534784
Its quite good to see the explanation coming in , thank you sourceweb and  8080_Diver ,    Lets expect some more comments from experts until i choose my answer, thank you. All are welcome who have atleast any ideas or have worked in such projects. Any common theory will work for me.
LVL 22

Assisted Solution

8080_Diver earned 332 total points
ID: 33535343
I would assume that, to some extent and as a "starting point", there is an effort made to determine the likelihood of a click-through happening and then that is probably adjusted/multiplied by the income a click-through would generate.  Once that is done, I would esxpect that a "short list" is generated (e.g. TOP 25).  Given that there is now a "reasonable" number of candidates for display, I would expect that some sort of ranomizing factor would be applied (e.g. SELECT whatever FROM wherever ORDER BY generatedGUID.  
Now, the hard part would be defining the likelihood of a click-through event in the first place.  (The per-click income is contractual and, therefore, someting of a KnownValue. ;-)  This is where the social engineering, data-mining of "preferences", and analysis of previous user-internet interactions comes into play.  How that happens is, IMHO, Magic . . . in other words, I don't have any idea where to start to get that information. ;-)

Expert Comment

ID: 33535507
> The per-click income is contractual and, therefore, someting of a KnownValue. ;-)

not always... the cost-per-click and earning-per-click can also be variable, it depends on the terms and conditions he writes on his "marketing-shop".

Google Adwords for example lets the advertisers decide a price range (for example from 7 cent/click to 50 cent/click) and the algorithm decides how many a specific click costs.

I would also recommend this. Everything else is nonsense.
A click on a pure advertising site is never as valuable as a click on a "good" site.

Expert Comment

ID: 33535645
Maybe this database design can help you to plan the logic of the application:

Table advertisers
      ID int primary_key auto_increment // The customer number
      name VarChar(50)
      surename VarChar(50)
      money decimal (7,2) // How many money does the customer have

Table Advertising_Pages
      ID int primary_key auto_increment
      advertisers_id // foreign key with advertisers.ID)
      URL VarChar(500) // The url of any webpage that displays your advertisings
      website_value int (or tinyint) // The value of the page (like Google PageRank)
      impressions int (how many impressions does this page have (weekly, daily, monthly) compared to the other sites
      unique_visitors int (how many unique visitors)
      CPM int (what's the CPM [click-per-1000-impressions])
      CTR int (the Click-Through-Rate of this page)

Table keywords
     advertising_page_id (foreign-key with Advertising_Pages.ID)
     keyword VarChar(50) // The Keyowrds for all advertising-sites

Table customers
      ID int primary_key auto_increment // The customer number
      name VarChar(50)
      surename VarChar(50)
      money decimal (7,2) // How many money does the customer have
      max_daily_spendings decimal(5,2) // how many does a customer want to spend daily (maximum)

Table Advertisings
      ID int primary_key auto_increment
      customer_id int // The customer-number, foreign key with table customers.ID
      Banner_image_url VarChar(500) // The banner to display
      Banner_click_url VarChar(500) // The link for the banner
      clicks int (how many clicked on this advertisment)
      impressions (impressions of this advertisment)

Table clicks // Table to log the clicks to display stats for the advertisers and customer
     customer_id int
     advertiser_id int
     date date default NOW()
     money_outgoing decimal (3,2) // The money the customer has spend
     money_incomming decimal (3,2) // The money the advertiser gets (hope not the same as money_outgoing, otherwise you don't earn anything ;)


It's only an example of a database-design...

Author Comment

ID: 33565834
Thanks , but i know  how the system works but i need any specific criteria or algorithm you will use to deliver ad. Any ideas are welcome , should be scalable and should not eat resource. I am not asking any source codes but just your explanation on how you choose and ad from many and deliver just one. please dont be specific about targetting , i am speaking for both global and a targetted ad delivery. I know its a simple match of the ads but matching 1 ad within a large data set looks to be a bad idea. What does a particular ad network uses to overcome this.
LVL 100

Expert Comment

ID: 36235310
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
proximity to a location polygon (Geozone) 1 176
Odds of Duplication 20 152
Python algorithm 20 163
Configuration Repository for Multiuser Application (Best Approach). 5 61
The Fluent Interface Design Pattern You can use the Fluent Interface ( design pattern to make your PHP code easier to read and maintain.  "Fluent Interface" is an object-oriented design pattern that r…
Dependencies in Software Design In software development, the idea of dependencies ( is an issue of some importance. This article seeks to explain what dependencies are and where they …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below.…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question