#Mediation help please needed to Admob

1 messages · Page 1 of 1 (latest)

vivid gust
#

you mentioned this:

We allow mediation configuration via the ad networks tools only.
For ex:
Scenario 1: Let's say you want to add AdMob alone.
Fill in the app id and ad unit ids in our settings.

Scenario 2: Let's say you want to add AdMob with any mediation.
Fill in the app id and ad unit ids in our settings.
Configure your mediation related things in the AdMob(or related Ad network) plugin inspector.

There are no special steps if you use mediation or not w.r.t to Ads Kit. It controls the AdNetwork which can have mediation or no mediation.

i want to do scenario 2
i having a few questions:

  1. what is the "plugin inspector" you mentioned? is this in ads kit or the admob web browser dashboard?
  2. im migrating from gley, do i remove the old "GoogleMobileAds" plugin/package? because in your guide video you didn't install anything else but the ads kit
  3. i watched a tutorial, if i want admob with apploving adapter mediation i have to import another package which can be done through openupm
    so am i right to say for admob mediation i will need to import ads kit unity package and the applovin adapter mediation pacakge from openupm? admob sdk package is already bundled with ads kit so it's not needed right?
#

@dusky meadow sorry if basic questions 🥹

vivid gust
#

i dont think it's an easy migration......

#

this is my current code:

    //----------------------------------------------------------------
    /// <summary>
    /// Button click function.
    /// </summary>
    public void ShowFreeGemsRewardedVideo()
    {
        // First reward of the day is free.
        if (dailyGemsRewardedVideoWatched == 0) FreeGemsRewardedVideoWatched(true);
        else
        {
            if (freeGemsButtonDisabled == true)
            {
                AlertPopupsManager.Instance.ToastMessage($"Ads unavailable. Please wait a bit.", AlertPopupsManager.ToastStyles.Info);
                return;
            }
            // VoxelBusters.AdsKit.AdsManager.ShowAd(placementId); // < ----- HOW TO MAKE THIS SIMILAR TO THE LINE FROM GLEY BELOW??
            Gley.MobileAds.API.ShowRewardedVideo(FreeGemsRewardedVideoWatched);
        }

        ++dailyGemsRewardedVideoWatched;

        UpdateRewardedVideoButtons();
    }


    //----------------------------------------------------------------
    private void FreeGemsRewardedVideoWatched(bool completed)
    {
        if (completed)
        {
            WalletInventoryManager.Instance.AddCurrency(WalletInventoryManager.Instance.GemsCurrency, 30, WalletInventoryEventTypes.AddAnimated, true);
        }
    }

there is no callback similar to gley right? im stuck 🥹

dusky meadow
#

Ok, pls let me go through.

#
  1. Use the following at the top of your script
using VoxelBusters.AdsKit;
  1. Rewarded Video's reward callback timing is different on different ad networks. so we have two events in place (1. OnAdFinish, 2. OnAdReward)
     var operation = AdsManager.ShowAd(placementId);

      operation.OnAdFinish += (adContent) =>
      {
          OnFreeGemsRewardedVideoFinish();
      };

      operation.OnAdReward += ((AdContent adContent, AdReward adReward) data) =>
      {
          OnFreeGemsRewardedVideoReward(data.adReward);
      };
private void OnFreeGemsRewardedVideoFinish()
{
  Debug.Log("Video got closed");
}

private void OnFreeGemsRewardedVideoReward(AdReward reward)
{
   var amountToReward =  reward.IsRewardAmountAvailable() ? reward.Amount : 30;
   WalletInventoryManager.Instance.AddCurrency(WalletInventoryManager.Instance.GemsCurrency, 30, WalletInventoryEventTypes.AddAnimated, true);
}

#

Might look complex but more flexible and can do a lot more.

#

In step 2 -> We are taking the show operation into a variable and registering its callbacks. As the order of Ad close/finish event and Ad Reward event are not gaurenteed, there are two different events.

#

Also, Note that, the same code works for any ad type. For rewarded ads, OnAdReward gets invoked, for rest wont get invoked.

#

If you have any questions, happy to clarify.

vivid gust
#

thank you!! ill try it in a bit ❤️

#

what bout these questions:

vivid gust
#

i want to do scenario 2
i having a few questions:

  1. what is the "plugin inspector" you mentioned? is this in ads kit or the admob web browser dashboard?
  2. im migrating from gley, do i remove the old "GoogleMobileAds" plugin/package? because in your guide video you didn't install anything else but the ads kit
  3. i watched a tutorial, if i want admob with apploving adapter mediation i have to import another package which can be done through openupm
    so am i right to say for admob mediation i will need to import ads kit unity package and the applovin adapter mediation pacakge from openupm? admob sdk package is already bundled with ads kit so it's not needed right?
dusky meadow
#

what is the "plugin inspector" you mentioned? is this in ads kit or the admob web browser dashboard?
You need to follow this guide for adding applovin as mediation adapter to admob - https://developers.google.com/admob/unity/mediation/applovin

im migrating from gley, do i remove the old "GoogleMobileAds" plugin/package? because in your guide video you didn't install anything else but the ads kit
You can delete and download the latest one from github or keep it if its already up to date

i watched a tutorial, if i want admob with apploving adapter mediation i have to import another package which can be done through openupm
so am i right to say for admob mediation i will need to import ads kit unity package and the applovin adapter mediation pacakge from openupm? admob sdk package is already bundled with ads kit so it's not needed right?
Yes for most of it. For license reasons, we haven't included with ads kit package. We guide to download the admob package.

vivid gust
#

hii!!
i got back to working on this, took a break because i was overwhelmed lol
i need some help
i have this code:

            if (Gley.MobileAds.API.IsRewardedVideoAvailable())
            {
                FreeGold.SetProductData("", "Gold", $"{dailyGoldRewardedVideoLimit - dailyGoldRewardedVideoWatched}/{dailyGoldRewardedVideoLimit - 1}");
                freeGoldButtonDisabled = false;
            }
            else
            {
                FreeGold.SetProductData("", "Gold", "N.A.");
                freeGoldButtonDisabled = true;
            }

i've been trying to find something same in adskit but i cannot. how to check if a rewarded ad is available IsRewardedVideoAvailable?

vivid gust
#

i got it!!!
AdsManager.GetAdPlacementState("RewardedVideo") == AdPlacementState.Ready

vivid gust
#

i have a serious issue. why do i keep getting this?

vivid gust
# dusky meadow > what is the "plugin inspector" you mentioned? is this in ads kit or the admob ...

here you mentioned this link: https://developers.google.com/admob/unity/mediation/applovin
so i also followed: https://developers.google.com/admob/unity/quick-start

and i moved from using a .unitypackage to using open upm

also note that, both essential kit and ads kit provides the external dependency manager of version 1.2.186
when adding admob package from open upm (google admob v10.6.0) it comes bundled with external dependency manager v1.2.186
so i deleted the one that was added by essential kit and ads kit (will this be an issue?)

#

🥹

#

i cannot proceed because adskit say i dont have admob but it is there

dusky meadow
#

so i deleted the one that was added by essential kit and ads kit (will this be an issue?)
That's fine. No problem. Just have any one of those.

dusky meadow
#

Will that work for you meanwhile to progress?

#

If you need steps on resolving above, I can help you on what to do.

vivid gust
#

ok i understand
let me try to remove admob from upm and add it directly to assets
i'll let you know if there is issues

but quick question, if "For now drop using open upm as we check the path for admob existence at Assets/GoogleAdMob so its showing that dialog."
wont it be quicker for me to go in and edit the path?
when you update, it will overwrite my changes and it will still work right?

dusky meadow
#

whats your upm installed path?

vivid gust
#

erm.. let me check

#

here
which is
Packages/com.google.ads.mobile
Packages/com.google.external-dependency-manager

dusky meadow
dusky meadow
vivid gust
#

i understand
ok hang on let me trying

#

ok no more popup to install!

dusky meadow
#

Ok, thanks for updating. I need to make some changes to allow both 😄

vivid gust
#

np and yes!!

#

oh i see this just changes the path of the admob
for the external dependency manager it is fine?

dusky meadow
#

yes, i will find a fix for that as well.

vivid gust
#

ok but for now, since you provided the file fix above, is it safe to use open upm for production?

dusky meadow
#

Yes

vivid gust
#

thank you ❤️

vivid gust
#

i have another question
i am copying this https://adskit.voxelbusters.com/usage/sample-code/
but i have red squiggly line under my interface
when i let visual studio fix it, it creates this:

    public int CallbackOrder => throw new NotImplementedException();

what is this used for?

vivid gust
#

this section

#

i have this error:

#
ArgumentException: Exception thrown while retrieving localization data from C:/Users/JayH1V2/Downloads/Unity/GIT/dinosurvivor_clean/SurvivorClean/Assets\GoogleMobileAds/Editor\gma_settings_editor_localization_data.json: {ex:full}
GoogleMobileAds.Editor.EditorLocalization.InitLocalizationDataOrThrow () (at ./Library/PackageCache/[email protected]/GoogleMobileAds/Editor/EditorLocalization.cs:105)
GoogleMobileAds.Editor.EditorLocalization+<>c.<.ctor>b__12_0 () (at ./Library/PackageCache/[email protected]/GoogleMobileAds/Editor/EditorLocalization.cs:18)
System.Lazy`1[T].ViaFactory (System.Threading.LazyThreadSafetyMode mode) (at <1071a2cb0cb3433aae80a793c277a048>:0)
System.Lazy`1[T].ExecutionAndPublication (System.LazyHelper executionAndPublication, System.Boolean useDefaultConstructor) (at <1071a2cb0cb3433aae80a793c277a048>:0)
System.Lazy`1[T].CreateValue () (at <1071a2cb0cb3433aae80a793c277a048>:0)
System.Lazy`1[T].get_Value () (at <1071a2cb0cb3433aae80a793c277a048>:0)
GoogleMobileAds.Editor.EditorLocalization.GetLocalizationData () (at ./Library/PackageCache/[email protected]/GoogleMobileAds/Editor/EditorLocalization.cs:19)
GoogleMobileAds.Editor.EditorLocalization.ForKey (System.String key) (at ./Library/PackageCache/[email protected]/GoogleMobileAds/Editor/EditorLocalization.cs:51)
GoogleMobileAds.Editor.GoogleMobileAdsSettingsEditor.OnInspectorGUI () (at ./Library/PackageCache/[email protected]/GoogleMobileAds/Editor/GoogleMobileAdsSettingsEditor.cs:77)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass77_0.<CreateInspectorElementUsingIMGUI>b__0 () (at <4b8f645257c94d1296f440a10c6f388e>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
#

but i am able to add my app id in AdsKitSettings > Services > Admob no issues

dusky meadow
#

you don't need to enter any in the settings of google admob though.

#

delete this file once - gma_settings_editor_localization_data.json and try again resetting values in our admob settings of Ads Kit

vivid gust
#

ok so i just have to work with "AdsKitSettings > Services > Admob"
i can delete the google one right?

dusky meadow
#

what ever settings you set in our Ads Kit we update if required in the specific settings..

vivid gust
#

ok understood! thank you ❤️ 🫂

vivid gust
dusky meadow
#

Please share the interfaces you are implementing once?

vivid gust
vivid gust
vivid gust
#

sorry for another question

🚀 Currently Supported Ad Networks:
✅ Google AdMob [10.6.0]
✅ AppLovin [8.5.1]
✅ Unity Level Play [9.2.0]

i'm using google admob as my main. i wanting to add unity ads as mediation. is it supported?
because i read on forums, unity ads and unity level play is 2 different things

dusky meadow
#

you may need to install unity ads adapter provided by google admob

vivid gust
#

ok thank you 🥹

vivid gust
#

my game builds but it crashes every time when i open it 😨

vivid gust
#
[Contact AdsKit plugin support with your AdMob version. Exception: ] System.ArgumentNullException: Value cannot be null.
Parameter name: target
  at (wrapper managed-to-native) UnityEditor.EditorUtility.SetDirty(UnityEngine.Object)
  at VoxelBusters.AdsKit.Adapters.Editor.GoogleAdMobSettingsProxy.Save () [0x00000] in C:\Users\JayH1V2\Downloads\Unity\GIT\dinosurvivor_clean\SurvivorClean\Assets\Plugins\VoxelBusters\AdsKit\Generated\AdMob\Editor\GoogleAdMobSettingsProxy.cs:83 
  at VoxelBusters.AdsKit.Adapters.Editor.AdMobSettingsSyncer.Sync (System.String apiKey, System.String apiSecret) [0x00018] in C:\Users\JayH1V2\Downloads\Unity\GIT\dinosurvivor_clean\SurvivorClean\Assets\Plugins\VoxelBusters\AdsKit\Generated\AdMob\Editor\AdMobSettingsSyncer.cs:32 
  at VoxelBusters.AdsKit.Editor.AdNetworkSettingsSyncer.OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport report) [0x0004b] in C:\Users\JayH1V2\Downloads\Unity\GIT\dinosurvivor_clean\SurvivorClean\Assets\Plugins\VoxelBusters\AdsKit\Editor\Interfaces\AdNetworkSettingsSyncer.cs:36 
UnityEngine.Debug:LogError (object,UnityEngine.Object)
VoxelBusters.CoreLibrary.DebugLogger:LogException (string,System.Exception,UnityEngine.Object) (at Assets/Plugins/VoxelBusters/CoreLibrary/Runtime/CoreLibrary/Misc/DebugLogger.cs:106)
VoxelBusters.AdsKit.Editor.AdNetworkSettingsSyncer:OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport) (at Assets/Plugins/VoxelBusters/AdsKit/Editor/Interfaces/AdNetworkSettingsSyncer.cs:40)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

vivid gust
#

should i just delete openupm and add it directly into assets folder and try?

vivid gust
#

same issue....

#

i removed openupm

#

and added directed into assets

#

these are me versions

#

🥹

dusky meadow
#

Hi
Can you pls share your settings of AdMob in Ads Kit settings?

vivid gust
#

is it safe to share the ids here?

#

can i dm you the screenshots?

dusky meadow
#

Strip some chars

vivid gust
#

here the screenshots 🥹

vivid gust
#

oh and

#

im on unity 2022.3.62f2

dusky meadow
#

I will check it today. Are you available in an hour?

vivid gust
#

ok i have been spending a lot of time and i figured out the issue

#

but it causes another issue 🥹

#

so first thing

#

the issue was that...
i deleted old gley and google stuff > adskit was added > then i added the ids from gley > then i added google plugin
note that id was added before google plugin was added
so because of this, google settings asset was missing and the sycning did not work

#

so what i did before building is just created the google settings asset manually

#

before i was building the game without the google settings asset existing so the syncing was somehow failing?

#

you get what i mean?

dusky meadow
#

When you enter data in our settings, we internally update the Ad Mob settings file.

vivid gust
#

yes you are right, but the data was added before admob plugin was added

#

so i added the ids in ads kit without the admob plugin. then i added the admob plugin and built the game

#

that caused the issue because admob settings asset does not exists so the syncing was somehow failing

#

but now on to another issue...
is adskit force resolving when it is building the game?

dusky meadow
#

yes you are right, but the data was added before admob plugin was added
Ok, but it won't compile if Ad Mob plugin isn't added. May be you enabled the admob in our settings and instantly updated the settings before installing the admob plugin?

#

Possible?

#

is adskit force resolving when it is building the game?
No. EDMU should do it.

vivid gust
#

because before adskit was added, i had this:

            url (unityProjectPath + "/Assets/GeneratedLocalRepo/GoogleSignIn/Editor/m2repository") // Assets/GoogleSignIn/Editor/GoogleSignInSupportDependencies.xml:9

in my settingstemplate.gradle file
im using an old working google sign in auth so everytime after force resolve it changes to:

            url (unityProjectPath + "/Assets/GoogleSignIn/Editor/m2repository") // Assets/GoogleSignIn/Editor/GoogleSignInSupportDependencies.xml:9

and i have manually change it back to:

            url (unityProjectPath + "/Assets/GeneratedLocalRepo/GoogleSignIn/Editor/m2repository") // Assets/GoogleSignIn/Editor/GoogleSignInSupportDependencies.xml:9

it worked ok before adding adskit but now every time when i build the game it goes back to

            url (unityProjectPath + "/Assets/GoogleSignIn/Editor/m2repository") // Assets/GoogleSignIn/Editor/GoogleSignInSupportDependencies.xml:9
#

Ok, but it won't compile if Ad Mob plugin isn't added. May be you enabled the admob in our settings and instantly updated the settings before installing the admob plugin?
" May be you enabled the admob in our settings and instantly updated the settings before installing the admob plugin?"
yes this is the reason

dusky meadow
vivid gust
dusky meadow
#

Regarding settingsTemplate.gradle -> We don't touch it. Can you check once EDMU settings?

vivid gust
#

ok i tested it

#

using openupm also working fine after making the admob assets first before building

#

thank you @dusky meadow ❤️

vivid gust
#

sorry i have question

#

i set up mediation on admob dashboard already with unity ads bidding

#

in my unity project, i also imported the unity ads mediation adapter sdk

#

so do i have to do anything else in adskit settings to make the medication work?

#

*mediation

dusky meadow
#

We handle the integration with main ad-networks. Mediation is still configured as usual on how you setup without ads Kit.

#

In upcoming version, we are planning to have all automated by supporting even the mediation adapter installation too. This ways users can totally avoid touching settings other than Ads Kit Settings.

vivid gust
#

thank you so much ❤️

vivid gust
#

hihi

#

do you know what this mean?

AdsKit: Failed to load ad for placementId: RewardedVideo with error: Error Domain: AdError Code: 4 Description: No fill.