-
Notifications
You must be signed in to change notification settings - Fork 4
Configuring SDK
⚡ Before you start
Make sure you have correctly setup project settings.
Settings to initialize mediation managers
- Banner Size
- Banner Refresh rate
- Interstitial impression interval
- Allow Interstitial Ad when the cost of the Rewarded Ad is lower
- Loading mode
- Debug log mode
- Analytics collection
In your Unity project, navigate to Assets > CleverAdsSolutions > Settings
to create and modify default settings for each native platform.
Also you can change some settings at runtime using CAS.MobileAds.settings
singleton.
The quickest way to testing is to enable Test Ad Mode. These ad are not associated with your account, so there's no risk of your account generating invalid traffic when using these ad units.
A manager ID
is a unique ID number assigned to each of your ad placements when they're created in CAS.
The manager ID is added to your app's code and used to identify ad requests.
If you haven't created an CAS account and registered an app yet, now's a great time to do so at cleveradssolutions.com.
In a real app, it is important that you use your actual CAS manager ID.
⭐ To work properly, you must define all identifiers that will be used in the application for a specific platform.
If you're just looking to experiment with the SDK, though, you can use the Test Ad Mode above with any manager ID.
To improve the performance of your application, we recommend that you only allow ad types that will actually be used in the application.
For example: AdFlags.Banner | AdFlags.Interstitial
ad.
The processes of ad types can be disabled/enabled at any time using following method:
CAS.MobileAds.manager.SetEnableAd(adType, enabled);
Choose the audience your game is targeting.
The changing audience will change the availability of the mediation network dependency. Please follow the instructions provided in the settings window.
Select the Banner Ad size to initialize.
An ad unit’s automatic refresh rate (in seconds) determines how often a new ad request is generated for that ad unit.
We recomended using refresh rate 30 seconds. However, you can choose any value you want longer than 10 seconds.
You can limit the posting of an interstitial ad to a period of time in seconds after the ad is closed, during which display attempts will fail.
During interval after ad closed display attempts will fire event OnInterstitialAdFailedToShow.
Change the interstitial ad impression interval using the following method:
CAS.MobileAds.settings.interstitialInterval = interval;
That the interval starts only after the Interstitial Ad closes OnInterstitialAdClosed.
If you need to wait for a period of time after the start of the game or after showing a Rewarded Ad until next Interstitial Ad impression then please call the following method:
CAS.MobileAds.settings.RestartInterstitialInterval();
The option will compare ad cost and serve regular interstitial ads when rewarded video ads are expected to generate less revenue.
Interstitial Ads does not require to watch the video to the end, but the OnRewardedAdCompleted callback will be triggered in any case.
Change the flag at any time using the following method:
CAS.MobileAds.settings.allowInterstitialAdsWhenVideoCostAreLower = allow;
Select the Waterfall loading mode.
Mode | Load*1 | Impact on App performance | Memory usage | Actual ads*2 |
---|---|---|---|---|
FastestRequests | Auto | Very high | High | Most relevant |
FastRequests | Auto | High | Balance | High relevance |
Optimal (Default) | Auto | Balance | Balance | Balance |
HighPerformance | Auto | Low | Low | Possible loss |
HighestPerformance | Auto | Very low | Low | Possible loss |
Manual | Manual*3 | Very low | Low | Depends on the frequency |
^1: Auto control load mediation ads starts immediately after initialization and will prepare displays automatically.
^2: Potential increase in revenue by increasing the frequency of ad requests. At the same time, it greatly affects the performance of the application.
^3: Manual control loading mediation ads requires manual preparation of advertising content for display. Use ad loading methods before trying to show: CAS.MobileAds.manager.LoadAd()
.
Change the Waterfall loading mode using the following method:
CAS.MobileAds.settings.loadingMode = mode;
The enabled Debug Mode will display a lot of useful information for debugging about the states of the sdk with tag CAS
.
Disabling the Debug Mode may improve application performance.
Change the Debug Mode flag at any time using the following method:
CAS.MobileAds.settings.isDebugMode = enabled;
If your application uses Google Analytics (Firebase) then Clever Ads Solutions collects ad impressions and states to analytic.
Disabling analytics collection may save internet traffic and improve application performance.
The Analytics collection has no effect on ad revenue.
Change the analytics collection flag at any time using the following method:
CAS.MobileAds.settings.analyticsCollectionEnabled = enabled;
You can now easily tailor the way you serve your ads to fit a specific audience!
You’ll need to inform our servers of the users’ details so the SDK will know to serve ads according to the segment the user belongs to.
Set user gender using the following method:
CAS.MobileAds.targetingOptions.gender = CAS.Gender.Male;
Set user age with limitation 1-99 and 0 is 'unknown' using the following method:
CAS.MobileAds.targetingOptions.age = 12;
Identifiers corresponding to test devices which will always request test ads. The test device identifier for the current device is logged to the console when the first ad request is made.
CAS.MobileAds.settings.SetTestDeviceIds(testDeviceIds);
Callbacks from CleverAdsSolutions are not guaranteed to be called on Unity thread.
You can use EventExecutor to schedule each calls on the next Update()
loop:
CAS.EventExecutor.Initialize();
CAS.EventExecutor.Add(callback);
OR enable isExecuteEventsOnUnityThread
property to automatically schedule all calls on the next Update()
loop.
CAS.MobileAds.settings.isExecuteEventsOnUnityThread = enable;
Disabled by default.
Sounds in ads mute state.
Disabled by default.
CAS.MobileAds.settings.isMutedAdSounds = mute;
What’s Next?
- Initialize SDK
- Follow our integration guides and implement our Ad Units:
- Project Setup
- Configuring SDK
- Include Android
- Include iOS
- Additional mediation steps
- App-ads.txt🔗