-
Notifications
You must be signed in to change notification settings - Fork 4
Enabling test ads
⚡ Prerequisite
Make sure you have correctly Initialize Manager.
This guide explains how to enable test ads in your ads integration. It's important to enable test ads during development so that you can click on them without charging CAS advertisers.
Important
We strongly suggest that you enable test ads mode when you validate the integration. If you click on too many ads without being in test mode, you risk your account being flagged for invalid activity.
There are two ways to get test ads:
- Enable test ad mode for all devices.
- Set device ids to test ad.
Ads with Test Ads mode are safe to click. Requests, impressions, and clicks on test ads will not show up in your account's reports.
Test full-screen ads displays details of CAS integration and tips for solving errors. Go to the Mediation Adapters section to make sure that the advertising networks you want are integrated correctly.
The quickest way to enable testing is to use test ad mode. The test ad mode are not associated with your CAS account, so there's no risk of your account generating invalid traffic when using these test ad mode.
- In your Unity project, navigate to
Assets > CleverAdsSolutions > Settings
to create and modify default settings for each native platform. - Check Test ad mode.
- Use any no empty Manager ID. For example
demo
or your CAS Manager ID.
Note
Test Ad mode is automatically enabled for builds marked as development in the Unity Build Settings.
If you want to do more rigorous testing with production-looking ads, you can now configure your device as a test device and use your own manager id. Test devices can either be added programmatically.
Follow the steps below to add your device as a test device.
- Run an app configured with the CAS on device.
- Check the console or logcat output for a message that looks like this:
To get test ads on this device, set "12345678901234567890123456789012"
- Copy your alphanumeric test device ID to your clipboard.
- Modify your code to set the test device ID through
SetTestDeviceIds
before CAS manager initialize.
CAS.MobileAds.settings.SetTestDeviceIds(new[] {
"12345678901234567890123456789012"
});
Note
Be sure to remove the code that sets these test devices before you release your app.
- Re-run your app.
- Well done, ads on this device are safe to click. Requests, impressions, and clicks on ads in test mode will not show up in your account's reports.
🔗 Done! What’s Next?
- Learn about Privacy Regulations
- Follow the instructions below to implement Ad Formats:
- Project Setup
- Configuring SDK
- Include Android
- Include iOS
- Additional mediation steps
- App-ads.txt🔗