Skip to content

Configuring SDK

Denis edited this page Mar 16, 2021 · 49 revisions

⚡ Before you start
Make sure you have correctly setup project settings.

Settings to initialize mediation managers

General Ads settings

Runtime Ads settings


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.

Settings to initialize mediation managers

Test Ad Mode

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.

Manager Ids

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.

Allowed ads types in app

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);

Audience Tagged

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.

General Ads settings

Banner Size

Select the Banner Ad size to initialize.

Banner Refresh rate

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.

Interstitial impression interval

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. More about Interstitial impression interval.

Allow Interstitial Ad when the cost of the Rewarded Ad is lower

The option will compare ad cost and serve regular interstitial ads when rewarded video ads are expected to generate less revenue or not ready. More about Redirect to Interstitial Ad.

Loading mode

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;

Debug log 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;

Analytics collection

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;

Runtime Ads settings

Targeting Options

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;

Test Device Ids

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);

Execute events on Unity Thread

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.

Muted Ads Sounds

Sounds in ads mute state.
Disabled by default.

CAS.MobileAds.settings.isMutedAdSounds = mute;

What’s Next?

Clone this wiki locally