More thoughts about the ad-server.

The adserver as written is a rather simple piece of code. The information needed for each add is stored in an array of javascript objects and randomly selected to update the contents of a named<div> tag.

That’s fine for a small number of adds, but not suitable for a larger group. It’s also relatively fragile as one typo will kill the whole add. There are two options:

  1. Use some central repository, such as a file on google drive, to hold a configuration file. Read it on loading and run the adds from it. 
  2. Write a program to write the program. It reads a configuration file and its output can be simply included by hand, or from a central location. (i.e. a web reference).

Most add-servers use some variant of the first option. That way they can keep track of adds served and click-throughs (both of are charged to the advertiser). The headache for a free service is that it costs to maintain such a service. The second approach may have slightly higher initial load times (bigger scripts), but would run without a mandatory central server.

Author: Amelia

A mild-mannered professor of computer science in real-life, I remove my glasses in the evening to become, well, a mild-mannered author in my alternate reality. I mostly write sweet romantic fiction, although with an occasional science-fiction or paranormal angle thrown in. I have interests in history, mathematics (D'oh), and cryptography. I'm also something of an Anglophile, and know that country pretty well. In addition to writing, research, and more writing, I volunteer with the scouts. I'm something of a nature-nut, enjoying long walks in the country with almost ultra-light gear, boating, and identifying wildlife.

Leave a Reply

Your email address will not be published. Required fields are marked *