Drupal module for OpenX
This is a modified version of a very popular Drupal module for OpenX integration: Openads. The original plugin has many limitations, the most severe boing a lack of support of the so-called "channel targeting" feature, implemented in OpenX using "source" parameter. Modifications I've done solve this problem in a simple and - IMHO - very little intrusive way, using as much as possible existing Drupal features.
What is Channel Targeting?
Channel targeting is a way of organizing advertising for a website (or a group of) into "channels", so banner delivery can be better focused. Once configured, OpenX can be instructed to show banners belonging to the selected channel, using the correct invocation code (the HTML/Javascript code to insert into websites to load banners) and adding a "source" parameter.
Here is a detailed article about OpenX channel targeting:
http://blog.openx.org/11/how-to-implement-easy-and-effective-ad-targeting-using-openx/
http://tinyurl.com/m7rfwb
The original Openads module doesn't have this functionality (yet!), so I rolled up my sleeves, I've bought an excellent book on the subject and... did it by myself! This experience has been amazing and really useful, I suggest that every Drupal-coder-wannabe should try at least to contribute to one existing module, it's a very motivating situation.
A complete example
Step 1 - configure channels on OpenX
We will have two main channels, here they are along with their "source" parameters:
| Channel | "source" param |
|---|---|
| Politics | politics |
| Sports | sports |
Erik Geurts' article on this subject is very detailed and gives precious advice, you should definitely go back and review it later on! If you are in a hurry, just follow this tutorial. So:
- logon to your OpneX instance with a manager account;
- click on My Account -> Targeting channel management;
- click on Add new targeting channel.

Enter name and description, and repeat for each channel you're creating. Once all channels are set up you need to configure them, clicking on Edit targeting channel limitations.

Se let's see how to assign "source=politics" parameters to Politica ("Politics", indeed a hot topic in Italy today) channel:

- Once in Delivery Options tab, select Add delivery limitation in Site - source, clicking onAdd to confirm;
- select "is equal to" and insert "politics" in the text field;
- save changes.

Repeat these steps for each channel.
After configuring channels it's very easy to limit banner delivery on specific channels:
- create banner, or load an existing one;
- click on Delivery Options tab;
- select Site - channel option, then click Add;
- select one or more channels;
- save.

Step 2 - Taxonomy creation
Now go back to the website created with Drupal, where we'll create a vocabulary that will be used for site categories. Of course you can use an existing vocabulary, the only requirement being that it cannot be a multiple-choice vocabulary, nor a "tag" vocabulary, since OpenX seems supporting only one channel targeting per invocation.
- if Taxonomy module is not enabled (it is by default) go to Administer -> Site Building -> Modules and activate it;
- go to Administer -> Content management -> Taxonomy;
- click on Add vocabulary;
- insert "Section" in Name texfield;
- select content type to apply this taxonomy to; since vocabulary we're going to create is generic, it could be wise to apply it to as many content type as possible, so to have an easy classification of articles, blogs, news, whatever. In any case, you could also create a "Unsorted" category to catch all generic topics.
Step 3 - Installation and configuration of Openads
Before proceeding with vocabulary configuration we need to install the modified Openads module. IMPORTANT: you need to use my modified version of the module, not the original one!
Here's how to do it:
- download archive;
- extract archive in openads folder and copy/move it in sites/all/modules;
- go to Administer -> Site Building -> Modules and activate OpenX Adserver Integration module;
- go to Administer -> Site configuration -> OpenX (Openads) adserver configuration;
- choose Javascript as Delivery method;
- insert correct values of OpenX delivery url, Publisher e Zone , following on-screen instructions. These values depend on the specific OpenX installation;
- create one or more zones;
- in Channel targeting section, select the vocabulary that you created in the previous step ("Section", remember?)
Step 4 - Channel configuration
Now you can associate a source value (the same you configured in OpenX) to each vocabulary term:
- go back to Administer -> Content Management -> Taxonomy;
- select Section vocabulary;
- click on Add terms;
- for each term insert Term name, Description (optional), "source" param to use (optional, too).
Step 5 - Insert banners
Each zone configured in step 3 will appear as a new block in Administer -> Site building -> Blocks. Insert as many banners as you like, then create some contents, choosing a different section for each. If everything was done correctly, you should see channel-related banners only!
That was easy, wasn't it?
- dimitri's blog
- Aggiungi un commento
- 3266 letture
-
- Italian
