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.

Size

There are 5 banner sizes available:

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

Getting started

Here is a simple video that will teach you how to add banners to your Unity game.

Steps

  • Add the latest CrazyGames Unity SDK package to your project.
  • Drag and drop the CrazySDK/CrazyAds/Ressources/CrazyBanner prefab to your scene.
  • Set banners' size and position.
  • Test with CrazyGames standard resolution (922x487) and a 16:9 ratio, make sure that the banners are not going outside of the screen and that they are not overlapping with any UI elements.
  • Adjust banner anchor and positioning if necessary.
  • Make sure that the banners are activated when the game starts.
myBanner.gameObject.SetActive(true);
  • Trigger the banner display when you want to.
myBanner.MarkVisible(true);
CrazyAds.Instance.updateBannersDisplay();
  • Remove the banner explicitly when needed. For example, loading a new scene will remove the banner in Unity’s editor, but it will not be removed on CrazyGames.
myBanner.MarkVisible(false);
CrazyAds.Instance.updateBannersDisplay();
  • That’s it! You can try your game using the CrazyGames Unity template (included in the package). Make sure to use Crazy_2020 if you are on Unity 2020 and Crazy_5_6+ for all the previous versions.

If you are managing more than one banner at the same time, make sure to call updateBannersDisplay() only once to update all your banners.

leftBanner.MarkVisible(true);
rightBanner.MarkVisible(true);
CrazyAds.Instance.updateBannersDisplay();

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. We refer to the advanced features section bellow to detect these cases programmatically.

Advanced Features

Callbacks

Our SDK provides several callbacks to detect the success or failure of displaying a banner ad. These callbacks can be used as follows:

using CrazyGames;

public class MyController : MonoBehaviour
{
    public CrazyBanner bannerPrefab;

    void Awake()
    {
        CrazyAds.Instance.listenToBannerError(BannerError);
        CrazyAds.Instance.listenToBannerRendered(BannerRendered);
    }

    private void BannerError(string id, string error)
    {
        Debug.Log("Banner error for id " + id + ": " + error);
    }

    private void BannerRendered(string id)
    {
        Debug.Log("Banner rendered for id " + id);
    }
}

Refreshing

You can refresh a visible banner every 60 seconds, with a maximum of 60 refreshes per session. You’ll need to call this code every time you want the banner to be refreshed.

myBanner.MarkForRefresh();
CrazyAds.Instance.updateBannersDisplay();