> For the complete documentation index, see [llms.txt](https://adpopcornssp.gitbook.io/ssp-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://adpopcornssp.gitbook.io/ssp-sdk/undefined-1/ap/ap-android/coupangcpm.md).

# CoupangCPM

## SDK 설치&#x20;

* v1.3.0 호환 지원합니다.

```
api "com.coupang:ads:1.3.0"
```

* build.gradle 프로젝트 레벨에 저장소 설정을 추가합니다.

```xml
allprojects {
    repositories {
        maven {
            url "https://raw.githubusercontent.com/coupang-ads-sdk/android/main"
        }
    }
}
```

## AndroidManifest.xml 설정

SDK의 정상 동작을 위해선  AnroidManifest.xml 파일 내에 Key-Value 값을 설정해야 합니다.

입력해야 되는 키 값에 대해서는 사업팀(<monetize@adpopcorn.com>)에 문의해 주세요.

```xml
<meta-data android:name="coupang_ads_affiliate_id"
            android:value="YOUR_COUPANG_AFFILAIATE_ID"/>
<meta-data android:name="coupang_ads_sub_id"
            android:value="YOUR_COUPANG_ADS_SUB_ID"/>
```

## 기본설정

#### 쿠팡 미디에이션 추가 시, Activity 화면에서 배너, 전면 광고를 연동하고자 할 경우, Activity에 <mark style="color:red;background-color:red;">`LifecycleOwner`</mark> 를 구현해야 광고가 노출될 수 있습니다. ComponentActivity 사용 시에는 아래 추가 연동이 필요 없습니다.

```java
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.LifecycleRegistry;

public class MainActivity extends Activity implements LifecycleOwner {
    private final LifecycleRegistry lifecycleRegistry = new LifecycleRegistry(this);
	
    protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_CREATE);
    }		
	
    @Override
    protected void onStart() {
        super.onStart();
        lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_START);
    }

    @Override
    protected void onResume() {
        super.onResume();
        lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_RESUME);
    }

    @Override
    protected void onPause() {
        super.onPause();
        lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_PAUSE);
    }

    @Override
    protected void onStop() {
        super.onStop();
        lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_STOP);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        lifecycleRegistry.handleLifecycleEvent(Lifecycle.Event.ON_DESTROY);
    }

    @Override
    public Lifecycle getLifecycle() {
        return lifecycleRegistry;
    }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://adpopcornssp.gitbook.io/ssp-sdk/undefined-1/ap/ap-android/coupangcpm.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
