开发者

Using an AdControl when Ads are unavailable, in TestMode, and the limits of keywords

When using the AdControl:

  • Is it possible to have a b开发者_开发问答ackground image display when the phone does not have connectivity to the Ad Server? Maybe set the background to an ImageBrush?
  • In the documentation it says there is an AdControl.TestMode property but I haven't found it (I'm using version 2.1.11120.1).
  • Is there a limit or a recommendation for the max number of keywords for the AdControl.AdSelectionKeyWords proprety ? I saw in the documentation that the limit for a single keyword is 255 chars, but it doesn't say anything about the length of the entire keywords string.


AdControl.TestMode is a static property that you can probably set from anywhere in your app, at least in theory. You don't need a reference to the control.

In practice, you need to set AdControl.TestMode early in your application's lifecycle. I usually do it in the application's contstructor:

public App()
{
    ...
    InitializeComponent();

    AdControl.TestMode = false;

    ...
}

I have a blog post detailing how to do this.

I'm not sure about setting a background image. The behavior I've seen is that the control will load briefly, showing the border, then disappear. It seems like it might be collapsing, but it's hard to tell at runtime.

EDIT: OK, I did some playing around with a sample project and confirmed that the AdControl collapses when the ads are unavailable. I tried setting a background image in code but it wasn't displayed, since the control disappears if it doesn't have any ads to display.

If you want to avoid having a big hole in your application, a simple solution would be to put an Image control behind your AdControl. When the AdControl collapses, it will reveal the Image. Not as elegant as what you were hoping for, but it would work.

EDIT 2: Found the answer on the keywords question. The AppHub submission guidelines state:

Keywords - Keywords that can be used to assist users in finding your application in the Windows Phone Marketplace. A maximum of five keywords can be used, separated by commas.

So that's five terms, comma delimited, up to 255 characters.

EDIT 3: Found a post dating back to January of 2011 that indicates that pubCenter is ignoring the keywords property on the AdControl. And this one indicating that it didn't seem to work as of February. I'm guessing they still don't work. If you're looking to target ads more appropriately to your audience, make sure your ad channel selections in pubCenter are relevant. You can also build a form into your app to allow your users to give you some demographic data. I'm planning to incorporate this into my apps at some point, and in exchange I'll unlock an extra feature or two. Win win. :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜