Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
ads load and impressions — Gideros Forum

ads load and impressions

piepie Member
edited November 2015 in General questions
Hi, I am trying ads for the first time and I have some questions:

Is there something "wrong" in preloading every ad and then show/hide one or the other depending on screen requirement?

Once the ad is loaded do I need to reload it in order to update it?
Will this count as a new impression? (is there any advantage in having more impressions? )

Thank you :)

Comments

  • ar2rsawseenar2rsawseen Maintainer
    Accepted Answer
    I think thats the common strategy
    on game start load all needed ads, then show them when needed,
    and once showed, load them again, so you would always have something to show
  • simwhisimwhi Member
    Accepted Answer
    @pie As soon as an interstitial ad is shown I always preload a new one for the next time. Banner ads are refreshed every x seconds (60 seconds).
  • Thank you for your answers, after some tests I have another question :)

    How should I handle v4vc content response if user turns off his connection while the game is running?

    I am rewarding some powerups after a v4vc:

    Since I am preloading my v4vc video, if internet is on I have Ads (it has been initialized, and maybe it has some content to show too) but if I turn off internet after the game is started I don't get any event upon calling showAd (nor the ad itself) - so my "reward function" keeps hanging on what to do.

    I thought I could check internet connection by loading a known url before showing Ad, however it's not really fast to check everytime.
    It would be better if I could check if Ads("v4vc", "rewarded") is true or false before trying to show it, is this possible?

    Thank you
  • @pie I have a very similar issue. We pay reward coins after showing a v4vc ad. It would be great to know if an ad has loaded and if the internet is available using some built in Gideros functions. I use a kludgy system where I check the internet connection periodically.
  • Sorry, I don't get the problem.
    There are AD_DISPLAYED event to dispatch when ad is displayed and AD_DISMISSED when ad stopped showing.

    Also for ads that support v4vc natively, like AdColony, etc, AD_ACTION_END will be dispatched when you actually need to reward user (for watching video whole video, etc)
  • @ar2rsawseen All the events that you mentioned in your post work great when the network connection is good, but when simulating a very bad connection no events are fired at all / or for a long time. It would be great to be able to determine the stability of the network connection before trying to show a reward ad / other ad.

    Perhaps I'm missing something here. Is there a way to abort a failed/slow ad and return to Lua code after passing control to the ads plugin. It would be nice to have some timeout or similar.
  • You can just make a http request to google in order to check network connection. It will fail if there isnt any internet connection.
  • @ar2rsawseen as @simwhi said AD_xxx events work perfect with an active internet connection or no connection at all (these are bypassed directly), but in my tests these are no longer dispatched if network goes down after game init (after Ads init).

    I don't know exactly how Ads are managed, but since Ads seems to "know" if internet is down (banners stop showing instantly), could we get this info from it?

    A method to check if an ad is true or not or Ads:isConnected() - return boolean -method would be enough.

    @mertocan I did it, but the response time is a bit slow - at least with urlloader. It's not something we can check seamlessly in "real time".

    Thank you very much :)
  • @mertocan I have employed this method too. @pie I think that would be a simple solution.
  • ar2rsawseenar2rsawseen Maintainer
    edited November 2015
    Firstly, what I meant is credit v4vc on those callbacks, if those callbacks are not called, obviously, don't credit, so I still don't see a problem there.

    But about internet connection specifically, then on each load/showAd AdsInterface checks for internet connection automatically and dispatches AD_FAILED if there is no internet connection:

    https://github.com/gideros/gideros/blob/master/plugins/ads/source/Android/src/com/giderosmobile/android/plugins/ads/Ads.java#L319-L324

    That has worked for me and I have used it in my games

    Implemented it after I think admob bug, where it would crash if there was no internet connection :)
  • Thank you @ar2rsawseen, I don't seem to get the AD_FAILED if internet is off.
    Maybe it's my fault, but I get it if internet is available.
    I used the plugin files in gideros 2015.09 installation directory, I will try taking them from github. Thanks again
  • @ar2rsawseen @pie. Me neither. We have been testing on iOS for a few days now and we never get an AD_FAILED. In the iOS developer tools we can simulate a bad internet connection. All my coin crediting is done in the ad manager after the ad is server, so no problem there for us.

    I'll check my code. Many thanks.
  • Hmm, ok, I was sure about Android, but not sure about iOS.

    But after checking code, I can see there is the same thing:
    https://github.com/gideros/gideros/blob/master/plugins/ads/source/iOS/Plugins/Ads/AdsClass.mm#L78-L83

    Maybe somthing is not working anymore, like for specific os version, etc?

    Can you guys provide more details on devices you are testing it with?
  • Sure, @ar2rsawseen I am doing it on Android 4.1 on galaxy s2 and sm-t805, the first with custom rom, the other stock
  • @ar2rsawseen iPhone 4, (iOS 7), iPad Air 2 (iOS 9), Huawei P6 LTE (Android 5.0).
  • piepie Member
    edited November 2015
    @simwhi @ar2rsawseen maybe I can define better my issue:

    I actually get one event, but not the one I was waiting for (from v4vc).
    My preloading banners in the background are faster to fail than the v4vc, and somehow this prevents v4vc to cast its own events (banners are admob and v4vc is chartboost).

    After the first banner AD_FAILED (due to wifi off) I don't get any event from v4vc - one should be dispatched when I ask to showAd("v4vc") instead I get nothing from it. However, I still get ad_failed events from the first banner anytime my updateloop tries to reload banners.
    And I get the correct events from v4vc if I completely remove banners, so the syntax there is fine. :-B


    Thank you :)
  • @ar2rsawseen @pie I will conduct a few experiments too and report back. I also use admob for banners, but I use applovin for v4vc ads.
Sign In or Register to comment.