You can enable test ads for one or more IDFAs/GAIDs programmatically in the AppLovin SDK.
NOTE
With test ads, AppLovin will not track enabled impressions, clicks, and revenue. You should only use such ads to test your app integration.
AppLovin SDK
Native Android
To enable test ads for a set of IDFAs, set the testDeviceAdvertisingIds
property (part of the settings
object of the SDK) to a list that includes the IDFAs. The following code snippets show how to do this in Java and Kotlin.
Java:
AppLovinSdk.getInstance(context).getSettings().setTestDeviceAdvertisingIds(Arrays.asList("YOUR_GAID_HERE"));
Kotlin:
AppLovinSdk.getInstance(context).settings.testDeviceAdvertisingIds = arrayListOf("YOUR_GAID_HERE")
Native iOS
To enable test ads for a set of IDFAs, set the testDeviceAdvertisingIds
property (part of the settings
object of the SDK) to an array that includes the IDFAs. The following code snippets show how to do this in Swift and Objective-C.
Swift:
ALSdk.shared()!.settings.testDeviceAdvertisingIdentifiers = ["YOUR_IDFA_HERE"]
Objective-C:
[ALSdk shared].settings.testDeviceAdvertisingIdentifiers = @[@"YOUR_IDFA_HERE"];
Unity (MAX Plugin)
If you use the AppLovin MAX Unity Plugin, enable test ads by providing an array of IDFAs to a method on the MaxSdk
class:
MaxSdk.SetTestDeviceAdvertisingIdentifiers(new string[]{"YOUR_IDFA_HERE", "YOUR_GAID_HERE"});
Unity (AppLovin Plugin)
If you use the AppLovin network Unity Plugin, enable test ads by providing an array of IDFAs to a method on the AppLovin
class:
AppLovin.SetTestDeviceAdvertisingIdentifiers(new string[]{"YOUR_IDFA_HERE", "YOUR_GAID_HERE"});
Troubleshooting
If you are not able to get test ads after following these steps, you might have an integration issue. Please follow the other steps in our support article titled “Why am I not seeing any ads?”.