AdMob Ads in Unity 2022 - Easy Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
how to add advertisements in your unity game follow these steps okay so this is the basic unity project in order to add advertisements make sure to change your target platform to Android because advertisements don't work on a Windows Mac or anything like that it only works on Android and iOS I am currently using a Windows computer so I will set it to Android make sure that you import the package Link in description you can download Google admob which is the thing I recommend you by the end of the video I will show you why anyway click the import [Music] button make sure to go to Google mobile ads settings and copy and paste the app ID you can go to the add mob documentation and use the test ID go to developer google.com add mob and copy the test ID and paste it here create an empty game object and name it ad manager that will also be the script name open Visual Studio and you basically need to copy the code and rearrange it until you see no errors but the addm plugin needs to process during some time this screen will pop up just press enable and go to mobile ads external dependency manager and resolve it for Android by clicking Force resolve if you get this screen this means you are ready for the next stage of the video you should open Visual Studio and that's the part that you are waiting for but unlike previous tutorials this tutorial will just use the code from the documentation first of all these lines are very important using Google mobile ads and Google mobile ads API introduce and initialize the mobile ads as decay this line of code can introduce it in your project mobile ads initialize initialization status in it status this call back is called once the mobile ads SDK is initialized so call the function in this way this request Banner it's a banner ad this request inner stal this line of code calls the inal IAL ad and there is one more kind rewarded ad these three kinds of ads need to have a private object banner ads have the banner view object you can call it Banner view intertial ads have the intertial ad object and for the rewarded ad simply call it rewarded ad I'm sorry because importing this code has caused this kind of error I will need to fix the syntax somehow this happens very often so I need to skip the part until I fix the syntax this was such an annoying bug in visual studio so I don't know why is it happening but don't worry I will cut to the part where I have fixed that syntax problem I will post the script file in description so you can download it after watching the video you need to define the add unit ID as a string object but be careful you need to assign it somewhere so copy the code from create Banner View and add it here after the banner view but you can also do it like this to call the function create Banner view if you get the error like public is invalid in private void now let's move to the inner stal ad locate the inner stal and get started intial ads are the full screen ads that cover the entire interface of your game you need to use the same logic but instead of saying Banner view say intial add I need to copy that part from the banner because I wasn't able to fix that annoying bug that was happening with those if else and and if lines and make sure that you change the add unit ID because it won't work if you don't change it you need the parts in which you can show the interal ad the same applies for banner and rewarded ads I recommend you to use the ID from admob documentation that's just a test ID that you would be using in development purposes for the rewarded ads the implementation is the same you just need to see the code the rewarded ads usually give reward to the player in a game but the syntax that will load the rewarded ads will consist of some additional lines of code now use the code for Show rewarded ad just make sure that it applies to the same name of how you called the rewarded ad before now save the script and go test the advertisements in order to test the advertisements I recommend you to add a button that will call the function import TMP Essentials now I will speed up the process just to move that button to the center in every button that will make every function for loading or removing the ads simply go to onclick click plus and drag the ad try to press the button it works amazing now let's do the same with other kinds of ads the intial and rewarded ads need to have the same function instead of saying load add say show inter stal and for the reward Ed ad simply say show rewarded ad now try to play and see Banner ad Works wow the interal ad nicely done and reported it looks great but when you export this game you won't see these screens you need to use the test ID this is the last time I will say it in this video before publishing change the IDS to the publishing IDs that you generated in admob I will put the full description and the full tutorial on my cosmobot website so you could read the detailed explanation of every part of the video I will be making more tutorials in the future so have a good day
Info
Channel: Kozmobot Games
Views: 624
Rating: undefined out of 5
Keywords: unity, unity tutorial, c# unity, unity c# tutorial, unity ads, ads in unity, admob unity tutorial, admob tutorial unity, admob ads in unity, ads in unity 2022, unity 2022, unity 2022 ads, ads unity tutorial, advertisements in unity, ads tutorial in unity, admob unity, admob tutorial in unity 2022, ads admob, ads admob tutorial, admob tutorial
Id: 3H9GfW7logE
Channel Id: undefined
Length: 9min 3sec (543 seconds)
Published: Mon Jun 03 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.