Skip to content

Banners

Guidelines for Advertisements

Please be sure to read our advertisement guidelines, since your game will be rejected without any feedback if it doesn't follow them.

Info

For a demo, please consult the CrazySDK/Demo/BannerModule scene. You can run it directly in the Unity editor.

Size

There are 5 banner sizes available:

  • Leaderboard (728x90)
  • Medium (300x250)
  • Mobile (320x50)
  • Main (468x60)
  • Large Mobile (320x100)

Using banners

Creating the banners

We provide a banner prefab, which you can find in CrazySDK/Resources. Drag the banner prefab into your scene.

To change the banner size, modify the Banner size property of the newly created object.

Banner size

To change the banner position, select the Banner child of the newly created object and change its position.

Banner position

Showing and hiding the banners is done similiar to other Unity GameObjects, by calling the SetActive(false) or SetActive(true) method.

Refreshing the banners

Adding and positioning the banners in your scene is only part of what takes to display banners. Since the banners are rendered with JavaScript above your game, you also need to manually request a banner refresh.

This is done by calling the following method:

CrazySDK.Banner.RefreshBanners()

The method needs to be called:

  • when you want to refresh the banners
  • when you load a scene that has some visible banners from the start
  • after showing/hiding banners, for example when transitioning between different menus
  • after navigating to another scene, so the banners displayed in the previous scene are cleared. For a better user experience, before leaving a scene that contains banners, disable them by calling SetActive(false), and call the CrazySDK.Banner.RefreshBanners() method.

Limitations

  • You can display a maximum of 2 banners of the same size at the same time.
  • The same banner can be re-displayed only 60 seconds after the last display.
  • The banner has to be fully inside the game window.
  • If a banner does not follow any of these rules, it will not display.