In-app advertising

Hello!

Which advertising provider to choose and how to integrate advertising into the application? (a small banner during the game at the bottom of the screen and a full-screen banner when losing)

I will be grateful for any articles and advice)

PS I’m especially interested in code examples, because I’m new to this area and this is my first application)

Note, my usual suggestion is to not include ads. If you’re just learning game development, it shouldn’t be about money.

There is no one-size fits all answer for this otherwise there would be just one advertising network.

I’m afraid you have to research which network to choose on your own from the list of supported networks:

https://docs.coronalabs.com/plugin/index.html#ads-monetization

Additionally, what type, how, and when to show ads is a ever changing target. 

Just go with Banner ads if you don’t know how to approach researching this, or …

… spend the weeks and months researching this and watching how successful companies do it and how they change their strategy over time.  

If you absoltely must add ads, and if: 

  • you have no budget, then I’d use one of the free plugins like: Applovin Free, Revmob, or Vungle.  These are all easy to use.
  • you have a budge, hire someone to make your ad frame for you.

Note, my usual suggestion is you not include ads. If you’re just learning game development, it shouldn’t be about money.

@roaminggamer - Thank you for your answer)

Yes, I understand that the first application should not include ads, but the game turned out to be a good time killer. I do not want to turn it into rubbish and show hundreds of banners, killing the desire to play, enough 1-2 banners without video.

I got on the idea and gave it 14-16 hours a day for a month studying Lua and Corona SDK, it is rather difficult to cope with the language barrier :unsure: (my native language is russian). I think that my efforts are worth something)

I was interested in Appodeal. Is it free? How difficult is it to set it up?

Haven’t used Appodeal, I don’t know what effort will be involved.  That said, it is the parent company so sure use that if you want.

I still suggest just banner at bottom or top. 

As you are new, I think you’ll find coding up control code to ONLY show interstitial or video on certain intervals and at certain places to be a bit of a challenge. 

( Note: It isn’t my intent to be insulting here.  It is just that I’ve seen folks stumble time and time again trying to code up the ads part of their app.  It isn’t hard, but it does require a clear understanding of listeners, events, scope, …, composer.* or your own scene management code, …  )

Once you choose a provider, simply follow the docs ( They have all the instructions and examples you need to get basic ads running.

In case you have your heart set on ads, and more than just banner ads, this is basically how I approach ad code.

I find that many developers get very confused about how to write the listener and then how to ‘hook it into their game’.  Many hard-code all the connections and that is (IMHO) wrong.

I connect the listener to my game via a second layer of custom events.  I do this with a custom Ad module.  It generally has these parts:

  • init()
  • Listener with hooks to generate events.
  • enable/disable functions to enable/disable specific actions.
  • show/hide helpers or listeners to show and hide ads using the current provider.  

I know this probably sounds confusing, but essentially what this does is allow me to put all my ad code in one place and then selectively choose what it does when I need it.

Then, later I can access the module from main, my scenes, etc. and init(), enable events to reward the user, request an ad, hide ads, etc.  

Sorry, if this still doesn’t make sense, but its the best I can do right now. :confused:

PS - Another way to handle it is like a state-machine where the states are changed as the result of:

  • listener events and conditions
  • function calls to the module

Please post back and let me know what ad network you decide to go with.  I’m very interested.

The networks I have direct experience with coding for are:

  • adMob
  • applovin
  • inMobi
  • MediaBrix
  • RevMob
  • Vungle 4 and 5

One more note.  You asked if Appodeal is free.

All of the ad plugin docs tell you if the plugin is free or a paid.

https://docs.coronalabs.com/plugin/index.html#ads-monetization

For example: 

@roaminggamer - I decided to use only the banner from the bottom, but I still find it difficult to choose a network.

I’ll start using AdMob as soon as I can buy a plugin. But now I choose Applovin.

Can you help with the installation of Applovin? I looked at the examples, but the first time this is quite difficult for me. I am sure that in the future I will not have any more questions and I will be able to understand this myself, based on this example.

Fortunately for you, applovin is one of the easiest to use.

  1. Start here: https://docs.coronalabs.com/plugin/applovin/index.html

  2. Follow registration link and set up your account on the developer portal.

  3. Set up an ad campaign for your game in the Portal (I can’t help you with this right now).

This is where you get the SDK KEY   for your game to advertise with.

  1. Go back to corona docs and make sure your build.settings file is set up right: https://docs.coronalabs.com/plugin/applovin/index.html#project-settings

  2. Read the init() docs: https://docs.coronalabs.com/plugin/applovin/init.html

For now, in main.lua do this:

local applovin = require( "plugin.applovin" ) local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization print("GOT INIT") local tmp = display.newText( "GOT INIT", display.contentCenterX, display.contentCenterY ) tmp.enterFrame = tmp.toFront -- FORCE TO TOP EVERY FRAME Runtime:addEventListener("enterFrame", tmp) end if(event.error) then for k,v in pairs( event ) do print( "applovin listener got error ", k, v) end end end -- Initialize the AppLovin plugin applovin.init( adListener, { sdkKey="YOUR\_SDK\_KEY" } )

 Replace YOUR_SDK_KEY with SDK key from your account.

  1. Build the game and install it on your test device.

  2. Run it.  If  your init code works, you’ll get a message in your log and the text object should be showing on the screen.

If you don’t see the init message, look at your device logs for an error.

  1. Assuming you got the init message, now change the listener code to this:

    local function adListener( event ) if ( event.phase == “init” ) then – Successful initialization print(“GOT INIT”) applovin.show( “banner”, “bottom” ) – bottom or top you choose end if(event.error) then for k,v in pairs( event ) do print( "applovin listener got error ", k, v) end end end

@roaminggamer - Thank you so much! This is a huge help!

A good deed is never lost)

Note, my usual suggestion is to not include ads. If you’re just learning game development, it shouldn’t be about money.

There is no one-size fits all answer for this otherwise there would be just one advertising network.

I’m afraid you have to research which network to choose on your own from the list of supported networks:

https://docs.coronalabs.com/plugin/index.html#ads-monetization

Additionally, what type, how, and when to show ads is a ever changing target. 

Just go with Banner ads if you don’t know how to approach researching this, or …

… spend the weeks and months researching this and watching how successful companies do it and how they change their strategy over time.  

If you absoltely must add ads, and if: 

  • you have no budget, then I’d use one of the free plugins like: Applovin Free, Revmob, or Vungle.  These are all easy to use.
  • you have a budge, hire someone to make your ad frame for you.

Note, my usual suggestion is you not include ads. If you’re just learning game development, it shouldn’t be about money.

@roaminggamer - Thank you for your answer)

Yes, I understand that the first application should not include ads, but the game turned out to be a good time killer. I do not want to turn it into rubbish and show hundreds of banners, killing the desire to play, enough 1-2 banners without video.

I got on the idea and gave it 14-16 hours a day for a month studying Lua and Corona SDK, it is rather difficult to cope with the language barrier :unsure: (my native language is russian). I think that my efforts are worth something)

I was interested in Appodeal. Is it free? How difficult is it to set it up?

Haven’t used Appodeal, I don’t know what effort will be involved.  That said, it is the parent company so sure use that if you want.

I still suggest just banner at bottom or top. 

As you are new, I think you’ll find coding up control code to ONLY show interstitial or video on certain intervals and at certain places to be a bit of a challenge. 

( Note: It isn’t my intent to be insulting here.  It is just that I’ve seen folks stumble time and time again trying to code up the ads part of their app.  It isn’t hard, but it does require a clear understanding of listeners, events, scope, …, composer.* or your own scene management code, …  )

Once you choose a provider, simply follow the docs ( They have all the instructions and examples you need to get basic ads running.

In case you have your heart set on ads, and more than just banner ads, this is basically how I approach ad code.

I find that many developers get very confused about how to write the listener and then how to ‘hook it into their game’.  Many hard-code all the connections and that is (IMHO) wrong.

I connect the listener to my game via a second layer of custom events.  I do this with a custom Ad module.  It generally has these parts:

  • init()
  • Listener with hooks to generate events.
  • enable/disable functions to enable/disable specific actions.
  • show/hide helpers or listeners to show and hide ads using the current provider.  

I know this probably sounds confusing, but essentially what this does is allow me to put all my ad code in one place and then selectively choose what it does when I need it.

Then, later I can access the module from main, my scenes, etc. and init(), enable events to reward the user, request an ad, hide ads, etc.  

Sorry, if this still doesn’t make sense, but its the best I can do right now. :confused:

PS - Another way to handle it is like a state-machine where the states are changed as the result of:

  • listener events and conditions
  • function calls to the module

Please post back and let me know what ad network you decide to go with.  I’m very interested.

The networks I have direct experience with coding for are:

  • adMob
  • applovin
  • inMobi
  • MediaBrix
  • RevMob
  • Vungle 4 and 5

One more note.  You asked if Appodeal is free.

All of the ad plugin docs tell you if the plugin is free or a paid.

https://docs.coronalabs.com/plugin/index.html#ads-monetization

For example: 

@roaminggamer - I decided to use only the banner from the bottom, but I still find it difficult to choose a network.

I’ll start using AdMob as soon as I can buy a plugin. But now I choose Applovin.

Can you help with the installation of Applovin? I looked at the examples, but the first time this is quite difficult for me. I am sure that in the future I will not have any more questions and I will be able to understand this myself, based on this example.

Fortunately for you, applovin is one of the easiest to use.

  1. Start here: https://docs.coronalabs.com/plugin/applovin/index.html

  2. Follow registration link and set up your account on the developer portal.

  3. Set up an ad campaign for your game in the Portal (I can’t help you with this right now).

This is where you get the SDK KEY   for your game to advertise with.

  1. Go back to corona docs and make sure your build.settings file is set up right: https://docs.coronalabs.com/plugin/applovin/index.html#project-settings

  2. Read the init() docs: https://docs.coronalabs.com/plugin/applovin/init.html

For now, in main.lua do this:

local applovin = require( "plugin.applovin" ) local function adListener( event ) if ( event.phase == "init" ) then -- Successful initialization print("GOT INIT") local tmp = display.newText( "GOT INIT", display.contentCenterX, display.contentCenterY ) tmp.enterFrame = tmp.toFront -- FORCE TO TOP EVERY FRAME Runtime:addEventListener("enterFrame", tmp) end if(event.error) then for k,v in pairs( event ) do print( "applovin listener got error ", k, v) end end end -- Initialize the AppLovin plugin applovin.init( adListener, { sdkKey="YOUR\_SDK\_KEY" } )

 Replace YOUR_SDK_KEY with SDK key from your account.

  1. Build the game and install it on your test device.

  2. Run it.  If  your init code works, you’ll get a message in your log and the text object should be showing on the screen.

If you don’t see the init message, look at your device logs for an error.

  1. Assuming you got the init message, now change the listener code to this:

    local function adListener( event ) if ( event.phase == “init” ) then – Successful initialization print(“GOT INIT”) applovin.show( “banner”, “bottom” ) – bottom or top you choose end if(event.error) then for k,v in pairs( event ) do print( "applovin listener got error ", k, v) end end end

@roaminggamer - Thank you so much! This is a huge help!

A good deed is never lost)