0

I need a formula to calculate which ad will go first.

Okay, here is the problem: I am working on a system that is a new way of advertising. Advertisers will define their total budget and max CPC's for one category.

If there is more than one advertiser in the same category, whose ad will go first and what will be the order?

Here's an example:

Advertiser # | Total Budget | Max CPC
-------------|--------------|---------
1            | $1000        | $1
2            | $1,000       | $5
3            | $500         | $10
4            | $10,000      | $4 

And category's average CTR is %2

Yes, all numbers are fake.

So, whose ad will go first and why and how? And how can I formulate this?

tshepang
  • 12,111
  • 21
  • 91
  • 136
  • thats no real "programming related" question – user287107 Mar 03 '13 at 22:02
  • I think you will have better luck getting an answer if you describe the problem domain better. The pool of people that know what CPC, CTR and such is is much much smaller than the pool of people that know how to come up with algorithms and formulas. Additionally, this is hardly a programming question (yet). – Lasse V. Karlsen Mar 03 '13 at 22:03
  • What is CPC and how do you define which is more important? I presume you need over factors like advertisements already shown? – Meirion Hughes Mar 03 '13 at 22:03
  • So, I assume that I will have average CPC and CTR per each category. When the advertisers want to start a campaign, they should define their total budget and they should bid for clicks as CPC. So think like that; it will show the ads based on this algorithm, but it should show all ads based upon the ratio of the total campaign budget and max CPCs. Like this: If I have 4 advertisers, 4 ads and 100 slots, they should show in different slots with different ratios. First one will take the %45 (example) of the slots, second one will take %30, third one will take %20 and the last one will take %5 – paranoidandroidiot Mar 03 '13 at 22:10
  • I think putting your idea of 'fair' into an algorithm is very difficult. Fairness is an abstract idea, that would change from one person's perception to another. For example my idea of fair hair is straight competition - those who pay most CPC would be served. Their budget size shouldn't play into it, as their $ are worth as much as the next $. – Josh Dean Mar 03 '13 at 22:34

2 Answers2

1

Usually CPC works on a bidding system - those who are willing to pay the most for a click will be shown first as that will yield (assuming all ads are equally appealing to click on) the highest profit for the ad server.

Say Advertiser 1 is willing to pay 0.60c per click and Advertiser 2 is willing to pay 0.75c per click

You would serve Advertiser 2 first every time until their budget is reached, then proceed to serve Advertiser 1.

It is every advertiser's objective to be served, so it may behoof you to show people what rank they are to encourage them to pay more per click.

However this is not a "new way of advertising".

An algorithm to do this would be as follows:

    function get_best_ad(var category){

            //get all ads in that category                      
            array ads = get_ads_by_category('category'); 

            //sort them so the highest big is first in the array
            ads = ads.sort_by_bid('desc');

            /*the owner is the advertiser, their wallet is how much remains of their budget, the bid is how much is costs for that ad to be clicked. The first ad that can be served is returned; breaking out of the loop and method*/
            foreach(ads as ad){
                if( ad.owner().wallet > ad.bid() ){
                   return ad;
                }
            }
    }
Josh Dean
  • 1,593
  • 2
  • 11
  • 17
  • Thank you Joshua. I don't mean this is the new way of advertising, all system will be. It won't be fair like you said. It's unfair because if I do what you said, I can't publish other ads until the highest bidders campaign is over. So; it will show the ads based on this algorithm, but it should show all ads based upon the ratio of the total campaign budget and max CPCs. Like this: If I have 4 ads and 100 slots, they should be visible in different slots with different ratios. 1st will take the %45 (example) of the slots, 2nd will take %30, 3rd will take %20 and the last one will take %5 – paranoidandroidiot Mar 03 '13 at 22:15
  • Would it be fair to say you are using a model somewhere in between CPC and impressions then? – Josh Dean Mar 03 '13 at 22:22
  • You could assign random numbers by percentage? -rand(0,45) - 45% -rand(0,30) - 30% -rand(0,5) - 5% Then take the highest number and serve them – Josh Dean Mar 03 '13 at 22:25
  • Not using unfair model, I just try to order the bids and generate max clicks for them. It's all CPC based system but main problem is finding a way to coralate total investment and bidding CPC. That's why, I try to show all ads but order them based on the investment they did and bids. – paranoidandroidiot Mar 03 '13 at 22:29
  • Oh, so the larger their budget the more you want their ads to be served? – Josh Dean Mar 03 '13 at 22:32
  • Kinda. I want to find a corelation between advertisers total budget and max CPC to make show their ads. Like I said on the question, if someone has 1000$ total budget and $1 CPC and the other one has 500$ budget and $2 CPC, which will be first. I try to figure out a scalable system to not making mistakes if I have 1k advertisers. :) – paranoidandroidiot Mar 03 '13 at 22:37
  • It's up to you how you want budgets to affect their frequency of being served. Do you want bigger budgets to be served more, or lesser budgets? This is a business problem, not a programming problem. I personally think that budget shouldn't be included in the equation at all - but that it just my idea of 'fair'. – Josh Dean Mar 04 '13 at 01:33
0

In my experience on developing ad platforms is the best choice show the most clicked ad first, as in publisher eye, they want to make some money from ads, if you'r ad server shows same ad in 10 time with 0 income why publisher continue to use your system?

analyzing ads for click rate and sorting with CPC and searching the best ad for user interests/gender/location etc.

selam
  • 54
  • 2