1- Download the Mobile Ads Unity plugin Use the link below to download the Unity package for the plugin. Click here
2- Click on the download file and import it into Unity.
3- Go to the Asset -> Google Mobile Ads -> Settings.
You will get this in the inspector.
Enter your android and iOS app id
4- Initialize the SDK: before loading ads, Initialize the Google Mobile Ads SDK by calling MobileAds.Initialize(). the following bellow is the example.
using GoogleMobileAds.Api;...public class GoogleMobileAdsDemoScript : MonoBehaviour{ public void Start() { // Initialize the Google Mobile Ads SDK. MobileAds.Initialize(initStatus => { }); }}
If you're using mediation, wait until the callback occurs before loading ads to ensure that all mediation adapters are initialized.
5- Select the ad format from Admob after initializing the Google Mobile Ads SDK, you can choose from various ad formats offered by AdMob based on your app's user experience and revenue goals. See the admob ads format in the website of the admob for unity.
Note
Be sure to test your ads thoroughly, adhere to AdMob policies, and consider user experience while placing ads in your app.
⭐Happy coding⭐
Tags:
Unity