Ad Revenue Generic Connector

개요

광고 수익 리포트 옵션

광고 수익은 집약 세분성(API를 통해) 또는 노출 수준 세분성(SDK를 통해)에 의해 앱스플라이어에 리포트됩니다. SDK를 통한 노출 수준 데이터는 앱스플라이어에서 더 나은 데이터 최신성과 더 빠른 가용성을 제공합니다.

SDK 작동 원리

The ad revenue SDK connector sends impression revenue data to the AppsFlyer SDK. An ad revenue event, af_ad_revenue, is generated and sent to the platform. These impression events are collected and processed in AppsFlyer, and the revenue is attributed to the original UA source.

Install the connector

Prerequisite: Before installing the connector update your SDK and the AppsFlyer Unity plugin to their latest versions.

Using Unity Package

  1. Clone or download the Ad revenue connector repository.
  2. Import the Adrevenue Unity package into your Unity project (To learn how to import to Unity refer to the Unity documentation).
    1. In Unity, go to Assets > Import Package > Custom Package
    2. From the repository root select the appsflyer-unity-adrevenue-plugin-x.x.x.unitypackage file.

Unity 패키지 관리자 사용

  1. Add the dependency in your manifest.json file:
 "appsflyer-unity-adrevenue-generic-connector": "https://github.com/AppsFlyerSDK/appsflyer-unity-adrevenue-generic-connector.git#upm"
  1. If you haven't already done so, download the External Dependency Manager for Unity to be able to resolve our Android / iOS dependencies.

Note: To choose a specific version and not the latest, you can replace the upm with the specific version tag, v6.9.4-upm for example.

Initialize the connector

Make sure to initialize the AppsFlyer SDK before initializing the connector.

using AppsFlyerSDK;

public class AppsFlyerObjectScript : MonoBehaviour
{
  void Start()
  {
  	AppsFlyerAdRevenue.start();
  	/* AppsFlyerAdRevenue.setIsDebug(true); */
  }
}

Ad revenue connector API

start

public static void start()

Start sending AdRevenue data to AppsFlyer.

예:

using AppsFlyerSDK;
  void Start()
  {
    AppsFlyerAdRevenue.start();
  }

setIsDebug

public static void setIsDebug(bool isDebug)

Set to true to view debug logs. (development only!)

parametertypedescription
isDebugboolset to true in development only

예:

  AppsFlyerAdRevenue.setIsDebug(true);

Note: This API will only set the debug logs for iOS. For Android the debug logs are controlled by the native SDK.
To turn on the debug logs on Android call AppsFlyer.setIsDebug(true);

logAdRevenue

public static void logAdRevenue(string monetizationNetwork, AppsFlyerAdRevenueMediationNetworkType mediationNetwork, double eventRevenue, string revenueCurrency, Dictionary<string, string> additionalParameters)

Send ad revenue data from the impression payload to AppsFlyer regardless of the mediation network you use.

parametertypedescription
monetizationNetworkstringmonetization network
mediationNetworkAppsFlyerAdRevenueMediationNetworkTypeEnum for mediaton network type
eventRevenuestringevent revenue
revenueCurrencystringrevenue currency
additionalParametersDictionary<string, string>Any custom additional parameters

예:

Dictionary<string, string> additionalParams = new Dictionary<string, string>();
additionalParams.Add(AFAdRevenueEvent.COUNTRY, "US");
additionalParams.Add(AFAdRevenueEvent.AD_UNIT, "89b8c0159a50ebd1");
additionalParams.Add(AFAdRevenueEvent.AD_TYPE, "Banner");
additionalParams.Add(AFAdRevenueEvent.PLACEMENT, "place");
additionalParams.Add(AFAdRevenueEvent.ECPM_PAYLOAD, "encrypt");

additionalParams.Add("custom", "foo");
additionalParams.Add("custom_2", "bar");
additionalParams.Add("af_quantity", "1");
AppsFlyerAdRevenue.logAdRevenue("facebook",
                                AppsFlyerAdRevenueMediationNetworkType.AppsFlyerAdRevenueMediationNetworkTypeGoogleAdMob,                                   
                                0.026,
                                "USD",
                                additionalParams);