Android Question Mediated Adverts with Admob - Control

Discussion in 'Android Questions' started by chris ash, May 18, 2019.

  1. chris ash

    chris ash Member Licensed User

    Hi guys

    I may be missing something pretty simple here but I need help...

    So I have been trying to use ad mediation through AdMob for quite some time with little success. Anyway owing to appalling fill rates I thought I will give it a go. The network of choice was Tappx. So using a mixture of the previous posts I have made good progress.

    I now use pretty much the standard implementation of AdMob. With additions to the manifest editor

    Code:
    '************ Tappx (Start) *****************
    CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
    AddPermission(android.permission.INTERNET)
    AddPermission(android.permission.ACCESS_NETWORK_STATE)
    AddApplicationText(
    <!-- Tappx Activities -->
    <
    activity
        android:name=
    "com.tappx.sdk.android.AdActivity"
        android:configChanges=
    "keyboardHidden|orientation|screenSize" />
    <
    activity
        android:name=
    "com.tappx.sdk.android.InterstitialAdActivity"
        android:configChanges=
    "keyboardHidden|orientation|screenSize"
        android:theme=
    "@style/Transparent" />
    <
    activity
        android:name=
    "com.tappx.sdk.android.VideoAdActivity"
        android:configChanges=
    "keyboardHidden|orientation|screenSize" />

    <
    service android:name="com.tappx.sdk.android.TrackInstallIntentService" />

    <!-- AdActivity from Google Play Services,, needed by Tappx -->
    <
    activity
        android:name=
    "com.google.android.gms.ads.AdActivity"
                android:configChanges=
    "keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
        android:theme=
    "@android:style/Theme.Translucent" />

    <receiver
            android:name=
    "com.tappx.sdk.android.TrackInstallReceiver"
            android:exported=
    "true">
        <
    intent-filter>
            <action android:name=
    "com.android.vending.INSTALL_REFERRER"/>
        </
    intent-filter>
    </receiver>
    )
    '************ Tappx (End) *****************
    I have then added the additional lines

    Code:
    #AdditionalJar: tappx-sdk-3.1.3.aar
        
    #AdditionalJar: com.google.android.gms:play-services-ads
    This is all pretty much as per the guides... and the great news is when I run the app I either get an Admob ad or a Tappx one.

    So... Then it comes to using the adverts and my observation is that when you load the ad the Ad_ReceiveAd sub is run whether the loaded ad is Admob or Tappx...

    However, when the ad is a Tappx ad other subs such as Ad_AdScreenDismissed, Sub ad_presentscreen do not fire when they should which currently limits my ability to control the flow of the app. When the ad is Admob the subs fire exactly as they always have and should. It is only on the Mediated Tappx ad's where this does not work :-(

    So the question is guys what am I missing. If you need to know anything more from me please just ask.

    Thanks in advance for any assistance

    Chris
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Where is the relevant code?
     
  3. chris ash

    chris ash Member Licensed User

    Hi @Erel

    Is this what you needed?

    Thanks in advance for any assistance

    Chris
     

    Attached Files:

  4. Erel

    Erel Administrator Staff Member Licensed User

    Your code looks correct.

    Check the logs including the unfiltered logs and see whether there is any relevant message (maybe something like event sent to a background queue).
     
  5. chris ash

    chris ash Member Licensed User

    Hi again @Erel

    I have taken a look for what you described but cannot find anything of that nature.

    So taking it one step further I thought why not try Tappx separate and non mediated within the app, that should work as there are a few people that have been discussing how this works. So I have set this up too. See the attached zip file this has the AdMob version and the Tappx version below it.

    The AdMob version as before doesn't run the ad_present or dismissed subs

    The TappX doesn't bother running the ad_event sub either, showing this error

    Code:
    Ignoring event: ad_event
    Again any help with how to get this working by either method would be greatly appreciated.

    Chris
     

    Attached Files:

  6. Erel

    Erel Administrator Staff Member Licensed User

    This can happen if the activity is paused when the event is raised.
    Do you think that this is the case here?

    You can move the listener object to the starter service:
    Code:
    Sub CreateListener (banner As JavaObjectAs Object
       
    Return banner.CreateEventFromUI("com.tappx.sdk.android.TappxBannerListener""ad"Null)
    End Sub
    Create it with:
    Code:
    Dim listener As Object = CallSub2(Starter, "CreateListener", banner)
     
  7. sorex

    sorex Expert Licensed User

    tappx doesn't use the events admob uses as there is no need to rely on something else so you need to create your own listeners.
    on their site the relevant info can be found to make your own class that handles everything you want with similar code as Erel posted above.

    mediation is usually slower and having less fill rate than when using the real deal (straight method) so it's a good choice to do it like that.
    the only good thing with mediation is the comparing ecpm values... IF it worked :)
    sometimes it needs weeks to update that value and then admob is usually better earning too as not being pay per install only.
    nothing as bad as leading all traffic to an ad provider with a high ecpm and not getting 1 install in the end.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice