Solving “something is covering the ad control” problem

We use some algorithms to protect the apps on the AdDuplex network from other apps accidentally covering the ad control and thus not actually showing the ads. While these algorithms are effective in general they sometimes result in issues that are hard to identify or conflict with common desires of developers (like implementing a button to close the ad).

We have updated our Windows Phone SDKs to address these issues.

Ad removal button

Versions 2.8.0.5 for WP8 and 2.7.0.5 for WP7 introduce a possibility to create ad control removal buttons. For the longest time it was not possible because the ad control checks whether or not it is covered by other XAML elements.

The new release spares some space in the top right corner of the ad control. Use that space for your button placement.

Following is a primitive example of how to implement the ad removal button.

Set IsTest property to True and build your app to refresh the Visual Studio design view.

<ad:AdControl x:Name="adControl" IsTest="True"/>


A greenish layer will appear on top of the ad control (visible only in VS design view!). This layer represents an area that must be left uncovered in order for the ad control to work properly.

designer_istest_true

Locate your button into the black patch. This demonstration uses a TextBlock element with its Text property set to “X”.

<TextBlock Text="X" TextAlignment="Center" 
Margin="443,269,4,306" Tap="Close_Tapped"/>



Try not to cover the green area.

x

New debugging tools for covered ads

If you feel that your app serves more ads than you see reported in the AdDuplex statistics, chances are that it is covered by some other element in the visual tree. Often it is difficult for developers to get to the root of the problem. In this version we have added a couple of means to ease that debugging process.

Try running the app with the IsTest property set to True. If some element is covering the ad control, a message will pop up and the culprit element will receive a reddish shade.

reddd

The ad control got a new event that is raised when the control is covered. Hook up AdCovered event and check the handler arguments for the culprit element.

<ad:AdControl IsTest="True" AdCovered="AdControl_AdCovered/>

redling

One thought on “Solving “something is covering the ad control” problem

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s