Advertisements

Why the Obtuse Names?

As you will see below, rather than naming the ads something obvious like advertisements, I've used the somewhat nondescript term Vendor Info. Why, you ask? Well it turns out that AdBlock Plus, one of the most popular ad blocker plugins for Firefox and Chrome, will prevent your browser from displaying things labeled as advertisement. Gee, who'd-a thunk it! (And yes, I found this out the hard way.)

Content Type

Each advertisement is stored as a Drupal node of type Vendor Info. Each of those nodes contains three fields:

  • Vendor Image - a graphic rendition of the advertisement. The acceptable image sizes and formats are listed in the IAC Advertising Guidelines.
  • Vendor Link - A URL that the user is sent to if they click on the ad.
  • Effective Dates - A pair of start/end dates, during which the ad will be displayed.

Selection and Formatting

Ads are selected and formatted for display using a Drupal View named -- you guessed it -- Vendor Info. Here's what it does in a nutshell:

  • Selects up to three nodes that are:
    • Published,
    • Of type Vendor Info,
    • Whose start date is less than or equal to today, and
    • Whose end date is greater than or equal to today.
  • Two fields are used from each node returned by the query: Vendor Link (which is excluded from the display), and Vendor Image
    • Due to a quirk of Views, we must select Vendor Link in order to...
    • Use a nifty feature of Views called Rewrite Results to wrap the Vendor Image in a hyperlink to Vendor Link
  •  The selected nodes are sorted in random order
  • The Views display is formatted as a block

Block Placement

The Vendor Info block is positioned at the right side of the screen (in the Secondary Sidebar area) using the Administration ► Structure ► Blocks page.

Setting Up an Advertisement

So with that infrastructure in place, all you need to do in order to set up an advertisement is add a Vendor Info node.

Gallery of Current Ads

I've created a view that displays all of the current advertisements, called current-ads (duh). (Where "current" means the expiration date is in the future.) This is useful verifying that no more than six ads are in the rotation, updating vendor information, etc.

Tracking

Note: This section is a placeholder; we have yet to implement ad tracking.

We get period requests for metrics about the effectiveness of our sponsors' ads. This link explains how to implement ad tracking via Google Analytics: https://support.google.com/analytics/answer/1136920?hl=en