Working with AdDuplex and the nofill backoff

Sep 22, 2013 at 10:03 PM
AdDuplex fills ads 100% of the time whereas the other adproviders I use are PubCenter and Smaato and they fill below 50% and often much less. I've noticed that when AdDuplex is in the ad strategy that shows ads most of the time regardless of the percentage chosen and even with 0% selected. I've found that this is due to the two no-fill ad provider back offs that are in RemoteAdProviderStrategy.cs.
  1. Any ad provider that doesn't fill is ignored until the next minute on the clock.
  2. Each no-fill for an ad provider moves it down into a new group and only ad providers in the top group are selected from.
The second back-off means that adduplex which fills 100% of the time will always stay in the top group and if the other providers just do a single no-fill they will be out of contention for the rest of the run of the app.

Since AdDuplex doesn't pay for advertising I don't want the other adproviders dropped like that. So I've commented out the line that increments the no-fill property. Ideally I would make AdDuplex a fallback ad provider for use only when all other providers are not filling yet there is a network connection. There are certainly still lots of countries where the ad providers I use don't ever fill any ads. Right now WPunifiedAd only has a no-network fallback provider which doesn't suit AdDuplex.

I still have time timed back off included to penalize an ad provider that doesn't fill. Here is the change I made.
        public string FindAdProviderName(IEnumerable<string> validAdProviders, AdEventArgs adSelectionCause)
            validAdProviders = validAdProviders.ToList();
            if (adSelectionCause != null)
                //Add penalty to the AdProvider
                Probability probability =
                    Probabilities.SingleOrDefault(p => p.ProviderName == adSelectionCause.AdProviderName);
                if (probability != null)
                    // Don't increment penalty since this will stop all requests to the paying ad providers due to AdDuplex always filling an ad - pja20130922
                    // probability.NoAdCount++;
                    probability.LastNoAdOn = DateTime.Now;