DVLUP has a challenge Shamelessly promote your apps with AdDuplex. AdDuplex doesn’t earn you any income so why would you want to give ads to your users without any benefit to yourself? AdDuplex answers this succinctly “According to reports the average fill rate in mobile ad networks could be as low as 10%. AdDuplex helps you utilize 100% of your ad space, so even when you are not making money from the other ad network you get free promotion for your app.”
It is encouraged to use an ad network with fallback to AdDuplex and It only takes 5 minutes to add to your app.
- Add references to Microsoft Advertising and AdDuplex
a. Install Microsoft Advertising SDK, if not already, and add reference
b. Install AdDuplex via NuGet Package. Enter into the Package Manager Console:
Install-Package AdDuplexWP8
- Add references to the namespace in your Xaml page you want to display the ads
xmlns:ad="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI" xmlns:adduplex="clr-namespace:AdDuplex;assembly=AdDuplex.WindowsPhone"
- Add controls so that the AdDuplex banner is under the Microsoft Advertising banner.
<adduplex:AdControl x:Name="adDuplexAd" AppId="12345" VerticalAlignment="Bottom" /> <ad:AdControl Name="photoFoodDiaryAdControlRecordPage" Width="480" Height="80" VerticalAlignment="Bottom" IsAutoRefreshEnabled="True" IsAutoCollapseEnabled="True" ApplicationId="test_client" AdUnitId="Image480_80" />
AdDuplex requires that the complete banner is not hidden. With this setup, if the Microsoft Advertising banner fails to get an ad the IsAutoCollapseEnable will set Visibility Collapsed showing the AdDuplex banner.
- Generate Ad ids
a. In WP Dev Center publish or update. Add in-app advertising and Generate ad unit ID.b. Sign up to Ad Duplex if you haven’t and add a new App.
- Add the required capabilities to your WMAppManifest.xml
- Since the ad network doesn’t always return an ad, to test your ads check for any errors occuring, and set the ApplicationId and AdUnitId to the test values from here. Simple add a break point in the method and inspect e.Error.Message if the break point is hit.
ErrorOccurred="AdControlRecordPage_ErrorOccurred"
private void AdControlRecordPage_ErrorOccurred(object sender, Microsoft.Advertising.AdErrorEventArgs e) { }
Now you should see the Microsoft test ad. Remember to switch you ApplicationId and AdUnitId back to what you got from the Dev Center and you are done.