跳转到内容

User-Level Ad Revenue API

Use this API to retrieve user-level revenue data. You can retrieve this data aggregated for a particular user or with one row per impression.

用户层级收入数据会在 UTC 日结束 8 小时后提供。例如,UTC 时间 2019 年 01 月 01 日的数据可在 UTC 时间 2019 年 01 月 02 日 08:00 之后获得。

You can share user-level and impression-level ad revenue data with your mobile measurement partner of choice, such as Adjust, AppsFlyer, GameAnalytics or Singular, for all supported networks. You can also access impression-level user revenue data on the client side. You can read more about this in SDK Integration Guides > Platform > Overview > Advanced Settings.

MAX posts data to a tracking URL of your choosing, whenever it records a MAX impression, with a Server-to-Server Impression Revenue API. See the S2S Impression Revenue API documentation page for more information.

Request Format

Target URL

https://r.applovin.com/max/userAdRevenueReport?api_key=«report-key»&date=«report-day»&platform=«app-platform»&application=«app-package-name»&store_id=«app-store-ID»&aggregated=«is-aggregated»

Request Parameters

NameDescriptionExample
aggregatedWhether the API should aggregate the data (per user) or not (per impression). Defaults to true.false
api_keyReport Key, for authentication.tgCe3d7SFRU0S…304ZKs6ba
applicationApplication package name (for Android) or bundle ID (for iOS). (You cannot use this parameter if you define store_id)com.mycompany.application
date1Day to return data for, in «YYYY»-«MM»-«DD» format.2019-02-06
platformApplication platform: android, fireos, or ios.android
store_idThe numeric part of the iTunes ID on iOS, or the app’s package name on Android. If you do not know the iTunes ID, use the bundle ID instead. You cannot use this parameter if you define application.1207472156

1 This API has a request window of 45 days. Make sure the date parameters are in the last 45 days.

Response Format

Response Body

{
"status": 200,
"url": "https://applovin-externalreports.s3.amazonaws.com/%2Fmediation_reports/report_date%3D1549756800/pub_id%3D12345/mediation_app_id%3D12345/user_report.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20190216T000208Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3599&X-Amz-Credential=dataio.amazon.s3.access_key%2F20190216%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=e45bdfbd88cbcf4e[…]927dd"
"ad_revenue_report_url": "https://applovin-externalreports.s3.amazonaws.com/%2Fmediation_reports/report_date%3D1549756800/pub_id%3D12345/mediation_app_id%3D12345/user_report.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20190216T000208Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3599&X-Amz-Credential=dataio.amazon.s3.access_key%2F20190216%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=e45bdfbd88cbcf4e[…]927dd"
}

Response Parameters

NameDescription
ad_revenue_report_urlLocation of the CSV file with all revenue including estimated Meta Audience Network Bidding data.
fb_estimated_revenue_urlLocation of the CSV file with only estimated Meta Audience Network Bidding data. Please note that these numbers may differ from actuals since Meta Audience Network Bidding data is calculated using estimated revenue data. This option is only available on aggregated requests.
statusStatus of the request: 200 if a user report can be accessed.
urlLocation of the CSV file that excludes estimated Meta Bidding data.

User-Level Revenue Data CSV Format

Examples

Ad Unit ID,Placement,IDFA,IDFV,User Id,Impressions,Revenue
da39a3ee5e6b4b0,home_screen,04034992-E5AA-4BA1-890C-5075B2504050,4F2A07BC-315B-11E9-B210-D663BD873D93,20349,27,5.000025
da39a3ee5e6b4b0,level_end,12309422-331C-41A3-9BF5-2D7D1C04A4E0,4F2A0A6E-315B-11E9-B210-AD023491FF20,,11,0.006100

Fields

NameDescription
Ad FormatINTER, BANNER, REWARD (Non-Aggregated only).
Ad PlacementThe placement ID of the external ad network that showed the ad (Non-Aggregated only).
Ad Unit IDID of the MAX Ad Unit that generated the revenue.
Ad Unit NameName of the MAX Ad Unit that generated the revenue (Non-Aggregated only).
CountryThe two-letter country code of the impression (Non-Aggregated only).
Custom DataCustom data passed in from the integration.
DateTime of the impression (Non-Aggregated only).
Device TypePHONE, TABLET (Non-Aggregated only).
IDFAAdvertising identifier: IDFA for iOS devices, GAID for Android devices.
IDFVIdentifier for vendor.
ImpressionsThe number of ads displayed to the user (Aggregated only).
NetworkThe Ad Network that generated the impression. You can find Ad Network values in the “Network API Name” column of this table. (Non-Aggregated ad_revenue_report_url only)
PlacementThe Ad Placement Name where the user generated impressions and revenue.
RevenueThe revenue generated by the user, in USD, expressed with six-decimal precision.
User IDOptional ID of the user, set via the AppLovin SDK. (See the “Setting an Internal User ID” section below.)
WaterfallMAX ad unit waterfall name (Non-Aggregated only).

Setting an Ad Placement Name

下面的代码片段展示了如何向广告单元添加广告位名称。 广告位名称的值会替换回调请求中的 {PLACEMENT} 宏:

ActionScript
AppLovinMAX.setBannerPlacement(«ad-unit-ID», «placement»);
C++
UAppLovinMAX::CreateBanner(«ad-unit-ID», «position»);
UAppLovinMAX::SetBannerPlacement(«ad-unit-ID», «placement»);
C#
MaxSdk.CreateBanner(«ad-unit-ID», «position»);
MaxSdk.SetBannerPlacement(«ad-unit-ID», "«placement»");
Dart
AppLovinMAX.createBanner(«ad-unit-ID», «position»);
AppLovinMAX.setBannerPlacement(«ad-unit-ID», «placement»);
GDScript
AppLovinMAX.createBanner(«ad-unit-ID», «position»);
AppLovinMAX.set_banner_placement(«ad-unit-ID», «placement»);
Java
adViewAd.setPlacement( "«placement»" );
JavaScript (Cordova)
AppLovinMAX.createBanner(«ad-unit-ID», «position»);
AppLovinMAX.setBannerPlacement(«ad-unit-ID», «placement»);
JavaScript (React Native)
AppLovinMAX.createBanner(«ad-unit-ID», «position»);
AppLovinMAX.setBannerPlacement(«ad-unit-ID», «placement»);
Kotlin
adView.setPlacement( "«placement»" )
Lua
applovin.create_banner(«ad-unit-ID», «position»)
applovin.set_banner_placement(«ad-unit-ID», «placement»)
Objective-C
adView.placement = @"«placement»";
[adView loadAd];
Swift
adView.placement = "«placement»"
adView.loadAd()

Setting an Internal User ID

下面的代码片段展示了如何使用您的内部用户 ID 来标记用户。 User ID 字符串的长度上限为 8192 个字符。

AppLovinMAX.setUserId("«user-ID»");

Custom Data

以下代码片段展示了如何向回调添加自定义字符串数据。 该字符串数据将替换回调中的 {CUSTOM_DATA} 宏。 AppLovin 建议字符串不要超过 8192 个字符。

横幅和 MREC
MaxSdk.SetBannerCustomData("«ad-unit-ID»", "«custom-data»"); // Banners
MaxSdk.SetMRecCustomData("«ad-unit-ID»", "«custom-data»"); // MRECs
插屏
MaxSdk.ShowInterstitial(«adUnitIdentifier», «placement», «custom data»);
激励广告
MaxSdk.ShowRewardedAd(«adUnitIdentifier», «placement», «custom data»);
原生广告
nativeAdLoader.setCustomData( "«custom data»" );