Fix for Campaign Under Delivery Problem

Software BugMany people have noticed significant under delivery of their contract campaigns in OpenX Ad Server 2.8. When OpenX version 2.8.2 was released in October 2009, it was mentioned in the release notes that this issue had been fixed, but it was quickly discovered that the problem continued to exist.

This problem was so serious for me and my clients that I was forced to take action. People had reported the issue in various places, but as far as I could tell no action had been taken at OpenX.org. I decided to hire Matteo Beccati, a former OpenX Senior Developer who is now working as an independent OpenX consultant. With his background and experience, he was able to quickly analyze the issue, and develop and test a fix for this bug.

The problem originates from a small but crucial mistake in the hourly maintenance process. At the top of every hour, the OpenX software recalculates the number of campaign impressions it needs to deliver for the next hour. The program code retrieves and uses the delivery statistics for the current hour, which (by definition) are not yet available. As Matteo described it in is bug report:

Impression allocation for contract campaigns seems to be constant for every hour, regardless of the traffic patterns. That’s a problem for most of the sites that have a bell shaped delivery and can’t reach the hourly target during the night. Those “lost” impressions will only be reallocated on the long run leading to overall under delivery.

Having found the cause of the problem, Matteo was able to develop a fix for it. We have been testing the adjusted code for a while now and I’m happy to be able to report that affected campaigns have started to perform as expected.

We decided to publicly release the fix so the OpenX community can benefit from it. The bug report and patch are available now in the OpenX issue tracker. Please note that this fix has been developed and tested on OpenX version 2.8.2 only. Applying patches to software should be done by qualified programmers only. As usual, make backups of any file you are about to change.

The issue has been labeled ‘critical’ by the OpenX development team. Hopefully this means the fix will be included in the upcoming version 2.8.3 of OpenX Ad Server.

I want to thank my client PSH Media Sales in The Netherlands for enabling us to use their campaign delivery statistics for analysis and for allowing us to test the fix on their installation. And I want to thank Matteo Beccati for devoting some of his precious time to this job. We would appreciate your feedback on this patch.

Update January 23, 2010: this fix is included in the upcoming release of OpenX Ad Server version 2.8.4, making it available to thousands of users that aren’t comfortable with applying patches to their software.