# Controlling when to display ads - CoronaAds, ChartBoost, AdColony

**URL:** <https://forums.solar2d.com/t/controlling-when-to-display-ads-coronaads-chartboost-adcolony/342418>\
**Category:** Monetization (in-app purchases, ads, etc.)\
**Created:** [December 16, 2016, 7:57am UTC](https://forums.solar2d.com/t/controlling-when-to-display-ads-coronaads-chartboost-adcolony/342418 "2016-12-16T07:57:29Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![ali.ayyaz3](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/a/b38774/32.png) [@ali.ayyaz3](https://forums.solar2d.com/u/ali.ayyaz3)\
**Post date:** [December 16, 2016, 7:57am UTC](https://forums.solar2d.com/t/controlling-when-to-display-ads-coronaads-chartboost-adcolony/342418/1 "2016-12-16T07:57:29Z")

</div>

Hi,&nbsp;

I’m using CoronaAds, Chartboost and AdColony in my app. I have written the initialize and show ads code in just 2 files (chapters screen + levels screen). When the scene changes, I hide the ads. this works fine in most cases, but i’ve got feedback that the ads are ruining the gameplay.

Then I added the ads.hide code to the gameplay file, but the problem persists. How can I ensure that the ads are shown on only the two selected scenes, and no where else?

---

<div class="post-metadata">

**Author:** ![ingemar\_cl](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/i/e19b73/32.png) [@ingemar\_cl](https://forums.solar2d.com/u/ingemar_cl)\
**Post date:** [December 16, 2016, 8:27am UTC](https://forums.solar2d.com/t/controlling-when-to-display-ads-coronaads-chartboost-adcolony/342418/2 "2016-12-16T08:27:47Z")

</div>

You’ll need to implement your own logic to handle the situation with multiple ad networks.

As a rule you can call load()as early as possible to make sure ads are available, but you should never call show() from the plugin’s event handlers.

---

<div class="post-metadata">

**Author:** ![ali.ayyaz3](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/a/b38774/32.png) [@ali.ayyaz3](https://forums.solar2d.com/u/ali.ayyaz3)\
**Post date:** [December 16, 2016, 12:48pm UTC](https://forums.solar2d.com/t/controlling-when-to-display-ads-coronaads-chartboost-adcolony/342418/3 "2016-12-16T12:48:46Z")

</div>

I dont quite understand what you mean by 'never call show() from the plugin’s event handlers"

Can you explain?

---

<div class="post-metadata">

**Author:** ![ingemar\_cl](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/i/e19b73/32.png) [@ingemar\_cl](https://forums.solar2d.com/u/ingemar_cl)\
**Post date:** [December 16, 2016, 12:54pm UTC](https://forums.solar2d.com/t/controlling-when-to-display-ads-coronaads-chartboost-adcolony/342418/4 "2016-12-16T12:54:24Z")

</div>

Example:

```
local function chartboostListener(event) if event.phase == "loaded" then if event.type == "interstitial" then chartboost.show("interstitial") end end end

```

That’s not recommended as it will display an ad as soon as it’s loaded.

---

<div class="post-metadata">

**Author:** ![christian.zoror](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/c/dbc845/32.png) [@christian.zoror](https://forums.solar2d.com/u/christian.zoror)\
**Post date:** [December 21, 2016, 9:13am UTC](https://forums.solar2d.com/t/controlling-when-to-display-ads-coronaads-chartboost-adcolony/342418/5 "2016-12-21T09:13:55Z")

</div>

Regarding your example I have a question:

At what point is repeated show() considered spam? Is it counted out of a minute?

For example would it be said that a banner refreshed each 20sec considered spam? Is there a thread on the forum relating this?

---

<div class="post-metadata">

**Author:** ![rob](https://forums.solar2d.com/user_avatar/forums.solar2d.com/rob/32/4_2.png) [@rob](https://forums.solar2d.com/u/rob)\
**Post date:** [December 21, 2016, 5:52pm UTC](https://forums.solar2d.com/t/controlling-when-to-display-ads-coronaads-chartboost-adcolony/342418/6 "2016-12-21T17:52:59Z")

</div>

Hi Christian.&nbsp;

Advertisers are not very fond of their ads being wasted. This is one of the reasons why no one does CPM (Cost Per Mille or per 1000 ads shown) campaigns any more. In the past, people set fast rotation times on ads to get the ad count up. This creates a poor user experience, slows down the network and eats through the advertisers inventory in a hurry. Advertisers realized they were not getting value from this.

Today most ads are a CPC (Cost Per Click) type campaign or CPA (Cost per acquisition or sometimes called CPI - Cost per Install). You get paid for clicks (or installs, conversion, getting new users). If you’re cycling ads every 20 seconds you’re not giving your user time to click on ads anyway. &nbsp;Banner ads during points of player action will never get clicked and you’re just burning through the ads and it’s not helping anyone: You, the advertiser or the player.

While I don’t know that you will find many vendors who state a limit, those that do may give you options of 30-60 seconds for auto rotation and this should be a good guideline of what’s acceptable. Put your banners in a part of your app that the user isn’t under pressure to interact with the app (i.e. time sensitive game play). A game like Angry Birds, you have plenty of time to interact with an ad, a tower defense game? Not so much. &nbsp;Leave them up long enough for the user to have an opportunity to see and interact with the ad.&nbsp;

Rob

---

<div class="post-metadata">

**Author:** ![christian.zoror](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/c/dbc845/32.png) [@christian.zoror](https://forums.solar2d.com/u/christian.zoror)\
**Post date:** [December 21, 2016, 7:07pm UTC](https://forums.solar2d.com/t/controlling-when-to-display-ads-coronaads-chartboost-adcolony/342418/7 "2016-12-21T19:07:22Z")

</div>

Thank you Rob for this clear answer.

Anyway it makes definitely sense that one should let time to the user to click on the ad.

I’d set my banners accordingly to your advice.

Thanks for the help here, much appreciated 👍

---

<div class="post-metadata">

**Author:** ![ingemar\_cl](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/i/e19b73/32.png) [@ingemar\_cl](https://forums.solar2d.com/u/ingemar_cl)\
**Post date:** [December 16, 2016, 8:27am UTC](https://forums.solar2d.com/t/controlling-when-to-display-ads-coronaads-chartboost-adcolony/342418/8 "2016-12-16T08:27:47Z")

</div>

You’ll need to implement your own logic to handle the situation with multiple ad networks.

As a rule you can call load()as early as possible to make sure ads are available, but you should never call show() from the plugin’s event handlers.

---

<div class="post-metadata">

**Author:** ![ali.ayyaz3](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/a/b38774/32.png) [@ali.ayyaz3](https://forums.solar2d.com/u/ali.ayyaz3)\
**Post date:** [December 16, 2016, 12:48pm UTC](https://forums.solar2d.com/t/controlling-when-to-display-ads-coronaads-chartboost-adcolony/342418/9 "2016-12-16T12:48:46Z")

</div>

I dont quite understand what you mean by 'never call show() from the plugin’s event handlers"

Can you explain?

---

<div class="post-metadata">

**Author:** ![ingemar\_cl](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/i/e19b73/32.png) [@ingemar\_cl](https://forums.solar2d.com/u/ingemar_cl)\
**Post date:** [December 16, 2016, 12:54pm UTC](https://forums.solar2d.com/t/controlling-when-to-display-ads-coronaads-chartboost-adcolony/342418/10 "2016-12-16T12:54:24Z")

</div>

Example:

```
local function chartboostListener(event) if event.phase == "loaded" then if event.type == "interstitial" then chartboost.show("interstitial") end end end

```

That’s not recommended as it will display an ad as soon as it’s loaded.

---

<div class="post-metadata">

**Author:** ![christian.zoror](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/c/dbc845/32.png) [@christian.zoror](https://forums.solar2d.com/u/christian.zoror)\
**Post date:** [December 21, 2016, 9:13am UTC](https://forums.solar2d.com/t/controlling-when-to-display-ads-coronaads-chartboost-adcolony/342418/11 "2016-12-21T09:13:55Z")

</div>

Regarding your example I have a question:

At what point is repeated show() considered spam? Is it counted out of a minute?

For example would it be said that a banner refreshed each 20sec considered spam? Is there a thread on the forum relating this?

---

<div class="post-metadata">

**Author:** ![rob](https://forums.solar2d.com/user_avatar/forums.solar2d.com/rob/32/4_2.png) [@rob](https://forums.solar2d.com/u/rob)\
**Post date:** [December 21, 2016, 5:52pm UTC](https://forums.solar2d.com/t/controlling-when-to-display-ads-coronaads-chartboost-adcolony/342418/12 "2016-12-21T17:52:59Z")

</div>

Hi Christian.&nbsp;

Advertisers are not very fond of their ads being wasted. This is one of the reasons why no one does CPM (Cost Per Mille or per 1000 ads shown) campaigns any more. In the past, people set fast rotation times on ads to get the ad count up. This creates a poor user experience, slows down the network and eats through the advertisers inventory in a hurry. Advertisers realized they were not getting value from this.

Today most ads are a CPC (Cost Per Click) type campaign or CPA (Cost per acquisition or sometimes called CPI - Cost per Install). You get paid for clicks (or installs, conversion, getting new users). If you’re cycling ads every 20 seconds you’re not giving your user time to click on ads anyway. &nbsp;Banner ads during points of player action will never get clicked and you’re just burning through the ads and it’s not helping anyone: You, the advertiser or the player.

While I don’t know that you will find many vendors who state a limit, those that do may give you options of 30-60 seconds for auto rotation and this should be a good guideline of what’s acceptable. Put your banners in a part of your app that the user isn’t under pressure to interact with the app (i.e. time sensitive game play). A game like Angry Birds, you have plenty of time to interact with an ad, a tower defense game? Not so much. &nbsp;Leave them up long enough for the user to have an opportunity to see and interact with the ad.&nbsp;

Rob

---

<div class="post-metadata">

**Author:** ![christian.zoror](https://forums.solar2d.com/letter_avatar_proxy/v4/letter/c/dbc845/32.png) [@christian.zoror](https://forums.solar2d.com/u/christian.zoror)\
**Post date:** [December 21, 2016, 7:07pm UTC](https://forums.solar2d.com/t/controlling-when-to-display-ads-coronaads-chartboost-adcolony/342418/13 "2016-12-21T19:07:22Z")

</div>

Thank you Rob for this clear answer.

Anyway it makes definitely sense that one should let time to the user to click on the ad.

I’d set my banners accordingly to your advice.

Thanks for the help here, much appreciated 👍
