-
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. More about Interstitial impression interval.
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.
Managing ad availability is not easy. Keeping a balance between maximum ad availability while minimizing waste (network calls - which may affect user experience and data usage - and calls to mediated networks APIs - which may negatively impact eCPM if their inventory never gets to be shown to a user) can turn out to be harder than expected. In fact, often, it is simply guess work as you cannot predict ahead of time when a user will reach a moment in your application or game where it makes sense to show an Interstitial or offer the possibility to watch a Rewarded ad.
When you try to time your ad requests, this often results in not having a fill when you need it or having wasted fills that are never shown.
The CAS SDK provides an “auto-request” feature to address this problem.
By default, CAS SDK starts with auto-request enabled for all managers.
This means two things:
- When a user finishes watching an ad, CAS immediately tries to replace that ad.
- When a certain placement has trouble obtaining a fill (no traditional mediated network has available inventory and no programmatic demand is bidding within a predetermined amount of time), CAS continues trying to ensure that placement gets a fill by restarting the entire ad request process. This is performed in exponentially increasing time intervals to optimize the chances of getting a fill while minimizing usage of device resources.
However, you can choose to disable auto-request when you set Manual
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?
What’s Next?
- Follow our integration guides:
- Include Android and add Android solutions
- Include iOS and add iOS solutions
- Advanced integration
- Project Setup
- Configuring SDK
- Include Android
- Include iOS
- Additional mediation steps
- App-ads.txt🔗