전면 동영상 광고

안드로이드 가이드 | 전면 동영상 광고

전면 동영상 광고는 건너뛰기가 가능한 짧은 분량(15~30초)의 동영상 광고로, 높은 eCPM으로 수익화할 수 있습니다. 브랜드와 게임 개발사에서 선호하며, 레벨 승리나 플레이어 대전(PVP) 대기 시간과 같은 상황에 적합합니다. 동영상 광고는 시각, 청각, 동작 요소의 이점을 활용해 몰입도를 높임으로써 인앱 광고 경험을 향상시킵니다.

동영상 광고를 생성하려면 전면 광고 배치를 사용해야 합니다. 전면 광고 배치를 생성하면 InMobi 포탈에서 고정 이미지 광고와 동영상 광고를 모두 노출할지, 동영상 광고만 노출할지 선택할 수 있습니다.

또한, 건너뛰기가 가능한 동영상 광고를 표시할지, 사용자가 Wifi 접속 시에만 광고를 표시할지 선택할 수 있는 고급 기능을 이용할 수 있습니다.

간단한 과정을 통해 동영상 광고 수익화를 시작해 보십시오.

전체 화면 동영상 광고 설정

  1. 전체 화면 동영상 광고를 표시하려면 전면 광고 배치 ID가 필요합니다.
  2. 앱을 추가한 후 INTERSTITIAL AD를 선택하여 전면 광고 유형에 맞는 배치를 생성합니다.
  3. 배치를 생성하면 배치 ID를 사용할 수 있습니다.

전체 화면 동영상 광고를 앱에 추가

전체 화면 동영상 광고 생성

전면 광고를 생성하려면 InMobiInterstitial의 인스턴스를 생성합니다.

InMobiInterstitial interstitialAd = new InMobiInterstitial(InterstitialAdsActivity.this, 1471550843414L, mInterstitialAdListener);
	

여기에서 mInterstitialAdListenerInterstitialAdListener2 인터페이스의 구현체입니다. 전면 광고를 생성하려면 필수적으로 이 인터페이스의 구현체를 제공해야 합니다.

참고:

  • SDK 6.0.0 이후 버전에서는 Activity 컨텍스트를 InMobiInterstitial 생성자에 전달해야 합니다.
  • Application 또는 Service 컨텍스트를 사용하여 InMobiInterstitial을 생성하려고 할 경우 실패할 수 있습니다.
  • InMobiInterstitial 클래스는 스레드 안정성이 없습니다. 전면 광고 인스턴스는 반드시 UI 스레드에서 생성해야 합니다.
  • 마찬가지로 이 인스턴스 상의 모든 메소드는 해당 UI 스레드에서 호출해야 합니다. 그렇지 않을 경우 예기치 못하게 작동할 수 있으며 InMobi 수익화 기능에 영향을 미칠 수 있습니다.

InterstitialAdListener2 인터페이스를 통해 전면 광고의 주요 수명 주기 이벤트를 리스닝하게 됩니다. 이와 같은 이벤트를 리스닝해야 앱이 다양한 수명 주기 트랜지션을 올바르게 처리할 수 있습니다.

/**
* Listener for receiving notifications during the lifecycle of an interstitial.
*/
public abstract class InterstitialAdEventListener {
   /**
    * Called to indicate that an ad was loaded and it can now be shown. This will always be called
    * <strong>after</strong> the {@link #onAdReceived(InMobiInterstitial)} callback.
    *
    * @param ad Represents the {@link InMobiInterstitial} ad which was loaded
    */
   public void onAdLoadSucceeded(InMobiInterstitial ad) {}
   /**
    * Callback to signal that a request to fetch an ad (by calling
    * {@link InMobiInterstitial#load()} failed. The status code indicating the reason for failure
    * is available as a parameter. You should call {@link InMobiInterstitial#load()} again to
    * request a fresh ad.
    *
    * @param ad Represents the {@link InMobiInterstitial} ad which failed to load
    * @param status Represents the {@link InMobiAdRequestStatus} status containing error reason
    */
   public void onAdLoadFailed(InMobiInterstitial ad, InMobiAdRequestStatus status) {}
   /**
    * Called to indicate that an ad is available in response to a request for an ad (by calling
    * {@link InMobiInterstitial#load()}. Note: This does not * indicate that the ad can be shown yet. Your code should show an ad after the * {@link #onAdLoadSucceeded(InMobiInterstitial)} method is called. Alternately, if you do not * want to handle this event, you must test if the ad is ready to be shown by checking the * result of calling the {@link InMobiInterstitial#isReady()} method.* * @param ad Represents the {@link InMobiInterstitial} ad for which ad content was received */ public void onAdReceived(InMobiInterstitial ad) {} /** * Called to indicate that an ad interaction was observed. * * @param ad Represents the {@link InMobiInterstitial} ad on which user clicked * @param params Represents the click parameters */ public void onAdClicked(InMobiInterstitial ad, Map<object,> params) {} /** * Called to indicate that the ad will be launching a fullscreen overlay. * * @param ad Represents the {@link InMobiInterstitial} ad which will display */ public void onAdWillDisplay(InMobiInterstitial ad) {} /** * Called to indicate that the fullscreen overlay is now the topmost screen. * * @param ad Represents the {@link InMobiInterstitial} ad which is displayed */ public void onAdDisplayed(InMobiInterstitial ad) {} /** * Called to indicate that a request to show an ad (by calling {@link InMobiInterstitial#show()} * failed. You should call {@link InMobiInterstitial#load()} to request for a fresh ad. * * @param ad Represents the {@link InMobiInterstitial} ad which failed to show */ public void onAdDisplayFailed(InMobiInterstitial ad) {} /** * Called to indicate that the fullscreen overlay opened by the ad was closed. * * @param ad Represents the {@link InMobiInterstitial} ad which was dismissed */ public void onAdDismissed(InMobiInterstitial ad) {} /** * Called to indicate that the user may leave the application on account of interacting with the ad. * * @param ad Represents the {@link InMobiInterstitial} ad */ public void onUserLeftApplication(InMobiInterstitial ad) {} /** * Called to indicate that rewards have been unlocked. * * @param ad Represents the {@link InMobiInterstitial} ad for which rewards was unlocked * @param rewards Represents the rewards unlocked */ public void onRewardsUnlocked(InMobiInterstitial ad, Map<object, object=""> rewards) {} }</object,></object,>

전체 화면 동영상 광고 불러오기

전면 광고를 요청하려면 InMobiInterstitial 인스턴스에서 load() 메소드를 호출합니다.

interstitialAd.load();
	

귀하의 신청서는 InterstitialAdEventListener 추상 클래스를 통해이 요청의 결과를 통보 받게됩니다. 광고를 성공적으로 요청하면 onAdReceived(InMobiInterstitial) 이벤트가 발생됩니다. 이후에 onAdLoadSucceeded 또는 onAdLoadFailed 이벤트가 발생하게 됩니다.

onAdLoadFailed 이벤트가 발생할 경우, 이 이벤트에서 전달된 InMobiAdRequestStatus 오브젝트에 의해 사유가 표시됩니다.

onAdLoadSucceeded 이벤트가 발생하면 이후에 InMobiInterstitial 인스턴스에서 show()를 호출하여 언제든지 광고를 표시할 수 있습니다.

참고: SDK에 의해 onAdLoadSucceeded 이벤트가 발생한 후 동일한 전면 광고에서 load()를 호출할 경우 네트워크에서 새로운 광고를 요청하지 못할 수 있습니다. 새로운 광고는 SDK에서 이전 광고를 삭제하거나, 광고가 만료되었거나, 사용자가 앱 데이터 및 캐시를 삭제한 경우에만 가져올 수 있습니다.

전체 화면 동영상 광고 표시

전면 광고를 표시하려면 SDK에 onAdLoadSucceeded 이벤트가 발생된 후 아무 때나 InMobiInterstitial 인스턴스에서 show()를 호출합니다.

아래 코드 프래그먼트는 이 과정을 보여줍니다.

InterstitialAdEventListener mInterstitialAdEventListener = new InterstitialAdEventListener() {
        // implementation for other events
        // onAdReceived, onAdLoaFailed, etc
        @Override
        public void onAdLoadSucceeded(InMobiInterstitial inMobiInterstitial) {
            Log.d(TAG, "Ad can now be shown!");
            mCanShowAd = true;
        }
    };
   void init() {
       InMobiInterstitial interstitialAd = new InMobiInterstitial(GameActivity.this, 1471550843414L, mInterstitialAdEventListener);
   }
   void prepareGameLevel() {
       interstitialAd.load();
   }
   void handleGameLevelCompleted() {
        If (mCanShowAd) interstitialAd.show();
   }
	

귀하의 신청서는 InterstitialAdEventListener 추상 클래스를 통해이 요청의 결과를 통보 받게됩니다.

광고를 표시할 수 있는 경우, SDK가 onAdWillDisplay 인터페이스에서 호출한 다음 광고가 실제로 화면에 표시될 때 onAdDisplayed 메소드를 호출하여 코드를 알립니다.

광고를 표시할 수 없는 경우, SDK에 onAdDisplayFailed 이벤트가 발생하여 광고를 표시할 수 없는 상태임을 앱에 알립니다. load()를 다시 호출하여 이 이벤트를 처리하면 새로운 광고를 요청할 수 있습니다.

전면 광고가 해제되면 onAdDismissed 콜백으로 앱에 알림이 표시됩니다.

애니메이션

애니메이션 리소스 ID를 제공하여 전면 광고의 표시 및 해제를 애니메이션화할 수 있습니다. 이 작업은 show(int, int) 변수를 호출하면 간단하게 수행할 수 있습니다.

interstitialAd.show(R.anim.anim_entry, R.anim.anim_exit);
	

전면 광고 연동용 코드 샘플은 GitHub에서 확인할 수 있습니다.

CreativeID 검색 중

진행되고 있는 모든 광고 품질 검사를 피해나와, 관련성이없고 불쾌한 소재 또는 사용자에게 혼란을주는 광고를 보여줌으로써 앱의 사용자 경험을 손상시키는 불량 광고주가 가끔 있습니다. 이러한 상황을 극복하기 위해 광고 인스턴스의 creativeID를 검색하고 InMobi 담당자에게 암호화 된 creativeID를보고 할 수 있습니다.

mInterstitialAd.getCreativeId()// mInterstitialAd는 예제 인스턴스입니다.

통합 테스트

  1. InMobi 포털에서 테스트 모드를 구성합니다.

    Tools - Diagnostics로 이동하여 Test Mode를 Global ON 또는 Selective ON으로 설정합니다.

    광고를 처음으로 연동하려는 경우 Test ModeGlobal ON으로 설정합니다.
    특정 디바이스에 선택적으로 테스트 트래픽을 활성화하려는 경우

    이미 이 광고에 이전 버전의 SDK를 연동한 적이 있으므로 몇 개의 디바이스에 테스팅을 제한해야 하는 경우
    Test ModeSelective ON으로 설정합니다.

    디바이스 섹션에서:

    1. Device ID 상자에 디바이스 ID를 입력합니다.
    2. Device Name 상자에서 이름을 설정합니다.
    3. Add Device를 클릭하여 테스트 디바이스를 추가합니다.

    이미 구성된 디바이스가 있는 경우, 해당 디바이스를 선택하면 테스트 모드가 활성화됩니다.

    참고: 앱을 정식으로 출시하기 전에 반드시 테스트 모드를 비활성화하십시오. 이를 비활성화하지 않으면 앱을 수익화할 수 없습니다.

    이제 테스트를 진행할 수 있습니다.

    디바이스 ID 확인

    SDK 로그 설정을 통해 디바이스 ID를 디버그 로그를 콘솔에 출력할 수 있습니다. 이를 위해 다음 코드를 광고를 연동하는 액티비티에 추가합니다.

    InMobiSdk.setLogLevel(LogLevel.DEBUG);
    
    

    디바이스 ID가 DDMS 콘솔의 디버그 로그에 출력됩니다.

  2. Diagnostics 탭에서 광고 및 광고 요청에 대한 피드백을 확인할 수도 있으며, 이는 특히 연동 과정에서 유용하게 활용할 수 있습니다.

유용한 디버그 정보

1단계에서 언급한 대로 디버그 로그를 활성화했다면 SDK가 초기화 및 광고 로드 수명 주기와 유용한 관련 정보를 제공하는 주요 로그를 DDMS 콘솔에 출력하게 됩니다.

다음 표는 이러한 로그를 설명합니다.

SDK 초기화

시나리오 로그 수준 로그
Publisher passed null or empty account id (퍼블리셔가 null 또는 빈 계정 ID를 전달함) 오류 Account id cannot be null or empty. Please provide a valid Account id.
Publisher passed a valid account id (퍼블리셔가 올바른 계정 ID를 전달함) 디버그 InMobi SDK initialized with account id:
Publisher Passed an invalid account Id (퍼블리셔가 잘못된 계정 ID를 전달함) 오류 Invalid account id passed to init. Please provide a valid account id.
Publisher did not grant the mandatory permissions (퍼블리셔가 필수 권한을 허용하지 않음) 디버그 Please grant the mandatory permissions : INTERNET & ACCESS_NETWORK_STATE, SDK could not be initialized.
Permissions granted to the SDK (SDK에 권한 허용됨) 디버그 Permissions granted to the SDK are :
Newer version of SDK is available (SDK 버전이 업데이트됨) 디버그 A newer version (ver. 6.0.0) of the InMobi SDK is available! You are currently on an older version (ver. 5.3.1). Download the latest InMobi SDK from http://www.inmobi.com/products/sdk/#downloads

일반적인 광고 수명 주기 메시지

시나리오 로그 수준 로그
Ad requested when no network available (네트워크를 사용할 수 없을 때 광고 요청됨) 오류 로그 수준 Network not reachable currently. Please try again.
Ad requested when ad state is loading or available (광고 상태를 불러오는 중이거나 사용할 수 있을 때 광고 요청됨) 오류 로그 수준 An ad load is already in progress. Please wait for the load to complete before requesting for another ad (Placement id : <placement id="" />).
Ad requested when ad is viewed by user (사용자가 광고를 시청 중일 때 광고 요청됨) 오류 로그 수준 An ad is currently being viewed by the user. Please wait for the user to close the ad before requesting for another ad (Placement id : <placement id="" />).
Publisher device Id (퍼블리셔 디바이스 ID) 디버그 로그 수준 Publisher device id is <device id="" />
Requested ad being returned from cache (캐시로부터 반환 중인 광고 요청됨)   Returning ad from cache for the Placement Id - <placement id="" />
Requested ad being fetched from network (네트워크에서 가져오고 있는 광고 요청됨)   Ad will be fetched from network for the Placement Id - <placement id="" />

전체 화면 동영상 광고 연동 관련 메시지

시나리오 로그 수준 로그
Publisher created an interstitial without initializing the SDK (퍼블리셔가 SDK를 초기화하지 않고 전면 광고를 생성함) 오류 Please initialize the SDK before creating an interstitial ad
Publisher called load on interstitial (퍼블리셔가 전면 광고에 로드를 호출함) 디버그 Fetching an interstitial ad for placement id: <placement id="" />
Successfully fetched ad (광고를 가져옴) 디버그 Interstitial ad successfully fetched for placement id: <placement id="" />
Failed to fetch the ad (광고를 가져오지 못함) 오류 Failed to fetch interstitial ad for placement id: <placement id="" /> with error: <status code="" message="" />
Started loading the interstitial in a webview (전면 광고를 웹뷰로 불러오기 시작함) 디버그 Started loading interstitial ad markup in the webview for placement id: <placement id="" />
Interstitial successfully loaded in the webview (전면 광고를 웹뷰로 불러옴) 디버그 Successfully loaded interstitial ad markup in the webview for placement id: <placement id="" />
Failed to load interstitial in the webview (전면 광고를 웹뷰로 불러오지 못함) 오류 Failed to load interstitial markup in the webview for placement id: <placement id="" />
Failed to load interstitial in the webview due to timeout (타임아웃으로 전면 광고를 웹뷰로 불러오지 못함) 오류 Failed to load interstitial markup in the webview due to timeout for placement id: <placement id="" />
Interstitial Ad displayed (전면 광고 표시됨) 디버그 Successfully displayed Interstitial for placement id:<placement id="" />
Interstitial Ad dismissed (전면 광고 해제됨) 디버그 Interstitial ad dismissed for placement id: <placement id="" />
No Listener specified Set Listener to null in constructor (리스너 지정 안 됨, 생성자의 리스너 null로 설정) 오류 The Ad unit cannot be created as no event listener was supplied. Please attach a listener to proceed
Null context Set Context to null in constructor (Null 컨텍스트, 생성자의 컨텍스트 null로 설정) 오류 Unable to create ad unit with NULL context object
Ad show before ready Show ad before it's ready (준비되지 않은 광고가 표시됨) 오류 Ad Load is not complete. Please wait for the Ad to be in a ready state before calling show The supplied resource id with show for animations is invalid
InMobiAdActivity not added (InMobiAdActivity 추가되지 않음) 오류 Do not declare InMobiAdActivity in manifest file.

SDK에 의해 출력된 로그를 비롯하여 Diagnostics 탭에서 광고 및 광고 요청에 대한 피드백을 확인할 수도 있으며, 이는 특히 연동 과정에서 유용하게 활용할 수 있습니다.

이 페이지가 도움이 되었나요?

이 페이지에서

마지막 업데이트 날짜: 17 Sep, 2020