Using AdDuplex for Windows Phone 8 Silverlight app

AdDuplex is a cross-promotion network specifically targeted at Windows 8 and Windows Phone apps and games. You add our AdControl to your application and start serving ads for other apps. They serve ads for your app in return. The ratio is 8:10. This means for each 10 ads displayed in your app 8 of your ads will be displayed in other apps. The remaining 2 ads will be sold to support the service. The advantage of using adduplex is that it has a 100% fill rate. So it is often used as a secondary option to fill ad space if the primary ad network fails to deliver an ad.

You may consider using these as your primary ad networks

Here’s how you could use AdDuplex in your app.

Step 1. Register for a publisher account on AdDuplex

First thing first. If you don’t have an adduplex account, register on

http://www.adduplex.com


 

Step 2. Register a new app from your dashboard

Click on New App button in the dashboard to register a new app. We are building a Windows Phone 8 Silverlight application.


 

Enter the details for the app and choose an appropriate platform.

 

Once you create the app, note down the App ID which we will need while developing the application.

 

Step 3. Create a new Windows Phone 8 Silverlight app

Choose a Blank Windows Phone Silverlight template from installed templates and create a project.

 


 

Step 4. Add AdDuplex SDK to your project using Nuget

Next, add AdDuplex SDK to your project using Nuget package installer. You might want to see

How to integrate a Toolkit or Third party SDK with windows phone app using NuGet Package Manager

 


 

Step 5. Add the namespace for using AdDuplex in MainPage.xaml

Add the namespace for AdDuplex on pages where you wish to display ads

xmlns:adduplex=”clr-namespace:AdDuplex;assembly=AdDuplex.WindowsPhone”

Step 6. Add the adcontrol in your page

Now add the adcontrol in your page. Use the App id which you generated earlier.


 

Note:

  • You can preview your own exchange ad by setting IsTest property to true.
  • Make sure the whole AdControl is visible by verifying that it’s not obstructed by any other objects on your page.

Download full project AdDuplex-Example.zip

Integrating Vserv ads in Windows Phone 8 app

Vserv’s new WP8 SDK offers offers a great opportunity to monetize your apps or games with only a small amount of additional effort. The Vserv.mobi WP8 SDK is designed to help you integrate Vserv Ads in your application and fast track your way to monetizing your WP8 applications.

Step 1. Register an account on vserv.mobi

If you already have a developer account at verv then skip to next step otherwise visit the following link to create a new account.

http://www.vserv.mobi/get-started/?at=developer

 

 

Step 2. Get your Zone ID from verv dashboard

Note down your ZoneID. This will be required later on when you use the WP8 SDK to request Ads. The default ZoneID will be available in your welcome email or you could visit https://admin.vserv.mobi/admin/affiliate-zones.php to get a list of all your zones.

 

 

Step 3. Get the vserv SDK for Windows Phone 8

Method I

The first step to integrating Vserv SDK in your WP8 application is to download our SDK package. The SDK package is available at the following link

http://www.vserv.mobi/sdk/WindowsPhone/VservWP8SDK.zip

We suggest that you unzip the SDK Zip file that you just downloaded into a temporary folder. You would find two folders in it, WP8V2SDK and SampleApp.

  • Add a reference to vservWindowsPhone.dll to your project (Refer to this article if you get struck in adding a reference)
  • Add the Images folder to your project from the vserv SDK folder

Method II

Alternatively the SDK can also be downloaded as NuGet package using the following command in the Nuget package manager (Refer to this article if you get struck in adding a reference).

Install-Package mobi.vserv.ads

Step 4. Add the following capabilities in your project

You also need to make sure that your project has the following capabilities

  • ID_CAP_NETWORKING”
  • ID_CAP_MEDIALIB_AUDIO”
  • ID_CAP_MEDIALIB_PLAYBACK”
  • ID_CAP_WEBBROWSERCOMPONENT”
  • ID_CAP_IDENTITY_DEVICE”
  • ID_CAP_IDENTITY_USER”
  • ID_CAP_PHONEDIALER
  • ID_CAP_REMOVABLE_STORAGE

 

 

Step 5. Requesting vserv ads

Using vserv SDK you can either have banner ads or full page interstitial ads in your application. Before you request for Ads you need to make sure you initialize the VservAdControl. Ideally you should initialize this when defining it in your project before the calling constructor.

VservAdControl VMB = VservAdControl.Instance;

Interstitial ads

To request an interstitial you need to call the displayAd() method.

VMB.DisplayAd(zoneID, LayoutRoot);

Note:

  • displayAd() is a part of the VservAdControl (vservWindowsPhone library) which need to be initialized before requesting for an Ad.
  • Optionally you can also set a timeout using the SetRequestTimeOut (timeout) method.
  • Make sure you pass LayoutRoot, else the full-screen ad will be displayed in the small banner.

Banner ads

You can request for Banner Ads which auto refresh automatically in a specific View using RenderAd() method.

Firstly, add an AdGrid in your MainPage.xaml file

<Grid Name=”AdGrid1″></Grid>

Then in the LayoutRoot loaded event handler add the code to render banner ads in your AdGrid1

Note: The RenderAd function takes two parameters

  • First is the zoneID which you copied from your dashboard earlier
  • Second is the name of the grid in which you wish to display ads

Callback functions

 

No Fill Callback

Sometimes vserv fails to deliver an ad. You would need to remove or hide the Banner Control when working with Banner Ads and other ad networks in its place.

void VACCallback_OnVservAdNoFill(object sender, EventArgs e)

Network Error Callback

At times when you request for an ad, there might not be any network available during the request, in which case the Vserv SDK calls the following method.

void VACCallback_OnVservAdNetworkError(object sender, EventArgs e)

Ad Close Callback

This is an essential callback which you need to implement. The Vserv Ads make use of the ApplicationBar to provide a native experience to the user, this is achieved by taking over your ApplicationBar. Thus, ideally you need to reinitialize your ApplicationBar in this callback. This is called when the user returns to your App from the Ad

void VACCallback_OnVservAdClosing(object sender, EventArgs e)

Get the full project source code here,

Download full project source code Vserv-ads.zip

How to use Google AdMob in Windows Phone app

When it comes to monetization using in-app advertisements in Windows Phone apps, there are quite a few option like Microsoft’s Pubcenter, Mobfox, Smaato, AdDuplex, Nokia’s Inneractive and Google’s Admob. In the past two years I have tried all these ad providers and have finally struck to Google’s Admob. There was a period when Microsoft’s Pubcenter gave the best returns but gradually its fill rates started dropping and earnings dropped by around 99.5% for developers outside US. That made me try other ad providers available for WP and frankly none of them are as good as Pubcenter(the old one) but now developers don’t have a choice. In this post I will show you how you can integrate AdMob in your Windows Phone app. You can add AdMob in your app by XAML or via code in C#.

UPDATE:

We have noticed a improved eCPM(0.2 $ to 1.1$) and fill rates(60% to 90%) for pubcenter. So you might consider using pubcenter in your windows phone app.

If you have significant traffic in India then you can give a try to Vserv for Windows Phone 8 which gives a better eCPM than AdMob.

 

Step 1. Getting the SDK

Firstly download Google Admob SDK for Windows Phone from the link below

https://developers.google.com/mobile-ads-sdk/

 

Step 2. Creating an ad unit 

Go to your AdMob account and create an ad unit for your app

https://apps.admob.com/#home

Note: You would need a upgraded Admob account for this purpose and the previous admob account is no longer supported. You can read more about it here.

 

Fill in the details to create an AdUnit as follows

  • Fill in your app name and select platform

  • You can configure analytics for your app and link it to your Google analytics account. Learn how to integrate Google analytics in your app. We will skip it for now.
  • Select the type of AdUnit and fill in the name for the AdUnit. You can customize the look of the ad whenever you want
  • Click on save and an AdUnit id would be generated.

 

 

All done you are ready setting thing up for AdMob.

 

Step 3. Add the GoogleAds reference to your project

Unzip the SDK files and you will find a GoogleAds.dll file in it. Create a new project and add a reference to this dll file in your project. Here’s an article explaining how to integrate a Toolkit or Third party SDK with windows phone app using NuGet Package Manager.

 

Note

If the GoogleAds.dll is showing as incompatible then follow these steps

  • In the file explorer, navigate to the Google Ads.dll
  • Right click the dll file and click ‘Properties’
  • In the ‘General’ tab, at the bottom, there will be an ‘unblock’ button
  • Unblock the dll file and add it again in your project

 

IMPORTANT: You will need to add the following capabilities in your app for ads to appear!

  • ID_CAP_NETWORKING: Access to network services is required when requesting ads.
  • ID_CAP_WEBBROWSERCOMPONENT: Required since the AdView is a web browser.
  • ID_CAP_MEDIALIB_PLAYBACK: Provides access for currently playing media items.
  • ID_CAP_MEDIALIB_AUDIO: Provides read access to audio items in media library.

 

Now you can either add ads using XAML or via C#

How to add ads using XAML

 

Go to Toolbox in your Visual Studio and right click on general category and select Choose Items.

 

 

From the choose items dialog box tick AdView from Google Ads and click OK to include the control in the Toolbox.

 

 

Now you can view AdView control in the Common Controls list of the Toolbox. Select and drag it to place it anywhere in the page

 

 

Add the AdUnit ID you generated earlier to the control. The XAML should now look similar to this.
  If you have added the XAML code directly then a reference will be required for AdView control   xmlns:GoogleAds="clr-namespace:GoogleAds;assembly=GoogleAds"  

How to add ads using C#

  • Add the code below to display ads using C#
  • You can see the function admob(StackPanel stck ) takes a parameter which is the name of the stackpanel in which you wish to place your ad. Instead of a stackpanel you could use a Grid too.
  • Add the StackPanel in which you wish to place your ad in the XAML
  • Call the admob function in the page constructor as follows
    admob(AdGrid);
  • The advantage of this procedure is that you could place multiple ads in different StackPanels or Grid just by changing the name of the StackPanel/Grid in the parameter

 

Here is how the app looks when you run it in the emulator.

 

 

Download full project Google Admob.zip