고급 설정

Ad placements

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

Banners / MRECs

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

adView.placement = @"«placement»";
[adView loadAd];

Interstitials

[interstitialAd showAdForPlacement: @"«placement»"];

Rewarded ads

[rewardedAd showAdForPlacement: @"«placement»"];

Native ads

nativeAdLoader.placement = @"«placement»";

Native ads (ad placer)

MAAdPlacerSettings *settings = [MAAdPlacerSettings settingsWithAdUnitIdentifier: @"«ad-unit-ID»"];
settings.placement = @"«placement»";

Mute audio

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

  • AppLovin
  • Bigo (native only)
  • DT Exchange
  • Google Ad Manager
  • Google bidding and Google AdMob
  • LINE
  • Mintegral

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

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

ALSdk *sdk = [ALSdk shared];
sdk.settings.muted = YES; // to mute
sdk.settings.muted = NO;  // to unmute

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

참고: 광고를 음소거하면 광고 수익이 감소할 수 있습니다.

Enable verbose logging

verbose logging을 활성화하는 방법에는 두 가지가 있습니다.

Programmatically

SDK의 settings 객체에서 isVerboseLoggingEnabled 플래그를 YES로 설정하여 verbose logging을 활성화할 수 있습니다:

[ALSdk shared].settings.verboseLoggingEnabled = YES;

Info.plist

애플리케이션의 Info.plist에서 AppLovinVerboseLoggingOnYES로 설정하여 verbose logging을 활성화할 수도 있습니다.

Key: Information Property List. Type: Dictionary. Value: (1 item). Key: AppLovinVerboseLoggingOn. Type: Boolean. Value: YES.

Verification

verbose log가 활성화되었는지 확인하려면 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

mediated network에서 노출된 광고의 creative ID와 network name을 가져올 수 있습니다. 자세한 내용은 Creative Debugger 설명서를 참조하십시오.

DSP name

다음과 같은 코드를 사용하여 AppLovin Exchange에서 서빙된 MAX 광고의 DSP 이름을 가져올 수 있습니다:

- (void)didLoadAd:(MAAd *)ad
{
  NSLog(@"AppLovin Exchange DSP name: %@", ad.DSPName);
}

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 데이터를 공유할 수 있습니다.

모든 광고 라이프사이클 콜백에서 revenue 금액을 가져올 수 있습니다. 다음 예시는 “ad revenue paid” 콜백에서 이를 수행하는 방법을 보여줍니다:

- (void)didPayRevenueForAd:(MAAd *)ad
{
  double revenue = ad.revenue; // In USD

  // Miscellaneous data
  NSString *countryCode = [ALSdk shared].configuration.countryCode; // "US" for the United States, etc - Note: Do not confuse this with currency code which is "USD"
  NSString *networkName = ad.networkName; // Display name of the network that showed the ad
  NSString *adUnitId = ad.adUnitIdentifier; // The MAX Ad Unit ID
  MAAdFormat *adFormat = ad.format; // The ad format of the ad (e.g. BANNER, MREC, INTERSTITIAL, REWARDED)
  NSString *placement = ad.placement; // The placement this ad's postbacks are tied to
  NSString *networkPlacement = ad.networkPlacement; // The placement ID from the network that showed the ad
}

ad.revenue-1인 경우 이는 오류를 나타냅니다.

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

NSString *revenuePrecision = ad.revenuePrecision;

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

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

Establishing ad request callbacks

MAAdRequestDelegate를 설정하고, 해당 [didStartAdRequestForAdUnitIdentifier:] 메서드를 구현하고, 해당 대리자를 requestDelegate로 설정하여 광고 요청이 발생하는 시점을 수신 대기할 수 있습니다. 다음 예시는 이러한 “ad request started” 콜백을 구현하는 방법을 보여줍니다:

- (void)didStartAdRequestForAdUnitIdentifier:(NSString *)adUnitIdentifier
{
  // Ad request started here
}

Selective init

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

ALSdkInitializationConfiguration *initConfig = [ALSdkInitializationConfiguration configurationWithSdkKey:«your-SDK-key»
  builderBlock:^(ALSdkInitializationConfigurationBuilder *builder) {
    builder.mediationProvider = ALMediationProviderMAX;
    builder.adUnitIdentifiers = @[@"«ad-unit-ID-1»", @"«ad-unit-ID-2»"];
  }];

[[ALSdk shared] initializeWithConfiguration: initConfig completionHandler:^(ALSdkConfiguration *sdkConfig) {
 ⋮
}];

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

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

test mode를 활성화한 경우 selective init은 적용되지 않습니다.

Waterfall information API

Waterfall Information API는 광고(로드되었거나 로드에 실패한 광고)의 현재 waterfall에 대한 정보를 제공합니다. 이 API는 waterfall의 각 광고에 대한 ad load 상태, 지연 시간(latency), 자격 증명(credentials) 및 mediated network 정보를 반환합니다. waterfall의 광고가 로드에 실패하면 API가 오류 정보를 제공합니다.

AdLoadState values

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

Example

- (void)didLoadAd:(MAAd *)ad
{
  NSLog(@"Waterfall Name: %@ and Test Name: %@", ad.waterfall.name, ad.waterfall.testName);
  NSLog(@"Waterfall latency was: %f seconds", ad.waterfall.latency);

  for (MANetworkResponseInfo *networkResponse in ad.waterfall.networkResponses)
  {
    NSLog(@"Network -> %@", networkResponse.mediatedNetwork);
    NSLog(@"...adLoadState: %ld", (long) networkResponse.adLoadState);
    NSLog(@"...latency: %f seconds", networkResponse.latency);
    NSLog(@"...credentials: %@", networkResponse.credentials);
    if (networkResponse.error) {
      NSLog(@"...error: %@", networkResponse.error);
    }
  }
}

- (void)didFailToLoadAdForAdUnitIdentifier:(NSString *)adUnitIdentifier withError:(MAError *)error
{
  if (!error.waterfall) {
    return;
  }

  MAAdWaterfallInfo *waterfall = error.waterfall;
  NSLog(@"Waterfall Name: %@ and Test Name: %@", waterfall.name, waterfall.testName);
  NSLog(@"Waterfall latency was: %f seconds", waterfall.latency);

  for (MANetworkResponseInfo *networkResponse in waterfall.networkResponses)
  {
    NSLog(@"Network -> %@", networkResponse.mediatedNetwork);
    NSLog(@"...latency: %f seconds", networkResponse.latency);
    NSLog(@"...credentials: %@", networkResponse.credentials);
    if (networkResponse.error) {
      NSLog(@"...error: %@", networkResponse.error);
    }
  }
}

waterfall이 비어 있는 경우 MAError.waterfallnil을 반환하므로 waterfall 속성을 쿼리할 수 없습니다. 그러나 requestLatency를 통해 빈 waterfall에 대한 ad load 지연 시간을 가져올 수 있습니다:

- (void)didLoadAd:(MAAd *)ad
{
  NSLog(@"Succesful ad load latency: %f seconds", ad.requestLatency);
}

- (void)didFailToLoadAdForAdUnitIdentifier:(NSString *)adUnitIdentifier withError:(MAError *)error
{
  NSLog("Failed ad load latency: %f seconds", error.requestLatency);
}

Customize banner / MREC ad refresh

Ad Unit UI에서 구성할 수 있는 것처럼, 연동 코드에서 직접 banner 및 MREC 광고 refresh 주기를 맞춤 설정할 수 있습니다. 최소 refresh 주기는 10초입니다. 최대 refresh 주기는 120초입니다. MAX는 이 제한을 벗어나는 값을 무시합니다. 다음 코드 샘플은 이러한 refresh 주기를 맞춤 설정하는 방법을 보여줍니다:

// Where adView is an instance of MAAdView
[adView setExtraParameterForKey: @"ad_refresh_seconds" value: «ad-refresh-rate»];

Audio settings

interstitial 및 rewarded 광고 오디오가 앱의 백그라운드 오디오를 방해하지 않도록 하려면, 광고를 표시하기 전에 앱의 백그라운드 오디오를 중지하는 것을 권장합니다. 광고를 숨긴 후 앱의 백그라운드 오디오를 재개할 수 있습니다.

- (void)didDisplayAd:(MAAd *)ad
{
  // Pause your app's background audio
}

- (void)didHideAd:(MAAd *)ad
{
  // Resume your app's background audio
}

search