> 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-2/extra-guide/coupang/undefined.md).

# 쿠팡 포스트백 연동

## 1. 트래킹 링크

애드팝콘 SSP 사업팀이 제공하는 아래 형태의 트래킹 링크를 사용하여 캠페인 집행 시, 포스트백을 전달해 드립니다.

* `https://link.coupang.com/re/AFFGOLDBOX?lptag=AF1036751&subid=`<mark style="color:red;">`{subid}`</mark>`&subparam=`<mark style="color:red;">`{bid}`</mark>`&publisherid=`<mark style="color:red;">`{publisher_id}`</mark>`&adid=`<mark style="color:red;">`{adid}`</mark>`&idfa=`<mark style="color:red;">`{idfa}`</mark>

<table><thead><tr><th width="142">Parameter</th><th width="338">설명</th><th width="73" align="center">필수</th><th>예시</th></tr></thead><tbody><tr><td>subid</td><td>매체 구분용 코드(애드팝콘 SSP 사업팀에서 일괄 발급하여, 하드코딩하여 사용)</td><td align="center"><mark style="color:red;">Y</mark></td><td>CPSep1</td></tr><tr><td>bid</td><td>매체에서 포스트백 전달 받을 때, 돌려받고자 하는 unique 클릭 id</td><td align="center">N</td><td>202010080823393754d2bf4</td></tr><tr><td>publisher_id</td><td>매체의 퍼블리셔 id</td><td align="center">N</td><td>com.test.app</td></tr><tr><td>adid</td><td>google advertising ID</td><td align="center">N</td><td>8c6cbcod-5f43-4765-a6e6-84dff3d24707</td></tr><tr><td>idfa</td><td>Identifier For Advertising</td><td align="center">N</td><td>8c6cbcod-5f43-4765-a6e6-84dff3d24707</td></tr></tbody></table>

## 2. 이벤트 포스트백

위 트래킹 링크를 통해 발생한 구매, 취소 이벤트에 대해 아래와 같은 정보를 포스트백으로 전달해 드립니다.

아래 두 가지 예시 중 원하시는 포스트백 형태를 선택하신 뒤 endpoint를 전달해 주시기 바랍니다.

### 1) 각 상품 별 개별 포스트백

* `https://`<mark style="color:red;">`{매체포스트백endpoint}`</mark>`?subid=`<mark style="color:red;">`{subid}`</mark>`&bid=`<mark style="color:red;">`{bid}`</mark>`&order_id=`<mark style="color:red;">`{order_id}`</mark>`&product_id=`<mark style="color:red;">`{product_id}`</mark>`&price=`<mark style="color:red;">`{price}`</mark>`&quantity=`<mark style="color:red;">`{quantity}`</mark>`&event_name=`<mark style="color:red;">`{event_name}`</mark>`&datetime=`<mark style="color:red;">`{event_time_epoch}`</mark>`&currency=`<mark style="color:red;">`{currency}`</mark>`&adid=`<mark style="color:red;">`{adid}`</mark>`&idfa=`<mark style="color:red;">`{idfa}`</mark>

### 2) 주문 번호 별 포스트백

* `https://`<mark style="color:red;">`{매체포스트백endpoint}`</mark>`?subid=`<mark style="color:red;">`{subid}`</mark>`&bid=`<mark style="color:red;">`{bid}`</mark>`&event_items=`<mark style="color:red;">`{event_items}`</mark>`&event_name=`<mark style="color:red;">`{event_name}`</mark>`&datetime=`<mark style="color:red;">`{event_time}`</mark>`&adid=`<mark style="color:red;">`{adid}`</mark>`&idfa=`<mark style="color:red;">`{idfa}`</mark>

### 전체 매크로 리스트

{% hint style="info" %}
매크로는 `{` 로 시작하고 `}` 로 종료되고,  변수와 함수로 구분됩니다\
함수 설명은 아래에서 계속됩니다.\
\
<http://my.pc.com/conversion?bid={bid}\\&event\\_name={event\\_name:upper}\\&event\\_items={event\\_items:b64\\_encode,url\\_encode}>
{% endhint %}

| **매크로명**                    | **설명**                        | **비고**                                                                             |
| --------------------------- | ----------------------------- | ---------------------------------------------------------------------------------- |
| bid, bidid, bid\_id         | unique 클릭 ID                  |                                                                                    |
| sub, subid, sub\_id         | 매체 구분용 코드                     |                                                                                    |
| adid                        | Google Advertising Identifier |                                                                                    |
| idfa                        | Identifier for Advertisers    |                                                                                    |
| pkg, package, package\_name | 패키지명                          | com.coupang.mobile                                                                 |
| event\_name                 | 이벤트명                          | order, cancel                                                                      |
| event\_items                | order\_id 기준 구매 내역 리스트        | <p><code>url\_encoded</code> 함수 필수<br><code>{event\_items:url\_encoded}</code></p> |
| event\_time                 | 이벤트 발생시간                      | yyyyMMddHHmmss                                                                     |
| event\_time\_epoch          | 이벤트 발생시간                      | epoch time                                                                         |
| orderid, order\_id          | 주문번호                          |                                                                                    |
| product\_name               | 상품번호                          |                                                                                    |
| currency                    | 통화                            |                                                                                    |
| revenue                     | 구매 내역 리스트의 총 합계 금액            | 주문취소 시 -금액                                                                         |
| price                       | 상품가격                          |                                                                                    |
| quantity                    | 수량                            |                                                                                    |
| adid\|idfa                  | adid 또는 idfa                  |                                                                                    |
| PurchaseComplete\|Cancel    | PurchaseComplete 또는 Cancel    |                                                                                    |

{% hint style="info" %}
함수 사용 시 매크로명 뒤에 `:함수명` , `,` 로 구분하여 여러번 함수 호출 가능 (순서대로 호출)\
{event\_items:b64\_encode,url\_encode}
{% endhint %}

| **함수명**     | **설명**      |                  |
| ----------- | ----------- | ---------------- |
| upper       | 모두 대문자로 변경  | order => ORDER   |
| lower       | 모두 소문자로 변경  | CANCEL => cancel |
| b64\_encode | base64로 인코딩 |                  |
| url\_encode | url 인코딩     |                  |
