KAM

From KallestadWiki

Jump to: navigation, search

I put together an a high speed ad generation script a while back and I was impressed with the performance. Not actually needing it at the time, I let it sit and gather dust. Even further back, I had created a solution that was more robust, but not quite as fast.

Now that I have the need, the time has come to work towards publication and to combine the two packages - perhaps even implementing them with the KDF Framework.

While it would be nice to create a be all end all solution, for now I'm going to focus on my needs. Initially:

  • Support multiple user defined ad sizes
  • Ad publication in an iFrame (to alleviate dependency loading)
  • Support any ad platform
  • Rotate ads randomly, with weighted selection so that preferred ads show up more
  • Maintain statistics regarding which ads are displayed
  • Track click throughs when appropriate
  • Disable a given ad vendor

Just out of the basic requirements I can see three tables - one for ad management, one for ad display tracking, and one for ad click tracking.

ad_manager
 ad_text
 ad_size
 ad_vendor
 status
 weight
 ad_type
 
ad_display_track
 ad_id
 referrer
 ip
 user_agent
 timestamp
 
ad_click_track
 ad_id
 referrer
 ip
 user_agent
 timestamp 

One thing that this data model doesn't provide is the ability to dynamically select ads based on a referring url. That's something I'll attack later. For now, I'm more interested in getting a working model than resolving all potential requirements.

Workflow

  1. initialization
    1. db connections
    2. cache high traffic queries
  2. connection
    1. resolve parameters to variables
    2. query appropriate ads
    3. make weighted selection of ad
    4. insert record into display tracking table
    5. send record to client
  3. Click
    1. insert record into click tracking table

It seems simple enough.

Personal tools