Skip to main content

Native Ads

Native Ads allow you to create a better ad experience by blending the ad directly into your app or game, including customizing it to match your UI to a great extent.

Benefits of Native Ads

  • Native ads have better eCPMs than Banners, almost comparable to interstitials.
  • The use of Native Ads as opposed to other ad types has been shown through multiple experiments to positively impact retention!
caution

You should finish these steps before releasing.

Sizes

A native ad can be displayed in different sizes. The following sizes are available:

SizeDescriptionAvailability
SmallThe size is customisable with width x height ratio of 3:1Phones and Tablets
MediumThe size is customisable with width x height ratio of 6:5Phones and Tablets

Load and display the ad

You can show the ad using this code, but we recommend using the ad events as you’ll be able to show the ad once it’s loaded. You can check the full script provided below.

Yodo1U3dNativeAdView nativeAdView = new Yodo1U3dNativeAdView(Yodo1U3dNativeAdPosition.NativeTop | Yodo1U3dNativeAdPosition.NativeLeft, 0, 0, 360, 300);
nativeAdView.LoadAd();

To show an ad -

nativeAdView.Show();

To hide an ad -

nativeAdView.Hide();

Positions

Vertical Alignment

The three options for vertical placements of native ads are

  • Native Top (Yodo1U3dNativeAdPosition.NativeTop)
  • Native Bottom (Yodo1U3dNativeAdPosition.NativeBottom)
  • Native Vertical Center(Yodo1U3dNativeAdPosition.NativeVerticalCenter)

Horizontal Alignment

The three options for horizontal placements of native ads are

  • Native Top (Yodo1U3dNativeAdPosition.NativeLeft)
  • Native Bottom (Yodo1U3dNativeAdPosition.NativeRight)
  • Native Vertical Center(Yodo1U3dNativeAdPosition.NativeHorizontalCenter)
nativeAdView = new Yodo1U3dNativeAdView(Yodo1U3dNativeAdPosition.NativeTop | Yodo1U3dNativeAdPosition.NativeLeft, 0, 0, 900, 750);

Configure the ad events

The MAS SDK fires several events to inform you of ad availability.

using Yodo1.MAS;

public class NativeAdLoader : MonoBehaviour
{
Yodo1U3dNativeAdView nativeAdView = null;
private void Start()
{
nativeAdView = new Yodo1U3dNativeAdView(Yodo1U3dNativeAdPosition.NativeTop | Yodo1U3dNativeAdPosition.NativeLeft, 0, 0, 360, 300);
SetupEventCallbacks();
LoadNativeAd();
}

private void SetupEventCallbacks()
{
nativeAdView.OnAdLoadedEvent += OnNativeAdLoadedEvent;
nativeAdView.OnAdFailedToLoadEvent += OnNativeAdLoadFailedEvent;
}

private void LoadNativeAd()
{
nativeAdView.SetAdPlacement("Your placement ID");
nativeAdView.LoadAd();
}

private void OnNativeAdLoadedEvent(Yodo1U3dNativeAdView ad)
{
// Code to be executed when an ad finishes loading.
}

private void OnNativeAdLoadFailedEvent(Yodo1U3dNativeAdView ad, Yodo1U3dAdError adError)
{
// Code to be executed when an ad request fails.
}
}

Impression-Level User Revenue

Starting in SDK version 4.13.2, you can access impression-level user revenue data on the client side. You can use this data to compare different sources and campaigns.

You can share impression-level ad revenue data with your mobile measurement partner of choice.

You can retrieve the revenue amount in all ad lifecycle callbacks. The following example shows how to do this within callback:

nativeAdView.OnAdPayRevenueEvent += OnNativeAdPayRevenueEvent;

private void OnNativeAdPayRevenueEvent(Yodo1U3dBannerAdView ad, Yodo1U3dAdValue adValue)
{
double revenue = adValue.Revenue;
string currency = adValue.Currency;
}

You can also retrieve a precision evaluation for the revenue value, as shown in the following example:

string revenuePrecision = adValue.RevenuePrecision;

Video Tutorial