Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Can we use both unity ads and admob in one project?

Discussion in 'Unity Ads & User Acquisition' started by Ujjawal49, Aug 22, 2020.

  1. Ujjawal49

    Ujjawal49

    Joined:
    Apr 26, 2018
    Posts:
    35
    Hello everyone, I have a question :- can we use both admob and unity ads in one project? For example :- the first priority will always be admob but if the ad gets failed to load then I'll request unity ads to show an ad. I want to do this because only 40-50% of requests are converted to Impressions in admob in my account but I want all those requests as impressions.
    even I implemented it and it's working fine in the editor but I can't build the game. At the time of building I gets an error "one exception was raised by workers see console for details" the error in the console basically says that there is a duplicate class of com.unity3d.ads.
    is it because of importing both unity ads and admob in one project? Please help
     
  2. rasmus-unity

    rasmus-unity

    Moderator

    Joined:
    Aug 15, 2014
    Posts:
    1,312
    Hi, sorry for bit of delay.

    Are you using mediation feature of AdMob (https://developers.google.com/admob/android/mediate)? Mediation is basically what you describe, i.e. implement multiple advertising networks and fall back ("waterfall" is the industry term) to other networks, in case on cannot fill.

    /Rasmus
     
  3. Ujjawal49

    Ujjawal49

    Joined:
    Apr 26, 2018
    Posts:
    35
    No I am not using mediation but I was reading about it yesterday but I have one question about it. Let's say my game requests for an ad to admob and for some reason the ad gets failed to load then will admob show the unity ad if I implemented it's mediation?
    Thanks for the reply though.
     
  4. kyle-unity

    kyle-unity

    Unity Technologies

    Joined:
    Jan 6, 2020
    Posts:
    336
    Hey, unfortunately right now it isn't possible to use AdMob with Unity Ads enabled and the standard Unity Ads SDK in a project at the same time. The reason is that the AdMob SDK with the Unity Ads adapter included actually already contains a copy of the Unity Ads SDK.

    This is why you're getting a duplicate class error - your project is trying to compile the same code twice from two different sources.
     
  5. Ujjawal49

    Ujjawal49

    Joined:
    Apr 26, 2018
    Posts:
    35
    Hello and thanks for the reply. I am using admob mediation now and everything seems to work fine.
     
    wanrclhnyd likes this.
  6. markknoffer

    markknoffer

    Joined:
    Dec 20, 2020
    Posts:
    23
    hi,
    is this already fixed and working?

     
  7. kyle-unity

    kyle-unity

    Unity Technologies

    Joined:
    Jan 6, 2020
    Posts:
    336
    There are two things that are acting as blockers here:
    • Projects cannot be compiled with duplicate code
    • The AdMob SDK includes Unity Ads SDK code
    Unfortunately, there is not much Unity can do to resolve this, as the source of the problem is ultimately because of the AdMob SDK.
     
  8. RaventurnStefan

    RaventurnStefan

    Joined:
    Aug 1, 2012
    Posts:
    44
    Having the same problem right now, but can't you just delete the Unity Ads from the iPods?:

    Code (CSharp):
    1. <!--  <iosPods>-->
    2. <!--    <iosPod name="GoogleMobileAdsMediationUnity" version="3.6.0.0">-->
    3. <!--      <sources>-->
    4. <!--        <source>https://github.com/CocoaPods/Specs</source>-->
    5. <!--      </sources>-->
    6. <!--    </iosPod>-->
    7. <!--  </iosPods>-->

    For me it compiled, but I don't know whether admobs mediation with unity is still working properly.
     
  9. ap-unity

    ap-unity

    Unity Technologies

    Joined:
    Aug 3, 2016
    Posts:
    1,520
    matronator likes this.