Skip to main content

Auto-load Feature

Step 1. Auto-load Feature Introduction

As shown in the diagram above, auto-load is triggered in the following scenarios:

  • After creating the ad placement object.
  • When isReady() returns false.
  • When the internal call to isReady() within the show() method returns false.
  • After a rewarded or interstitial ad is closed, or after a native ad is displayed.
  • When load() fails and there are no available ads in the cache.

The auto-load feature is a unique TradPlus capability designed for scenarios requiring frequent ad displays. It automatically replenishes the ad cache and reloads upon expiration. It is recommended for use in scenarios with high ad trigger frequency.

1、Supported Ad Formats: Interstitial Ads, Rewarded Video Ads, Native Ads

2、Suitable Use Cases

  • The auto-load feature triggers the loading of new ads at various opportunities, ensuring an ad is available when needed for display, thereby increasing the number of successful ad impressions.

  • It is recommended to enable auto-load for positions with high ad exposure frequency. For scenarios where the ad placement is obscure or has low user reachability, enabling auto-load is not recommended as it may lead to wasted ad requests and a decrease in the show rate.

3、Integration Recommendations

  • If enabling auto-load:

    • It is advised to create the ad placement object as early as possible, such as when the app starts (or on a precursor page before the ad scene). This will automatically initiate the auto-load process.
  • Subsequently, when entering the scenario where an ad might be shown, call the entryAdScenario() method to log tracking points for entering the ad scenario. When you need to display an ad within this scenario, you can directly call isReady() on the pre-created ad placement object.

  • If isReady() returns true, it indicates an ad is available, and you can directly call show() to display it.

  • If isReady() returns false, it indicates no ad is currently available. The ad will not be shown at this opportunity (the SDK will automatically attempt to load an ad internally; no need to call the load method separately). Simultaneously, the SDK internally records this event, allowing you to view the proportion of missed ad opportunities due to lack of ads in the TradPlus backend after launch.

  • If NOT enabling auto-load:

    • It is recommended to call loadAd() before the page where an ad might be displayed to ensure an ad is available when needed. Additionally, call loadAd() again after an ad is finished displaying, or if no ad was available when attempting to show one.

    • If the onAdAllLoaded callback indicates a failure, you can retry loading after a delay (avoid frequent retries; consider increasing the interval, e.g., doubling from 15s, to 30s, to 60s).

Step 3. Disabling Auto-load

Method 1: Contact Tradplus operations for assistance in disabling the feature.
Method 2: Developers can disable the feature themselves by calling the SDK code. An example code is shown below.

Android Native

  • Call before creating the ad placement object.
Map<String, Object> settingParam = new HashMap<>();
String[] unitIds = {"adUnitID1","adUnitID2"};
settingParam.put("autoload_close",unitIds);
TradPlusSdk.setSettingDataParam(settingParam);

iOS Native

  • Call before creating the ad placement object.
[TradPlus sharedInstance].settingDataParam = @{@"autoload_close":@[@"adUnitID1"@"adUnitID2"]};

Unity Platform

  • Call before requesting the ad.
Dictionary<string, object> settingMap = new Dictionary<string, object>();
string[] unitIds = {"adUnitID1","adUnitID2"};
settingMap.Add("autoload_close", unitIds);
TradplusAds.Instance().SetSettingDataParam(settingMap);

Flutter Platform

  • Call before requesting the ad.
Map settingMap = {"autoload_close": "adUnitID1","autoload_close":"adUnitID2"};
TPSDKManager.setSettingDataParam(settingMap);

Harmony Platform

  • Call before requesting the ad.
let localParams = new Map<string,Object>()
let array = new Array<string>("adUnitID1","adUnitID2","adUnitID3")
localParams.set("autoload_close", array)
TradPlus.setSettingDataParam(localParams);