views:

57

answers:

1

I would really like to know how web sites decide what ad to show to a user and how many times.

I think there must be a table Ads (id, url, ...) which is linked to a table Users by many to many relationship via table Ads2Users (ad_id, user_id, shown_count, clicked_count). So that each time a user is served a particular ad we find (or create) a record in Ads2Users and increment the counter.

Seems simple if we consider registered users and those who do not erase cookies.

Now the question: is that how it works?

+3  A: 

You're overcomplicating things. It's certainly possible to track the number of times an ad has been delivered to someone and serve them something different, but there's no major benefit to it. Random delivery tends to be just fine for the vast majority of applications.

If you've got lots of ads (i.e. thousands), the chance of re-delivering the same ad in quick succession is fairly small. If you've got few ads (i.e. 10), not re-delivering the same ad to the same user would mean you run out of ads very quickly. In either situation, tracking delivery wouldn't benefit you at all.

Add in the fact that repeat exposure to advertisements is considered positive in the real world - there's a reason Coca Cola tries to get its logo in TV shows, movies, advertisements, billboards, etc. - and there's really little reason to do this.

ceejayoz
So, you're saying there is one table Ads that counts views and that's it?
z-boss
It's likely a little more complicated than that in a big system, to deal with stats over time, geographic location and whatnot. You can download one of the many large open-source ad serving systems (OpenX is a good one for PHP) and see how they structure things.
ceejayoz
Thanks a bunch!
z-boss
Tracking (various info) might be useful to know what ads worked and what didn't even after repeated deliveries etc. But +1. Good answer.
Moron