FAN - event.phase == "failed", should we call load again?

local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization print( event.isError ) -- Load a banner ad fbAudienceNetwork.load( "banner", placementID, "BANNER\_HEIGHT\_50" ) elseif ( event.phase == "loaded" ) then -- The ad was successfully loaded print( event.type ) print( event.placementId ) fbAudienceNetwork.show( event.type, event.placementId, { yAlign="bottom" } ) elseif ( event.phase == "failed" ) then -- The ad failed to load print( event.type ) print( event.placementId ) print( event.isError ) print( event.response ) fbAudienceNetwork.load( "banner", placementID, "BANNER\_HEIGHT\_50" ) -- yes or no ? end end

If we get the event.phase == “failed”, should we call again fbAudienceNetwork.load inside this event?

Or will facebook try to server ads every N seconds as defined when creating the ad?

Same question for “loaded” phase.

Is one “show” enough and the ads will be swapped every N seconds?

Or do we have to call a new “load” inside “loaded”?

What was the reason for the fail?

“No Fill” - obviously there were no ads to serve.

All the above questions remain.

No advertiser is going to want you to show repeated ads. For banners 30 seconds is considered the fastest you should show a new ad and they would like more time where reasonable. Interstitial should only come one at a time.

I would on the loaded phase call .show() for your banners. Or you can .show() then call .load() afterwards to prefetch the next ad. For interstitials, you would want to control when you show it. But it wouldn’t hurt to immediately call load afterwards or wait until the user closes or interacts with the ad.

If you get no inventory, you likely won’t have inventory if you call load immediately. I would suggest waiting 25-30 seconds before calling the ad again, or fail over to a backup network.

Rob

Hi @ubj3d.android,

I think in case of a “failed” event phase, it’s fine to call load() again, but I wouldn’t just repeat the same placement ID as the one that failed… consider using an alternative placement ID and see if that gets loaded correctly.

In my testing, I see no evidence that one show() will yield a repeating set of ads. I suggest you call load() each time you want to preload an ad, followed (obviously) by show(), then hide() when you’re done.

That being said, I would not suggest calling load() in the “loaded” phase, as that’s basically just loading an ad, then loading another, then loading another, then loading another, and so on (you may even get yourself in an endless cycle doing that). Instead, I would call a subsequent load() during the “closed” phase OR following a call to hide() so that another ad is preloaded after the previous one is closed/hidden.

Take care,

Brent

Thank you for trying to help. I understand the basic concept of ads as I have tried almost every provider on the market (when I was developing in native Java).

For banners you can set the refresh interval in the dashboard, same is for FAN.

I use the value of 120 s.

What seems different in FAN (from my initial testing) is the behavior after error.

From what I am used, if there is an error (e.g. NO FILL), the cycle doesn’t stop, the next ad will be shown after N seconds (from the dashboard) or again error is raised.

In FAN it seems once the error is raised the cycle is over and you have to call “load” again to start it.

Not sure about it, maybe someone will clarify it.

Hey Ubj3d. The reason it works this way is that once an Ad fails to load, it fails. It won’t try to load it again because you, the Corona developer are in full control over the loading process.

This is also done because of other reasons, such as if an Ad fails to load due to a network error, it would be a waste of resources to keep trying to load it. If an Ad fails because of no-fill, again the same applies. Perhaps the fill for the users location is low or none-existent, again continuing to automatically reload it at the plugin end would take control away from you.

The goal of the plugin is to give you full control over the load/show process, as you can see.

Hope this clears things up for you.

Thanks

Hi Danny,

thank you for confirming my findings. Yes, that is the better behavior. We can better control ad mediation (for the NO FILL error).

Btw. I am one of your customers while you had your company (Kiip plugin).

You also had the PayPal plugin, right? 

It would be AWESOME if we could get it for desktop apps, so we could monetize Windows games.

Any chance?

You are most welcome.

I’m the same guy who made those for sure. 

At the present time, Facebook only provide their advertisement SDK for mobile (just iOS and Android). If they provide an SDK for desktop at some stage, I would most certainly be up for supporting that :slight_smile:

In fact, I was asking if we could get the PayPal plugin for Windows.

Since, you already made it for Android and iOS, guess it is a peace of cake for you to make it :slight_smile:

And for FAN on Windows, once webview will work on Windows desktop, we could use that right?

FAN is available for web.

What was the reason for the fail?

“No Fill” - obviously there were no ads to serve.

All the above questions remain.

No advertiser is going to want you to show repeated ads. For banners 30 seconds is considered the fastest you should show a new ad and they would like more time where reasonable. Interstitial should only come one at a time.

I would on the loaded phase call .show() for your banners. Or you can .show() then call .load() afterwards to prefetch the next ad. For interstitials, you would want to control when you show it. But it wouldn’t hurt to immediately call load afterwards or wait until the user closes or interacts with the ad.

If you get no inventory, you likely won’t have inventory if you call load immediately. I would suggest waiting 25-30 seconds before calling the ad again, or fail over to a backup network.

Rob

Hi @ubj3d.android,

I think in case of a “failed” event phase, it’s fine to call load() again, but I wouldn’t just repeat the same placement ID as the one that failed… consider using an alternative placement ID and see if that gets loaded correctly.

In my testing, I see no evidence that one show() will yield a repeating set of ads. I suggest you call load() each time you want to preload an ad, followed (obviously) by show(), then hide() when you’re done.

That being said, I would not suggest calling load() in the “loaded” phase, as that’s basically just loading an ad, then loading another, then loading another, then loading another, and so on (you may even get yourself in an endless cycle doing that). Instead, I would call a subsequent load() during the “closed” phase OR following a call to hide() so that another ad is preloaded after the previous one is closed/hidden.

Take care,

Brent

Thank you for trying to help. I understand the basic concept of ads as I have tried almost every provider on the market (when I was developing in native Java).

For banners you can set the refresh interval in the dashboard, same is for FAN.

I use the value of 120 s.

What seems different in FAN (from my initial testing) is the behavior after error.

From what I am used, if there is an error (e.g. NO FILL), the cycle doesn’t stop, the next ad will be shown after N seconds (from the dashboard) or again error is raised.

In FAN it seems once the error is raised the cycle is over and you have to call “load” again to start it.

Not sure about it, maybe someone will clarify it.

Hey Ubj3d. The reason it works this way is that once an Ad fails to load, it fails. It won’t try to load it again because you, the Corona developer are in full control over the loading process.

This is also done because of other reasons, such as if an Ad fails to load due to a network error, it would be a waste of resources to keep trying to load it. If an Ad fails because of no-fill, again the same applies. Perhaps the fill for the users location is low or none-existent, again continuing to automatically reload it at the plugin end would take control away from you.

The goal of the plugin is to give you full control over the load/show process, as you can see.

Hope this clears things up for you.

Thanks

Hi Danny,

thank you for confirming my findings. Yes, that is the better behavior. We can better control ad mediation (for the NO FILL error).

Btw. I am one of your customers while you had your company (Kiip plugin).

You also had the PayPal plugin, right? 

It would be AWESOME if we could get it for desktop apps, so we could monetize Windows games.

Any chance?

You are most welcome.

I’m the same guy who made those for sure. 

At the present time, Facebook only provide their advertisement SDK for mobile (just iOS and Android). If they provide an SDK for desktop at some stage, I would most certainly be up for supporting that :slight_smile:

In fact, I was asking if we could get the PayPal plugin for Windows.

Since, you already made it for Android and iOS, guess it is a peace of cake for you to make it :slight_smile: