각 ad unit에 placement 이름을 설정할 수 있습니다 (예: “Rewarded VideoLevels”, “INTER_levelEnd”, 또는 “RewardedVideoCoinStore”). 이를 통해 다양한 placement 카테고리에 대한 통계를 수집할 수 있습니다. 다음 스니펫은 다양한 광고 포맷에 대해 placement 이름을 설정하는 방법을 보여줍니다.
banner 및 MREC의 경우 banner 또는 MREC를 로드하기 전에 placement 이름을 설정해야 합니다.
adView.placement = @"«placement»";
[adView loadAd];
adView.placement = "«placement»"
adView.loadAd()
[interstitialAd showAdForPlacement: @"«placement»"];
interstitial.show(forPlacement: "«placement»")
[rewardedAd showAdForPlacement: @"«placement»"];
rewardedAd.show(forPlacement: "«placement»")
nativeAdLoader.placement = @"«placement»";
nativeAdLoader.placement = "«placement»"
MAAdPlacerSettings *settings = [MAAdPlacerSettings settingsWithAdUnitIdentifier: @"«ad-unit-ID»"];
settings.placement = @"«placement»";
let settings = MAAdPlacerSettings(adUnitIdentifier: "«ad-unit-ID»")
settings.placement = "«placement»"
앱을 실행할 때 일부 mediated SDK network의 오디오를 음소거할 수 있습니다. AppLovin SDK를 통해 이 기능을 지원하는 network는 다음과 같습니다.
다른 network의 경우, 해당 network의 담당 팀에 문의하여 이 기능의 지원 여부 및 액세스 방법을 확인하십시오.
다음 코드 스니펫은 이 기능을 지원하는 network에서 오디오를 음소거하는 방법을 보여줍니다:
ALSdk *sdk = [ALSdk shared];
sdk.settings.muted = YES; // to mute
sdk.settings.muted = NO; // to unmute
let sdk = ALSdk.shared()
sdk.settings.isMuted = true /// to mute
sdk.settings.isMuted = false /// to unmute
광고를 로드하기 전에 음소거 상태를 설정하십시오. 일부 network(예: Google bidding 및 Google AdMob)는 광고 로드 전의 음소거 상태에 따라 음소거되거나 음소거되지 않은 비디오를 반환합니다.
참고: 광고를 음소거하면 광고 수익이 감소할 수 있습니다.
verbose logging을 활성화하는 방법에는 두 가지가 있습니다.
SDK의 settings 객체에서 isVerboseLoggingEnabled 플래그를 YES로 설정하여 verbose logging을 활성화할 수 있습니다:
[ALSdk shared].settings.verboseLoggingEnabled = YES;
ALSdk.shared().settings.isVerboseLoggingEnabled = true
애플리케이션의 Info.plist에서 AppLovinVerboseLoggingOn을 YES로 설정하여 verbose logging을 활성화할 수도 있습니다.

verbose log가 활성화되었는지 확인하려면 AppLovin SDK 로그의 초기화 섹션에서 Verbose Logging On: true라는 줄을 확인하십시오.
AppLovin SDK
Version: 12.4.2
⋮
Verbose Logging On: true
⋮
AppLovin SDK는 로그에 “/AppLovinSdk: [AppLovinSdk]” 태그를 지정합니다.
mediated network에서 노출된 광고의 creative ID와 network name을 가져올 수 있습니다. 자세한 내용은 Creative Debugger 설명서를 참조하십시오.
다음과 같은 코드를 사용하여 AppLovin Exchange에서 서빙된 MAX 광고의 DSP 이름을 가져올 수 있습니다:
- (void)didLoadAd:(MAAd *)ad
{
NSLog(@"AppLovin Exchange DSP name: %@", ad.DSPName);
}
func didLoad(_ ad: MAAd)
{
print("AppLovin Exchange DSP name: (ad.dspName?)")
}
클라이언트 측에서 impression-level user revenue 데이터에 액세스할 수 있습니다. 이 데이터를 사용하여 다양한 소스 및 캠페인을 비교할 수 있습니다. 또한 MAX user revenue API를 사용하여 이 데이터에 액세스할 수도 있습니다. 이 데이터에 액세스하려는 MMP는 MMP용 impression-level user revenue API 페이지를 참조해야 합니다.
AppLovin 블로그의 “Take Ad-Revenue Attribution to the Next Level With MAX”
지원되는 모든 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
}
func didPayRevenue(_ ad: MAAd)
{
let revenue = ad.revenue // In USD
// Miscellaneous data
let countryCode = ALSdk.shared().configuration.countryCode // "US" for the United States, etc - Note: Do not confuse this with currency code which is "USD"
let networkName = ad.networkName // Display name of the network that showed the ad
let adUnitId = ad.adUnitIdentifier // The MAX Ad Unit ID
let adFormat = ad.format // The ad format of the ad (e.g. BANNER, MREC, INTERSTITIAL, REWARDED)
let placement = ad.placement // The placement this ad's postbacks are tied to
let networkPlacement = ad.networkPlacement // The placement ID from the network that showed the ad
}
ad.revenue가 -1인 경우 이는 오류를 나타냅니다.
다음 예시와 같이 revenue 값에 대한 정밀도 평가(precision evaluation)를 가져올 수도 있습니다:
NSString *revenuePrecision = ad.revenuePrecision;
let revenuePrecision = ad.revenuePrecision
이 정밀도는 다음 값 중 하나를 가집니다.
"publisher_defined""exact""estimated""undefined"""MAAdRequestDelegate를 설정하고, 해당 [didStartAdRequestForAdUnitIdentifier:] 메서드를 구현하고, 해당 대리자를 requestDelegate로 설정하여 광고 요청이 발생하는 시점을 수신 대기할 수 있습니다.
다음 예시는 이러한 “ad request started” 콜백을 구현하는 방법을 보여줍니다:
- (void)didStartAdRequestForAdUnitIdentifier:(NSString *)adUnitIdentifier
{
// Ad request started here
}
func didStartAdRequest(forAdUnitIdentifier adUnitIdentifier: String)
{
// Ad request started here
}
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) {
⋮
}];
let initConfig = ALSdkInitializationConfiguration.configuration(
withSdkKey: "«your-SDK-key»"
) { builder in
builder.mediationProvider = ALMediationProviderMAX
builder.adUnitIdentifiers = ["«ad-unit-ID-1»", "«ad-unit-ID-2»"]
}
ALSdk.shared().initialize(with: initConfig) { sdkConfig in
⋮
}
SDK 키는 AppLovin 대시보드의 Account > General > Keys 섹션에서 확인할 수 있습니다.
selective init을 사용하면 MAX는 명시적으로 지정하지 않은 ad unit이 현재 세션에서 광고를 서빙하지 못하도록 제외합니다.
test mode를 활성화한 경우 selective init은 적용되지 않습니다.
Waterfall Information API는 광고(로드되었거나 로드에 실패한 광고)의 현재 waterfall에 대한 정보를 제공합니다. 이 API는 waterfall의 각 광고에 대한 ad load 상태, 지연 시간(latency), 자격 증명(credentials) 및 mediated network 정보를 반환합니다. waterfall의 광고가 로드에 실패하면 API가 오류 정보를 제공합니다.
| value | explanation |
|---|---|
| 0 | Ad Load Not Attempted |
| 1 | Ad Loaded |
| 2 | Ad Failed To Load |
- (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);
}
}
}
func didLoad(_ ad: MAAd)
{
print("Waterfall Name: (ad.waterfall.name) and Test Name: (ad.waterfall.testName)")
print("Waterfall latency was: (ad.waterfall.latency) seconds")
for networkResponse in ad.waterfall.networkResponses
{
print("Network -> (networkResponse.mediatedNetwork)")
print("...adLoadState: (networkResponse.adLoadState.rawValue)")
print("...latency: (networkResponse.latency) seconds")
print("...credentials: (networkResponse.credentials)")
if let networkError = networkResponse.error
{
print("...error: (networkError)")
}
}
}
func didFailToLoadAd(forAdUnitIdentifier adUnitIdentifier: String, withError error: MAError)
{
guard let waterfall = error.waterfall else {
return
}
print("Waterfall Name: (waterfall.name) and Test Name: (waterfall.testName)")
print("Waterfall latency was: (waterfall.latency) seconds")
for networkResponse in waterfall.networkResponses
{
print("Network -> (networkResponse.mediatedNetwork)")
print("...latency: (networkResponse.latency) seconds")
print("...credentials: (networkResponse.credentials)")
if let networkError = networkResponse.error
{
print("...error: (networkError)")
}
}
}
Waterfall Name: Default Waterfall and Test Name: Control
Waterfall latency was: 4.1710309982299805 seconds
Network -> [MAMediatedNetworkInfo: name=Fyber, adapterClassName=ALInneractiveMediationAdapter, adapterVersion=8.1.1.0, sdkVersion=8.1.1]
...adLoadState: 2
...latency: 0.0057220458984375 seconds
...credentials: ["placement_id": 235786, "app_id": 106516]
...error: [MAAdapterError: errorCode=-5202, errorMessage="Invalid Configuration", thirdPartySdkErrorCode=495, thirdPartySdkErrorMessage="The operation couldn’t be completed. (There is no 235786 spot ID in current app config error 495.)"]
Network -> [MAMediatedNetworkInfo: name=AdMob, adapterClassName=ALGoogleMediationAdapter, adapterVersion=8.13.0.2, sdkVersion=afma-sdk-i-v8.13.0]
...adLoadState: 1
...latency: 3.0903170108795166 seconds
...credentials: ["app_id": ca-app-pub-3555987499620362~1761536714, "event_id": 7f40fb8a9d64cbf1156909a514e53d8181fcf7a3, "placement_id": ca-app-pub-3555987499620362/1638443478]
Network -> [MAMediatedNetworkInfo: name=ironSource, adapterClassName=ALIronSourceMediationAdapter, adapterVersion=7.1.12.0.0, sdkVersion=7.1.12]
...adLoadState: 0
...latency: -1.0 seconds
...credentials: ["placement_id": 1082713, "app_key": 882393cd]
waterfall이 비어 있는 경우 MAError.waterfall은 nil을 반환하므로 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);
}
func didLoad(_ ad: MAAd)
{
print("Successful ad load latency: (ad.requestLatency) seconds")
}
func didFailToLoadAd(forAdUnitIdentifier adUnitIdentifier: String, withError error: MAError)
{
print("Failed ad load latency: (error.requestLatency) seconds")
}
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»];
// Where adView is an instance of MAAdView
adView.setExtraParameter("ad_refresh_seconds", «ad-refresh-rate»)
interstitial 및 rewarded 광고 오디오가 앱의 백그라운드 오디오를 방해하지 않도록 하려면, 광고를 표시하기 전에 앱의 백그라운드 오디오를 중지하는 것을 권장합니다. 광고를 숨긴 후 앱의 백그라운드 오디오를 재개할 수 있습니다.
- (void)didDisplayAd:(MAAd *)ad
{
// Pause your app's background audio
}
- (void)didHideAd:(MAAd *)ad
{
// Resume your app's background audio
}
func didDisplay(_ ad: MAAd)
{
// Pause your app's background audio
}
func didHide(_ ad: MAAd)
{
// Resume your app's background audio
}