광고 수익
SDK에서 노출 수준 광고 수익 리포트하기
요약 : 앱스플라이어 광고 수익 SDK 커넥터를 사용하면 광고 네트워크에서 노출 수준 세분성을 사용하여 광고 수익을 리포트할 수 있습니다.
개요
광고 수익 리포트 옵션
Ad revenue is reported to AppsFlyer by either aggregate granularity (via API) or impression-level granularity (via SDK). Impression-level data via SDK has better data freshness and earlier availability in AppsFlyer.
이 문서는 앱에서 파트너가 제공하는 노출 수준 광고 수익을 앱스플라이어로 보내는 방법을 자세히 설명합니다.
Reporting ad revenue using the SDK
SDK 작동 원리
광고 수익 SDK 커넥터는 노출 수익 데이터를 앱스플라이어 SDK로 보냅니다. 광고 수익 이벤트 af_ad_revenue가 생성되어 플랫폼으로 전송됩니다. 이러한 노출 이벤트는 앱스플라이어에서 수집 및 처리되며 수익은 원래 UA 소스에 어트리뷰트됩니다.
연동
안드로이드 광고 수익 SDK 커넥터를 통합하려면 SDK를 가져와서 초기화하고 트리거해야 합니다.
Import the Android ad revenue SDK
- 다음 코드를 모듈 수준 / app/build.gradle 파일의 dependencies 앞에 추가합니다:
repositories {
mavenCentral()
}
- 광고 수익 라이브러리를 종속 항목으로 추가합니다.
dependencies {
implementation 'com.appsflyer:adrevenue:6.9.0'
}
- 프로젝트를 동기화하여 종속성을 검색합니다.
Initialize the Android ad revenue SDK
- 앱 글로벌 클래스에서
onCreate
메서드, 호출initialize
, 다음 코드를 구현합니다:
import com.appsflyer.adrevenue.AppsFlyerAdRevenue;
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
AppsFlyerAdRevenue.Builder afRevenueBuilder = new AppsFlyerAdRevenue.Builder(this);
AppsFlyerAdRevenue.initialize(afRevenueBuilder.build());
Trigger the logAdRevenue API call
- 필수 및선택적 인수를 포함하여 모든 유효한 노출에 대해
logAdRevenue
API 호출을 트리거합니다.
// Make sure you import the following:
import com.appsflyer.adrevenue.adnetworks.AppsFlyerAdNetworkEventType;
import com.appsflyer.adrevenue.adnetworks.generic.MediationNetwork;
import com.appsflyer.adrevenue.adnetworks.generic.Scheme;
import java.util.Currency;
import java.util.HashMap;
import java.util.Locale;
// Create optional customParams
Map<String, String> customParams = new HashMap<>();
customParams.put(Scheme.COUNTRY, "US");
customParams.put(Scheme.AD_UNIT, "89b8c0159a50ebd1");
customParams.put(Scheme.AD_TYPE, AppsFlyerAdNetworkEventType.BANNER.toString());
customParams.put(Scheme.PLACEMENT, "place");
customParams.put(Scheme.ECPM_PAYLOAD, "encrypt");
customParams.put("foo", "test1");
customParams.put("bar", "test2");
// Record a single impression
AppsFlyerAdRevenue.logAdRevenue(
"ironsource",
MediationNetwork.googleadmob,
Currency.getInstance(Locale.US),
0.99,
customParams
);
최신 데이터 5일 전