고급 설정

Ad placements

각 ad unit에 대해 placement 이름을 설정할 수 있습니다 (예: “Rewarded VideoLevels”, “INTER_levelEnd”, 또는 “RewardedVideoCoinStore”). 이를 통해 다양한 placement 카테고리에 대한 통계를 수집할 수 있습니다. 다음 스니펫은 다양한 ad format에 대해 placement 이름을 설정하는 방법을 보여줍니다.

Banners / MRECs

banners 및 MRECs의 경우 banner 또는 MREC를 로드하기 전에 placement 이름을 설정해야 합니다.

adView.setPlacement( "«placement»" );
adView.loadAd();

Interstitials

interstitial.showAd( "«placement»" );

Rewarded ads

rewardedAd.showAd( "«placement»" );

Native ads

nativeAdLoader.setPlacement( "«placement»" );

Native ads (ad placer)

MaxAdPlacerSettings settings = new MaxAdPlacerSettings( "«ad-unit-ID»" );
settings.setPlacement( "«placement»" );

Mute audio

앱을 시작할 때 일부 mediation SDK network의 오디오를 음소거할 수 있습니다. AppLovin SDK를 통해 이 기능을 지원하는 network는 다음과 같습니다.

  • AppLovin
  • Bigo (native 전용)
  • DT Exchange
  • Google Ad Manager
  • Google bidding 및 Google AdMob
  • LINE
  • Mintegral

기타 network의 경우, 해당 network의 담당 팀에 문의하여 이 기능의 지원 여부 및 액세스 방법을 확인하십시오.

다음 코드 스니펫은 이 기능을 지원하는 network에서 오디오를 음소거하는 방법을 보여줍니다:

AppLovinSdk sdk = AppLovinSdk.getInstance( context );
sdk.getSettings().setMuted( true );  // to mute
sdk.getSettings().setMuted( false ); // to unmute

ad를 로드하기 전에 음소거 상태를 설정하십시오. 일부 network(예: Google bidding 및 Google AdMob)는 ad 로드 전의 음소거 상태에 따라 음소거되거나 음소거되지 않은 비디오를 반환합니다.

참고: ad를 음소거하면 ad 수익이 낮아질 수 있습니다.

Enable verbose logging

SDK의 settings 객체에서 boolean 플래그를 설정하여 verbose 로그를 활성화할 수 있습니다.

프로그래밍 방식

AppLovinSdk.getInstance( context ).getSettings().setVerboseLogging( true );

Android manifest

애플리케이션의 Android Manifest 파일을 편집하여 verbose logging을 활성화할 수도 있습니다. 다음과 같이 <meta-data> 요소를 추가하십시오.

<application>
⋮
  <meta-data android:name="applovin.sdk.verbose_logging" android:value="true" />
⋮
</application>

검증

verbose 로그가 활성화되었는지 확인하려면 AppLovin SDK 로그의 초기화 섹션에서 Verbose Logging On: true라고 표시된 줄을 확인하십시오.

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

AppLovin SDK는 로그에 “/AppLovinSdk: [AppLovinSdk]” 태그를 지정합니다.

Creative ID and network name

mediation 대상 network에서 노출된 ad의 creative ID 및 network name을 가져올 수 있습니다. 자세한 내용은 Creative Debugger 문서를 참조하십시오.

DSP name

AppLovin Exchange에서 서빙된 MAX ad의 DSP 이름을 가져오려면 ad의 getDspName() 메서드를 호출하십시오:

@Override
public void onAdLoaded(final MaxAd ad)
{
  System.out.println( "AppLovin Exchange DSP name: " + ad.getDspName() );
}

Impression-level user revenue API

클라이언트 측에서 impression-level user revenue 데이터에 액세스할 수 있습니다. 이 데이터를 사용하여 다양한 소스 및 캠페인을 비교할 수 있습니다. 또한 MAX user revenue API를 사용하여 이 데이터에 액세스할 수도 있습니다. 이 데이터에 액세스하고자 하는 MMP는 MMP용 impression-level user revenue API 문서를 검토해야 합니다.

지원되는 모든 network에 대해 Adjust 등 원하는 모바일 측정 파트너(MMP)와 impression-level ad revenue 데이터를 공유할 수 있습니다.

모든 ad 수명 주기 콜백에서 revenue 금액을 가져올 수 있습니다. 이를 위해 MaxAdRevenueListener를 생성하고, 해당 onAdRevenuePaid() 메서드를 구현한 다음, 해당 listener를 setRevenueListener()에 전달하십시오. 다음 예제는 이러한 “ad revenue paid” 콜백을 구현하는 방법을 보여줍니다:

@Override
public void onAdRevenuePaid(final MaxAd ad)
{
  double revenue = ad.getRevenue(); // In USD

  // Miscellaneous data
  String countryCode = AppLovinSdk.getInstance( context ).getConfiguration().getCountryCode(); // "US" for the United States, etc - Note: Do not confuse this with currency code which is "USD"
  String networkName = ad.getNetworkName(); // Display name of the network that showed the ad
  String adUnitId = ad.getAdUnitId(); // The MAX Ad Unit ID
  MaxAdFormat adFormat = ad.getFormat(); // The ad format of the ad (e.g. BANNER, MREC, INTERSTITIAL, REWARDED)
  String placement = ad.getPlacement(); // The placement this ad's postbacks are tied to
  String networkPlacement = ad.getNetworkPlacement(); // The placement ID from the network that showed the ad
}

에러가 발생한 경우 ad.getRevenue()/ad.revenue 값은 -1이 될 수 있습니다.

다음 예제와 같이 revenue 값에 대한 정밀도 평가(precision evaluation)를 가져올 수도 있습니다:

String revenuePrecision = ad.getRevenuePrecision();

이 정밀도는 다음 값 중 하나를 가집니다:

"publisher_defined"
revenue 금액이 퍼블리셔가 할당한 가격인 경우
"exact"
revenue 금액이 실시간 auction의 결과인 경우
"estimated"
revenue 금액이 Auto-CPM 또는 FB Bidding 추정치를 기반으로 하는 경우
"undefined"
revenue 금액이 정의되지 않았으며 추정할 데이터가 충분하지 않은 경우
""
revenue 및 정밀도가 유효하지 않은 경우 (예: 테스트 모드)

Establishing ad request callbacks

ad 요청을 수신 대기하려면 MaxAdRequestListener를 설정하고, 해당 onAdRequestStarted() 메서드를 구현한 다음, 해당 listener를 setRequestListener()에 전달하십시오. 다음 예제는 이러한 “ad request started” 콜백을 구현하는 방법을 보여줍니다:

@Override
public void onAdRequestStarted(final String adUnitId)
{
  // Ad request started here
}

Selective init

AppLovinSdkInitializationConfiguration에 ad unit을 지정하여 특정 ad unit으로 SDK를 초기화할 수 있습니다. 그렇게 하면 SDK는 지정된 ad unit에 대해 구성한 network만 초기화합니다. ad unit을 지정하지 않으면 SDK는 현재 세션에 모든 ad unit이 필요하다고 가정합니다. 이러한 경우 해당 ad unit에 대해 구성한 모든 network를 초기화합니다. 다음 예제는 이 기능을 구현하는 방법을 보여줍니다:

AppLovinSdkInitializationConfiguration.Builder initConfigBuilder = AppLovinSdkInitializationConfiguration.builder( «your-SDK-key» );
initConfigBuilder.setMediationProvider( AppLovinMediationProvider.MAX );
List<String> adUnitIds = new ArrayList<>();
adUnitIds.add( "«ad-unit-ID-1»" );
adUnitIds.add( "«ad-unit-ID-2»" );
initConfigBuilder.setAdUnitIds( adUnitIds ).build();

AppLovinSdk.getInstance( this ).initialize( initConfigBuilder, new AppLovinSdk.SdkInitializationListener()
  {
    @Override
    public void onSdkInitialized(final AppLovinSdkConfiguration sdkConfig)
    {
      ⋮
    }
  } );

SDK 키는 AppLovin 대시보드의 Account > General > Keys 섹션에서 확인할 수 있습니다.

selective init을 사용하면 MAX는 명시적으로 지정하지 않은 ad unit이 현재 세션에서 ad를 서빙하지 못하도록 제외합니다.

테스트 모드를 활성화한 경우 selective init은 적용되지 않습니다.

Waterfall information API

Waterfall Information API는 ad(로드되었거나 로드에 실패한 ad)의 현재 waterfall에 대한 정보를 제공합니다. 이 API는 waterfall에 있는 각 ad의 ad load 상태, latency, 자격 증명(credentials) 및 mediation 대상 network 정보를 반환합니다. waterfall의 ad가 로드에 실패하면 API에서 에러 정보를 제공합니다.

AdLoadState values

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

예제

@Override
public void onAdLoaded(final MaxAd ad)
{
  MaxAdWaterfallInfo waterfall = ad.getWaterfall();
  if ( waterfall == null ) return;
  System.out.println( "Waterfall Name: " + waterfall.getName() + " and Test Name: " + waterfall.getTestName() );
  System.out.println( "Waterfall latency was: " + waterfall.getLatencyMillis() + " milliseconds" );

  String waterfallInfoStr;
  for ( MaxNetworkResponseInfo networkResponse : waterfall.getNetworkResponses() )
  {
    waterfallInfoStr = "Network -> " + networkResponse.getMediatedNetwork() +
            "\n...adLoadState: " + networkResponse.getAdLoadState() +
            "\n...latency: " + networkResponse.getLatencyMillis() + " milliseconds" +
            "\n...credentials: " + networkResponse.getCredentials();
    if ( networkResponse.getError() != null )
    {
      waterfallInfoStr += "\n...error: " + networkResponse.getError();
    }
    System.out.println( waterfallInfoStr );
  }
}

@Override
public void onAdLoadFailed(final String adUnitId, final MaxError error)
{
  MaxAdWaterfallInfo waterfall = error.getWaterfall();
  if ( waterfall == null ) return;
  System.out.println( "Waterfall Name: " + waterfall.getName() + " and Test Name: " + waterfall.getTestName() );
  System.out.println( "Waterfall latency was: " + waterfall.getLatencyMillis() + " milliseconds" );

  for ( MaxNetworkResponseInfo networkResponse : waterfall.getNetworkResponses() )
  {
    System.out.println( "Network -> " + networkResponse.getMediatedNetwork() +
                        "...latency: " + networkResponse.getLatencyMillis() +
                        "...credentials: " + networkResponse.getCredentials() + " milliseconds" +
                        "...error: " + networkResponse.getError() );
  }
}

waterfall이 비어 있는 경우 MaxError.getWaterfall()null을 반환합니다. 이 경우 waterfall 속성을 쿼리할 수 없습니다. 그러나 getRequestLatencyMillis() 메서드를 호출하여 비어 있는 waterfall에 대한 ad load latency를 가져올 수 있습니다:

@Override
public void onAdLoaded(final MaxAd ad)
{
  System.out.println("Successful ad load latency: " + ad.getRequestLatencyMillis() + " ms");
}

@Override
public void onAdLoadFailed(final String adUnitId, final MaxError error)
{
  System.out.println("Failed ad load latency: " + error.getRequestLatencyMillis() + " ms");
}

Customize banner / MREC ad refresh

Ad Unit UI에서 구성할 수 있는 것처럼 API를 통해 banner 및 MREC ad refresh 주기를 맞춤 설정할 수 있습니다. 허용되는 최소 및 최대 refresh 주기는 각각 10초와 120초입니다. MAX는 이 범위를 벗어나는 값을 무시합니다. 다음 코드 샘플은 이러한 refresh 주기를 맞춤 설정하는 방법을 보여줍니다:

// Where adView is an instance of MaxAdView
adView.setExtraParameter( "ad_refresh_seconds", «ad-refresh-rate» );

search