Best practices
Follow these recommendations to get the most out of your integration and to avoid the most common mistakes.
Initialization
Section titled “Initialization”- Initialize the SDK once, when the app starts. Subscribe to
WortiseSdk.OnInitializedbefore callingWortiseSdk.Initialize, and wait for this event before loading ads. - Keep the ad objects in a persistent object. Create them in a
GameObjectmarked withDontDestroyOnLoad, so an ad that is already loaded is not lost when the scene changes. - Call the SDK from the main thread. The SDK creates native views and objects, so do not call it from
Task.Runor from your own threads. All the events are raised on the Unity main thread, so the handlers can use the Unity API directly.
Consent and privacy
Section titled “Consent and privacy”- Request consent on every launch and load the first ad when it has finished.
RequestIfRequiredonly shows the dialog when it is needed, and its callback tells you when the ads can be requested. See User consent. - Offer an option to change the consent. Call
WortiseConsentManager.Requestfrom the settings screen of your app. - Set the child-directed options before initializing the SDK. If your app is directed to children, see Privacy.
- On iOS, show the App Tracking Transparency prompt before loading the first ad, if your app requests it. The SDK does not show it.
void Start() { WortiseSdk.OnInitialized += OnSdkInitialized; WortiseSdk.Initialize("your app key");}
void OnSdkInitialized() { WortiseConsentManager.RequestIfRequired((shown) => { interstitialAd.LoadAd(); });}Loading ads
Section titled “Loading ads”- Create one object per ad unit and reuse it. After an interstitial or rewarded ad is dismissed, call
LoadAdagain on the same object to prepare the next one. - Load the ads in advance, but do not call
LoadAdwhen an ad is already available.LoadAddiscards the loaded ad and requests a new one, so checkIsAvailablefirst when the ad may already be loaded. - Do not retry immediately from
OnFailedToLoad. After a failed load there is a cooldown period (30 seconds by default) during whichLoadAdis ignored and no event is raised. Request the ad again later, or checkIsInCooldownandCooldownRemainingMs.
// Prepare the next ad when the current one is closedinterstitialAd.OnDismissed += () => interstitialAd.LoadAd();Showing ads
Section titled “Showing ads”- Check
IsAvailablebefore callingShowAd. When there is no ad available,ShowAddoes nothing and no event is raised. - Do not block the game waiting for an event. Pause the game only when
ShowAdhas actually been called, and resume it in bothOnDismissedandOnFailedToShow. - Grant the reward in
OnCompleted, and only whenreward.successistrue. Do not grant it inOnDismissedorOnShown. Theamountandlabelfields may be empty, so define the reward in your game.
// When the ad is createdrewardedAd.OnCompleted += (reward) => { if (reward.success) GrantReward(); };rewardedAd.OnDismissed += ResumeGame;rewardedAd.OnFailedToShow += ResumeGame;
// When the user asks for the rewardif (rewardedAd.IsAvailable) { PauseGame(); rewardedAd.ShowAd();}Banners
Section titled “Banners”- Create the banner once and call
LoadAdonce. The banner refreshes automatically, and it also retries by itself after a failed load, so do not callLoadAdagain fromOnFailedToLoador periodically. - Destroy the banner before creating another one. A banner stays on screen, even after a scene change, until
Destroyis called. Creating a new one on every scene load stacks several banners that keep requesting ads. - Set
AutoRefreshTimein milliseconds. The value is limited to the range between 30000 and 120000 (30 to 120 seconds).
App open
Section titled “App open”- Load the ad at startup and enable
AutoReload, so a new ad is requested when the previous one is closed. - Show it when the user comes back to the app, by calling
TryToShowAdfromOnApplicationPause. This method shows the ad when it is available, and requests a new one otherwise. - Do not show it right after another ad. On Android,
OnApplicationPauseis also called when a fullscreen ad is closed, so skip the App Open ad in that case:
bool returningFromAd;
void ShowInterstitial() { if (!interstitialAd.IsAvailable) { return; }
#if UNITY_ANDROID returningFromAd = true; #endif
interstitialAd.ShowAd();}
void OnApplicationPause(bool paused) { if (paused) { return; }
if (returningFromAd) { returningFromAd = false; return; }
appOpenAd?.TryToShowAd();}Scene changes and cleanup
Section titled “Scene changes and cleanup”- Call
Destroyon the ads you no longer need, in theOnDestroymethod of the object that created them. This applies to banners and to interstitial, rewarded and App Open ads. - Unsubscribe your handlers.
WortiseSdk.OnInitializedis a static event, so remove the handlers that belong to objects that are going to be destroyed. Otherwise, they will be called on a destroyed object.
void OnDestroy() { WortiseSdk.OnInitialized -= OnSdkInitialized;
bannerAd?.Destroy(); interstitialAd?.Destroy();}Testing
Section titled “Testing”- Test on a device. The SDK does not work in the Unity Editor: the calls are ignored and no event is raised.
- Use test ads during development. Enable the test mode or use the test ad units, and do not click on real ads in your own app.
- Disable the test mode in the builds you publish. For example, enable it only in development builds:
WortiseAdSettings.IsTestEnabled = Debug.isDebugBuild;Before you publish
Section titled “Before you publish”- The Google App IDs are set in Wortise -> Settings. See SDK integration.
- The app uses your own app key and ad unit IDs, not the test ones.
- The test mode is disabled.
- Consent is requested at startup, and the user can change it from your app.
- The child-directed options are set if your app is directed to children.
IsAvailableis checked before everyShowAd, and the game resumes afterOnDismissedandOnFailedToShow.- Rewards are granted only in
OnCompletedwhenreward.successistrue. - Banners and fullscreen ads are destroyed when they are no longer needed.
- The ads have been verified on real Android and iOS devices.
© 2026 Wortise. All rights reserved.