Blankenblog windows development and other geekery

27Oct/1023

31 Days of Windows Phone | Day #28: Advertising in Your Apps

This post is Day #28 in a series called the 31 Days of Windows Phone.

Yesterday, I wrote about how to get your application into the marketplace.  Today, I’m going to cover how to monetize your trial versions, or your free applications through the use of the advertising control.

Where Do I Get Started?

The place you’re going to want to get started is the Microsoft Advertising pubCenter.  They will walk you through getting the SDK, registering your application, and implementing the ads in your application.  But, because this is a series on development, I’m going to show you the implementation here, as well.

Adding the Ad Control To Your App

First, you need to GET the control.  If you completely skipped the link from my previous paragraph, you haven’t downloaded it.  You can get it here: 

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=b0f00afc-9709-4cc2-ba2c-57728db6cbd6

Once you have added the .DLL to your project, you’ll be able to start adding ad controls to your app.  (If you need help getting this assembly into your project, there’s a walkthrough on Day #16: Panorama Control.

Once you’ve got the control available to your project, it’s as simple as any other control.  Here’s what it looks like on a XAML page:

<ad:AdControl AdUnitId="Image480_80" ApplicationId="test_client" />

As you can see above, there are two required values for an AdControl.  AdUnitId, and ApplicationId.  You get both of these values by registering your application in the Microsoft Advertising pubCenter, and creating a new Ad Unit. 

Using Test Values In Your AdControl

While we’re testing, we shouldn’t use our ACTUAL AdUnitId values, because that would be like illegally clicking on our banner ads on a web page.  The AdControl is smart enough to recognize when it’s running in the emulator, and won’t show ads in that case.  Instead, you should use the values in my example above.  There’s actually 3 different types of test values, depending on what size/shape of ads you want to show.  Here’s the whole list:

Ad Type Ad Model Size (W x H) Test ApplicationId Test AdUnitId
Text Ad Contextual 480 x 80 test_client TextAd
XXL Image Banner Contextual 480 x 80 test_client Image480_80
XL Image Banner Contextual 300 x 50 test_client Image300_50

For my purposes, as you saw above, I am using the 480 x 80 XXL Image Banner.  This will take up the bottom 80 pixels of my application’s screen, showing ads from my specific ad unit.

What Is An Ad Unit?

Ad Units are specific “campaigns” that you might want to run.  For example, I have an application called “Toothbrush Timer".”  It’s meant to show kids how long to brush each region of their mouths.  Because I’m expecting parents to put it on the counter, and watch it with their kids as they brush, advertising seems like a perfect way to catch their eye.

The best part about the Ad Units is the ability to define Categories of advertisements to be shown.  In my example, I want to show ads that are relevant to parents and their children.  Thankfully, there are tons of different ad categories to choose from (there’s 385!), and you can even have multiple categories (up to 3) in one Ad Unit.  Here’s a look at the list:

So, once you’ve created some Ad Units in the pubCenter, grab those AdUnitId and ApplicationId values, and plug them into your AdControl.  Then your code, fully formatted, should look more like this:

<ad:AdControl x:Name="AdBox" AdUnitId="10018171" ApplicationId="350b8257-d92a-4978-a218-f3650bd485df" Margin="-12,528,-12,0" Width="480" Height="80" />

And here’s what the ad looks like in my application:

screenshot

 

Finally, Profit.

Just by adding this control to your application (assuming your application is actually downloaded by users), you should start seeing activity in the pubCenter.  It will show impressions, click-throughs, and other reporting metrics.  The most important number shows up right as you enter the site, though: revenue.

So get started showing ads in your application.  This is especially handy when you use ads in conjunction with the IsTrial mode that we talked about on Day #23.  Show ads before they’ve paid, and hide them afterwards.

Only 3 more days of this series to go…what’s been your favorite day so far?

Download the Code

This simple example just shows an AdControl on a XAML page.  But if you need to see how it’s done, this is definitely the example for you.

download

Comments (23) Trackbacks (0)
  1. This time the effective advertising that commonly use to promote business is SEO, it is also known as the best form of online advertising. You can also use the old style like banner and classified ads but you need to get more visitors and customer so you need to take advantage for the benefits of your business.

  2. Give yourself something to work toward – constantly.

  3. It's just like Google Adsense for programmers, right?

  4. I agree, many thanks to the author. Thanks for taking the time to share this,Great blog post. Thanks..

  5. This post is Day #28 in a series called the 31 Days of Windows Phone. Yesterday, I wrote about how to get your application into the marketplace.   Today, I’m going to cover how to monetize your trial versions, or your free applications through the use of the advertising control.

  6. We are here and it is now. Further than that all human knowledge is moonshine.

  7. Our deeds determine us, as much as we determine our deeds.

  8. Life is pleasant. Death is peaceful. It's the transition that's troublesome.

  9. Swindon What will history say Burgoyne History, sir, will tell lies as usual.

  10. Cowardice, as distinguished from panic, is almost always simply a lack of ability to suspend the functioning of the imagination. Learning to suspend your imagination and live completely in the very second of the present with no before and no after is the greatest gift a soldier can acquire.

  11. To someone seeking power, the poorest man is the most useful.

  12. Often, the surest way to convey misinformation is to tell the strict truth.

  13. The roots of education are bitter, but the fruit is sweet.

  14. For centuries, theologians have been explaining the unknowable in terms of the-not-worth-knowing.

  15. There is a single light of science, and to brighten it anywhere is to brighten it everywhere.

  16. Better keep yourself clean and bright you are the window through which you must see the world.

  17. The longer I live the more I see that I am never wrong about anything, and that all the pains that I have so humbly taken to verify my notions have only wasted my time.

  18. There are some things which cannot be learned quickly, and time, which is all we have, must be paid heavily for their acquiring. They are the very simplest things and because it takes a man's life to know them the little new that each man gets from life is very costly in the only heritage he has to leave.

  19. Sooner or later everyone sits down to a banquet of consequences.

  20. I own a health care business and I would like to advertise on cell phone apps that deal with senior health. Where do I begin??

  21. Hi there,
    I can’t find any information about the difference in the revenues between the small & the big ad?
    Thx in advance for any information :]

  22. Which is certainly only excellent! Cheers


Leave a comment

(required)

No trackbacks yet.