Construct 2 and Admob Ads


When do you get the error?

Are you talking about previewing the app from C2? If so, you can’t preview. You need to build with for testing.


Also the ads are only working in the Developer App or in the built android file.
You cannot test the ads in the browser, even if you woudn’t get the javascript error.



I get the same error when i try to test in browser preview. I know it only works when is compiled but we need to make small changes and is very annoying to remove the plugin everytime i need to test in preview.


If you include the CanvasPlus plugin, then use the Is Canvas + event before calling your ads, it should not give the error. I just tested it.

For example, I can run this and preview will work.

If I just try to put Load Ad Banner in start of layout, I get the error.


Arcad, thanks for the tip on getting around error on preview. Where do I put “Set banner Layout” and “Show the banner ad”? On “On Banner Loaded”?

Do the banners show in Preview or only on device through APK?


You can download our free code examples.

Those files show you a possible way how to use ads (and other functions).



Depends on your game. I typically do it ON Start Of Layout of the layout I am showing ads on.

No, preview will not show ads at all. You will need to wait for the compiled APK to test them.


Can I export to Cocoon or only Cordova to get ads working?


Hi @CModProduction

You need to export to Cordova. You find a complete guide here



Obrigado meu amigo !


I finally got ads working using your template! Thank you so much for that!

One issue is that my ads are refreshing to new banners every 1-2 seconds. I have it set in Admob to every 30 seconds. Do you know any reason for this?


@andy_reitberger I think I see your response here:

I found the issue.
I submitted a Pull Request on Github.
Till the changes are live, please download the attached plugin and overwrite the existing one in C2.
Thank you!


Hi @jook00

Glad to hear that :slight_smile: yes that’s the fix :slight_smile: but it has been migrated in Github already, so if you download it from github, then it will work :slight_smile:

Let me know if you have any troubles :slight_smile:



Works perfectly! Thanks!
Now i’m trying to move onto inapp purchases to unlock ads. Is there more documentation for that than this one here:


Awesome :slight_smile: I’m currently working on an InApp Store Template using the CocoonInApp plugin for c2. If you want I can send you a beta tester link when I’m back home.
So you can test it live. When it’s working I will write a doc file for that. Moreover I’ll release the template on Scirra then :wink:

Would appreciate your feedback! So just send me PM if you are intressted :wink:



Please can you give me an screenshot of the events ?
One more question ? I am compiling as WebView+ and no ads are showing ? Is that a problem ? When I use Canvas+ I get black screen!


Pode me mandar print plz?


Please stick to english!
Thank you


hello the cocoon ads plugin was work great. but now it not work anymore ads not showing and also i get a javascript error when i preview the game in my browser. any solution please ?


The js error at the Browser preview is normal, it’s just an uncaught exception. Running on a mobile this will not happen.
To avoid the errors in preview, just add the condition “System -> Is on platform [Cordova]” to every action / event from the CocoonAds plugin.