Coupang CPM

쿠팡 네이티브 광고 미디에이션 레이아웃 가이드 입니다. AdPopcornSSP v3.5.3 버전부터 지원합니다.

  • coupang_native_ad_unit_layout.xml 샘플

<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/call_to_action"
    android:layout_width="300dp"
    android:layout_height="250dp"
    android:background="@drawable/bg_banner_item_radius">


    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginTop="18dp"
        android:lineSpacingExtra="3sp"
        android:text="이런건 어때요?"
        android:textColor="#111111"
        android:textSize="16sp"
        android:textStyle="bold"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />


    <ImageView
        android:id="@+id/logo"
        android:layout_width="63dp"
        android:layout_height="14dp"
        android:layout_marginTop="20dp"
        android:layout_marginEnd="8dp"
        android:src="@drawable/ic_ads_coupang_logo_350x80"
        app:layout_constraintEnd_toStartOf="@+id/opt_out"
        app:layout_constraintTop_toTopOf="parent" />


    <com.coupang.ads.view.image.RoundImageView
        android:id="@+id/main_image"
        android:layout_width="110dp"
        android:layout_height="110dp"
        android:layout_marginTop="53dp"
        android:layout_marginEnd="16dp"
        android:scaleType="centerCrop"
        android:src="@drawable/ic_ads_placeholder_loading"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:radius="4dp" />


    <TextView
        android:id="@+id/title"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginTop="53dp"
        android:layout_marginEnd="10dp"
        android:ellipsize="end"
        android:maxLines="2"
        android:textColor="#111111"
        android:textSize="14sp"
        android:textStyle="normal"
        app:layout_constraintEnd_toStartOf="@id/main_image"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"/>


    <com.coupang.ads.custom.widget.AdsProductStarRating
        android:id="@+id/rating"
        style="@style/StarRating.Medium"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginTop="10dp"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/title"/>

    <TextView
        android:id="@+id/price"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginTop="10dp"
        android:ellipsize="end"
        android:includeFontPadding="false"
        android:maxLines="1"
        android:textAppearance="@style/T6.Regular"
        android:textColor="#cb1400"
        android:textSize="16sp"
        android:textStyle="bold"
        app:layout_constraintEnd_toStartOf="@+id/main_image"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/rating" />


    <ImageView
        android:id="@+id/deliver"
        android:layout_width="56dp"
        android:layout_height="14dp"
        android:layout_marginStart="16dp"
        android:layout_marginTop="6dp"
        android:scaleType="centerCrop"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/price" />

    <TextView
        android:id="@+id/positive"
        android:layout_width="268dp"
        android:layout_height="38dp"
        android:layout_margin="16dp"
        android:background="@drawable/bg_bt_blue"
        android:gravity="center"
        android:text="바로가기 >"
        android:textColor="@color/rds_blue_600"
        android:textSize="14sp"
        android:textStyle="bold"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

    <ImageView
        android:id="@id/opt_out"
        style="@style/AdsOptOutImageView"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>

xml에서 생성한 ui component를 sdk에서 제공하는 setCoupangViewBinder API를 이용해 아래와 같이 설정해 줍니다.

CoupangViewBinder coupangViewBinder = new CoupangViewBinder.Builder(R.id.coupang_ads_native_view, R.layout.coupang_native_ad_unit_layout)
                .optOutViewId(R.id.opt_out)
                .deliverViewId(R.id.deliver)
                .logoViewId(R.id.logo)
                .callToActionViewId(R.id.call_to_action)
                .mainImageViewId(R.id.main_image)
                .priceViewId(R.id.price)
                .ratingViewId(R.id.rating)
                .titleViewId(R.id.title)
                .build();
adPopcornSSPNativeAd.setCoupangViewBinder(coupangViewBinder);

CoupangViewBinder Builder 생성 시, view id(R.id.coupang_ads_native_view) layout id(R.layout.coupang_native_ad_unit_layout)는 필수로 넘겨주어야 하며, 그 외 ui component에 대해서는 사용하는 리소스에 대해서만 설정해 주면 됩니다.

Last updated