GameTribe

Ads Integration

Monetize your game with interstitial, rewarded, and banner ads.

Overview

The GameTribe SDK provides a unified ad system that works across all ad networks. Simply call the SDK methods and let the platform handle ad loading, display, and tracking.

Ad TypeDescriptionUse Case
InterstitialFull-screen ads shown at natural breaksLevel transitions, game over
RewardedOpt-in ads that give players rewardsExtra lives, bonus coins
BannerSmall persistent ads at screen edgesDuring gameplay or menus

Interstitial Ads

Full-screen ads shown at natural break points in your game. A cooldown prevents showing ads too frequently.

InterstitialExample.cs
using UnityEngine;
using GameTribe.SDK;
public class InterstitialExample : MonoBehaviour
{
public void ShowLevelCompleteAd()
{
var callbacks = new AdCallbacks
{
OnAdShown = () =>
{
Time.timeScale = 0f;
Debug.Log("Ad started showing");
},
OnAdClosed = () =>
{
Time.timeScale = 1f;
Debug.Log("Ad closed");
LoadNextLevel();
},
OnAdFailed = (error) =>
{
Debug.Log($"Ad failed: {error}");
LoadNextLevel();
}
};
PlatformSDK.Instance.Ads.ShowInterstitial("level_complete", callbacks);
}
}

Ad Cooldown

By default, interstitial ads have a 3-minute cooldown. Configure in Platform Config:

csharp
// In PlatformConfig asset:
adCooldownSeconds = 180f; // 3 minutes (default)

Rewarded Ads

Opt-in ads where players choose to watch in exchange for rewards.

RewardedAdExample.cs
public void WatchAdForCoins()
{
var callbacks = new AdCallbacks
{
OnAdShown = () => Time.timeScale = 0f,
OnRewardEarned = (rewardType, amount) =>
{
PlayerInventory.AddCoins(100);
ShowRewardNotification("+100 coins!");
},
OnAdClosed = () => Time.timeScale = 1f,
OnAdFailed = (error) => ShowError("Ad not available")
};
PlatformSDK.Instance.Ads.ShowRewarded("bonus_coins", callbacks);
}
Always grant rewards in OnRewardEarned, not OnAdClosed.

Small ads displayed at the edges of the screen.

csharp
// Show banner
PlatformSDK.Instance.Ads.ShowBanner(BannerPosition.Bottom);
// Hide banner during gameplay
PlatformSDK.Instance.Ads.HideBanner();
PositionDescription
TopCentered at top
BottomCentered at bottom
TopLeftTop-left corner
TopRightTop-right corner
BottomLeftBottom-left corner
BottomRightBottom-right corner

Ad Callbacks

CallbackDescription
OnAdLoadedAd is ready to show
OnAdShownAd started displaying
OnAdClosedAd was dismissed
OnAdFailedAd failed (includes error message)
OnRewardEarnedPlayer completed rewarded ad

Best Practices

  • Natural break points — Show interstitials at level transitions
  • Reward generously — Make rewarded ads worth watching
  • Pause gameplay — Set Time.timeScale = 0 during ads
  • Handle failures gracefully — Always have a fallback