Advanced Settings

Ad Placements

You can set a placement name for each ad unit (for example, “Rewarded VideoLevels”, “INTER_levelEnd”, or “RewardedVideoCoinStore”). This can help you aggregate statistics for different placement categories. Below are code snippets that show you how to set the placement name for various ad formats.

  • AppLovinMAX.createBanner(ad_unit_id, position);
    AppLovinMAX.setBannerPlacement(ad_unit_id, placement);
  • AppLovinMAX.createMRec(ad_unit_id, position);
    AppLovinMAX.setMRecPlacement(ad_unit_id, placement);
  • AppLovinMAX.showInterstitial(ad_unit_id, placement: placement);
  • AppLovinMAX.showRewardedAd(ad_unit_id, placement: placement);

Mute Audio

You can mute audio for certain mediated SDK networks when you launch your app. The networks that support this functionality via the AppLovin SDK are Google bidding and Google AdMob, AppLovin, DT Exchange, Google Ad Manager, LINE, Mintegral, Tencent, and Verve. For other networks, consult your network’s account team to learn whether this functionality is available and how to access it.

DT Exchange supports muting audio only on interstitial ads.

The following code snippets show how you mute audio on the supported networks:

AppLovinMAX.setMuted(true);  // to mute
AppLovinMAX.setMuted(false); // to unmute

Enable Verbose Logging

Enable verbose logs with the following call:

AppLovinMAX.setVerboseLogging(true);

To verify that you enabled verbose logs successfully you can check for the line that reads Verbose Logging On: true in the initialization section of the AppLovin SDK logs:

AppLovin SDK
Version: 11.4.2
⋮
Verbose Logging On: true
⋮

AppLovin SDK tags its logs with the tag /AppLovinSdk: [AppLovinSdk].

Segment Name

You can compartmentalize your users into “segments.” This can help you analyze users with particular characteristics, or can be helpful as a part of A/B testing. Each segment has a name of your choice, in the form of a string of 32 or fewer alphanumeric characters. You can set or retrieve the segment name of the current user from the AppLovin SDK by means of the userSegment property:

AppLovinMAX.userSegment.name = 'myusersegment';

Creative ID and Network Name

You can retrieve the creative ID and the network name of displayed ads of various mediated networks. Refer to the Creative Debugger documentation for more information.

DSP Name

You can retrieve the name of the DSP for a MAX ad served from AppLovin Exchange via the ad’s dspName property:

AppLovinMAX.setInterstitialListener(InterstitialListener(
  onAdLoadedCallback: (ad) {
    print("AppLovin Exchange DSP Name: " + ad.dspName);
  },
  ⋮
);

Selective Init

Starting in Flutter plugin version 3.4.0, you can initialize the SDK with specific ad units. If you do so, the SDK only initializes those networks that you have configured for the ad units you specify. If you do not specify any ad units, the SDK assumes the current session needs all of your ad units and so it initializes all networks that you have configured for them. The following example shows how you implement this feature:

AppLovinMAX.setInitializationAdUnitIds([ "ad_unit_id_1", "ad_unit_id_2" ]);
MaxConfiguration? configuration = await AppLovinMAX.initialize(_sdkKey);

When you use selective init, any ad units that you do not explicitly specify are excluded from serving ads for the current session.

Waterfall Information API

This feature allows you to see the information about the current waterfall for an ad that has loaded or failed to load. The network responses provide the ad load state, latency, credentials, and mediated network information for each ad in the waterfall. If an ad in the waterfall fails to load, the network response provides error information.

This API is supported as of Flutter plugin version 2.3.2.

adLoadState Values

0 Ad Load Not Attempted
1 Ad Loaded
2 Ad Failed To Load

Example

AppLovinMAX.setInterstitialListener(InterstitialListener(
  onAdLoadedCallback: (ad) {    

    print('Waterfall Name: \${ad.waterfall['name']} and Test Name: \${ad.waterfall['testName']}');
    print('Waterfall latency was: \${ad.waterfall['latencyMillis']} milliseconds');

    ad.waterfall['networkResponses'].forEach((networkResponse) {
      var mediatedNetwork = networkResponse['mediatedNetwork'];
      print('Network -> mediatedNetwork: [name: \${mediatedNetwork['name']} '
        'adapterClassName: \${mediatedNetwork['adapterClassName']} '
        'sdkVersion: \${mediatedNetwork['sdkVersion']} '
        'adapterVersion: \${mediatedNetwork['adapterVersion']}]');
      print('...adLoadState: \${networkResponse['adLoadState']}');
      print('...latencyMillis: \${networkResponse['latencyMillis']}');
      print('...credentials: \${networkResponse['credentials']['placement_id']}');

      var error = networkResponse['error'];
      if (error != null) {
        print('...error code: \${error['code']} message: \${error['message']}');
      }
    });
}, onAdLoadFailedCallback: (adUnitId, error) {
  if (error.waterfall.isEmpty) return;

  print('Waterfall Name: \${error.waterfall['name']} and Test Name: \${error.waterfall['testName']}');
  print('Waterfall latency was: \${error.waterfall['latencyMillis']} milliseconds');

  error.waterfall['networkResponses'].forEach((networkResponse) {
    var mediatedNetwork = networkResponse['mediatedNetwork'];
    print('Network -> mediatedNetwork: [name: \${mediatedNetwork['name']} '
          'adapterClassName: \${mediatedNetwork['adapterClassName']} '
          'sdkVersion: \${mediatedNetwork['sdkVersion']} '
          'adapterVersion: \${mediatedNetwork['adapterVersion']}]');
    print('...latencyMillis: \${networkResponse['latencyMillis']}');
    print('...credentials: \${networkResponse['credentials']['placement_id']}');
    var error = networkResponse['error'];
    print('...error code: \${error['code']} message: \${error['message']}');
  });
}));

Output

Waterfall Name: Default Waterfall and Test Name: Control
Waterfall latency was: 1635 milliseconds
Network -> mediatedNetwork: [name: Mintegral adapterClassName: com.applovin.mediation.adapters.MintegralMediationAdapter sdkVersion: MAL_16.2.61 adapterVersion: 16.2.61.2]
...adLoadState: 1
...latencyMillis: 1635
...credentials: 1542105
Network -> mediatedNetwork: [name: InMobi adapterClassName: com.applovin.mediation.adapters.InMobiMediationAdapter sdkVersion: 10.1.2 adapterVersion: 10.1.2.1]
...adLoadState: 0
...latencyMillis: -1
...credentials: 1550734895971
Network -> mediatedNetwork: [name: LINE adapterClassName: com.applovin.mediation.adapters.LineMediationAdapter sdkVersion: 2.4.20220216 adapterVersion: 2022.2.16.3]
...adLoadState: 0
...latencyMillis: -1
...credentials: 849050
Network -> mediatedNetwork: [name: Pangle adapterClassName: com.applovin.mediation.adapters.ByteDanceMediationAdapter sdkVersion: 4.8.0.9 adapterVersion: 4.8.0.9.0]
...adLoadState: 0
...latencyMillis: -1
...credentials: 980040498