0

I've implemented Microsoft ads on my uwp app, but it always shows same ads such as below: enter image description here

Here are the codes for implementation.

void MainWindow::showAd()
{   
    auto adControl = ref new AdControl();

    // Set the application id and ad unit id
    // The application id and ad unit id can be obtained from Dev Center.
    // See "Monetize with Ads" at https ://msdn.microsoft.com/en-us/library/windows/apps/mt170658.aspx
    adControl->ApplicationId = L"------";
    adControl->AdUnitId = L"------";

    // Set the dimensions
    adControl->Width = 50;
    adControl->Height = 300;

    // Add event handlers if you want   
    adControl->AdRefreshed += ref new EventHandler<RoutedEventArgs^>(this, &OpenGLESPage::OnAdRefreshed);
    adControl->VerticalAlignment = Windows::UI::Xaml::VerticalAlignment::Top;
    // adControl-? = Windows::UI::Xaml::Visibility::Visible;
    // Add the ad control to the page
    // auto parent = mPage->Parent;
    // parent->Append(adControl);       
    swapChainPanel->Children->Append(adControl);
}

Why Microsoft ads alwyas shows same image like above? I got this ads on debug mode. Is it related to Debug or release mode?

Michael Lee
  • 135
  • 1
  • 11
  • this looks like test ad when you use test account. you should have your app in the store to get real ads – Emil Mar 10 '18 at 23:30

2 Answers2

1

The Ad unit displays the same advertisement because it seems that you are using the test App ID and Ad unit ID.. During development you can use the test values to test out the ad control..

Before submission of the application to the windows store you need to create your own AD unit (for which you will receive an unique ID) and then use those values in your application to display ads.

Also note that the real(or actual) ad unit ID will only show real advertisements when the package is published to the store.. when developing you will not be able to see the ads with your Ad unit ID.

Every AdControl has a corresponding ad unit that is used by our services to serve ads to the control, and every ad unit consists of an ad unit ID and application ID. In these steps, you assign test ad unit ID and application ID values to your control. These test values can only be used in a test version of your app. Before you publish your app to the Store, you must replace these test values with live values from Windows Dev Center.

More info : Adcontrol(MSDN)


EDIT :

After testing your application I think this might be the issue that you are facing :

Test ads are showing in your app instead of live ads Test ads can be shown, even when you are expecting live ads. This can happen in the following scenarios:

  • Our advertising platform cannot verify or find the live application ID used in the Store. In this case, when an ad unit is created by a user, its status can start as live (non-test) but will move to test status within 6 hours after the first ad request. It will change back to live if there are no requests from test apps for 10 days.
  • Side-loaded apps or apps that are running in the emulator will not show live ads.

When a live ad unit is serving test ads, the ad unit’s status shows Active and > serving test ads in Windows Dev Center. This does not currently apply to phone > apps.

Known Issues for the UWP Advertising Libraries : Link Here.

Pratyay
  • 1,291
  • 14
  • 23
  • Thanks for your answer. I've used own ads unit ID and app ID from ad unit management panel on microsoft dashboard. But still same. How could I solve it? – Michael Lee Aug 13 '17 at 11:30
  • As I have mentioned in my answer your ad unit will show real ads only when when the package is published to the store..so it will always show the default value or in your case the default advertisement when in development. – Pratyay Aug 13 '17 at 12:07
  • I've published my app on Microsoft store and checked the ads again, but it shows same ads. Why this happened? – Michael Lee Aug 14 '17 at 00:51
  • Are you sure you have downloaded the package from the store ? If yes check if the App ID and Ad Unit IDs are correct.. if possible provide the link of the application so that I can test out and check what is actually causing the problem.. – Pratyay Aug 14 '17 at 02:17
  • Thanks. Yes. I've tested with package downloaded from Store. Here is the application link on the Microsoft store. https://www.microsoft.com/en-US/store/p/real-hillclimb/9p34st149qqd?rtc=1 And here is the application Id and ads Id. https://s25.postimg.org/5a3uqufgf/uwp_banner_ads.png Also below is the codes for set app Id and ads Id. adControl->ApplicationId = L"9p34st149qqd"; adControl->AdUnitId = L"353598"; Please check it and give me some advise. – Michael Lee Aug 14 '17 at 03:50
  • I have tested your application and it seems that your application is showing the test ads,as you have mentioned. I have edited my answer .. please consider all the know issues for the UWP Advertising Libraries.. – Pratyay Aug 14 '17 at 09:24
0

Some fixes are rolled out by Microsoft not long ago, and this issue should be resolved now. You can have a check if the issue is gone for you. If it still exists, then a support ticket will be needed to get it reviewed.