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
| Name | Description | Example |
|---|---|---|
aggregated | Whether the API should aggregate the data (per user) or not (per impression). Defaults to true. | false |
api_key | Report Key, for authentication. | tgCe3d7SFRU0S…304ZKs6ba |
application | Application package name (for Android) or bundle ID (for iOS). (You cannot use this parameter if you define store_id) | com.mycompany.application |
date1 | Day to return data for, in «YYYY»-«MM»-«DD» format. | 2019-02-06 |
platform | Application platform: android, fireos, or ios. | android |
store_id | The 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
| Name | Description |
|---|---|
ad_revenue_report_url | Location of the CSV file with all revenue including estimated Meta Audience Network Bidding data. |
fb_estimated_revenue_url | Location 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. |
status | Status of the request: 200 if a user report can be accessed. |
url | Location 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,Revenueda39a3ee5e6b4b0,home_screen,04034992-E5AA-4BA1-890C-5075B2504050,4F2A07BC-315B-11E9-B210-D663BD873D93,20349,27,5.000025da39a3ee5e6b4b0,level_end,12309422-331C-41A3-9BF5-2D7D1C04A4E0,4F2A0A6E-315B-11E9-B210-AD023491FF20,,11,0.006100Date,Ad Unit ID,Ad Unit Name,Waterfall,Ad Format,Placement,Country,Device Type,IDFA,IDFV,User ID,Revenue, Ad Placement2019-07-29 15:53:07.39,97f7d2048121fe62,sc-and-v1,Default Waterfall,BANNER,home-screen,gb,PHONE,34d5d192-4d67-4382-a730-6828a5f769a2,,e41aaf1d-72ea-4c02-8543-27a2ba09a258,0.000079,16427992019-07-29 15:49:31.468,97f7d2048121fe62,sc-and-v1,LAT Users,BANNER,level-end,de,TABLET,31dae586-12d9-47dc-99bd-80855feb2afd,,cf-3042e652059847e5b0911dca682e9509,0.006000,202009Fields
| Name | Description |
|---|---|
Ad Format | INTER, BANNER, REWARD (Non-Aggregated only). |
Ad Placement | The placement ID of the external ad network that showed the ad (Non-Aggregated only). |
Ad Unit ID | ID of the MAX Ad Unit that generated the revenue. |
Ad Unit Name | Name of the MAX Ad Unit that generated the revenue (Non-Aggregated only). |
Country | The two-letter country code of the impression (Non-Aggregated only). |
Custom Data | Custom data passed in from the integration. |
Date | Time of the impression (Non-Aggregated only). |
Device Type | PHONE, TABLET (Non-Aggregated only). |
IDFA | Advertising identifier: IDFA for iOS devices, GAID for Android devices. |
IDFV | Identifier for vendor. |
Impressions | The number of ads displayed to the user (Aggregated only). |
Network | The 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) |
Placement | The Ad Placement Name where the user generated impressions and revenue. |
Revenue | The revenue generated by the user, in USD, expressed with six-decimal precision. |
User ID | Optional ID of the user, set via the AppLovin SDK. (See the “Setting an Internal User ID” section below.) |
Waterfall | MAX ad unit waterfall name (Non-Aggregated only). |
Setting an Ad Placement Name
下面的代码片段展示了如何向广告单元添加广告位名称。
广告位名称的值会替换回调请求中的 {PLACEMENT} 宏:
ActionScript
C++
UAppLovinMAX::CreateBanner(«ad-unit-ID», «position»);UAppLovinMAX::SetBannerPlacement(«ad-unit-ID», «placement»);UAppLovinMAX::CreateMRec(«ad-unit-ID», «position»);UAppLovinMAX::SetMRecPlacement(«ad-unit-ID», «placement»);UAppLovinMAX::ShowInterstitial(«ad-unit-ID», «placement»);UAppLovinMAX::ShowInterstitial(«ad-unit-ID», «placement»);C#
MaxSdk.CreateBanner(«ad-unit-ID», «position»);MaxSdk.SetBannerPlacement(«ad-unit-ID», "«placement»");MaxSdk.CreateMRec(«ad-unit-ID», «position»);MaxSdk.SetMRecPlacement(«ad-unit-ID», "«placement»");MaxSdk.ShowInterstitial(«ad-unit-ID», "«placement»");MaxSdk.ShowRewardedAd(«ad-unit-ID», "«placement»");Dart
AppLovinMAX.createBanner(«ad-unit-ID», «position»);AppLovinMAX.setBannerPlacement(«ad-unit-ID», «placement»);AppLovinMAX.createMRec(«ad-unit-ID», «position»);AppLovinMAX.setMRecPlacement(«ad-unit-ID», «placement»);AppLovinMAX.showInterstitial(«ad-unit-ID», placement: «placement»);AppLovinMAX.showRewardedAd(«ad-unit-ID», placement: «placement»);GDScript
AppLovinMAX.createBanner(«ad-unit-ID», «position»);AppLovinMAX.set_banner_placement(«ad-unit-ID», «placement»);AppLovinMAX.createMRec(«ad-unit-ID», «position»);AppLovinMAX.set_mrec_placement(«ad-unit-ID», «placement»);AppLovinMAX.show_interstitial(«ad-unit-ID», «placement»);AppLovinMAX.show_rewarded_ad(«ad-unit-ID», «placement»);Java
adViewAd.setPlacement( "«placement»" );interstitial.showAd( "«placement»" );rewardedAd.showAd( "«placement»" );nativeAdLoader.setPlacement( "«placement»" );MaxAdPlacerSettings settings = new MaxAdPlacerSettings( "«ad-unit-ID»" );settings.setPlacement( "«placement»" );JavaScript (Cordova)
AppLovinMAX.createBanner(«ad-unit-ID», «position»);AppLovinMAX.setBannerPlacement(«ad-unit-ID», «placement»);AppLovinMAX.createMRec(«ad-unit-ID», «position»);AppLovinMAX.setMRecPlacement(«ad-unit-ID», «placement»);AppLovinMAX.showInterstitial(«ad-unit-ID», «placement»);AppLovinMAX.showRewardedAd(«ad-unit-ID», «placement»);JavaScript (React Native)
AppLovinMAX.createBanner(«ad-unit-ID», «position»);AppLovinMAX.setBannerPlacement(«ad-unit-ID», «placement»);import { AdView, AdFormat } from 'react-native-applovin-max';⋮<AdView adUnitId={«ad-unit-ID»} adFormat={AdFormat.BANNER} placement={«placement»} />import { MRecAd } from 'react-native-applovin-max';⋮MRecAd.createAd(«ad-unit-ID», «position»);MRecAd.setPlacement(«ad-unit-ID», «placement»);import { AdView, AdFormat } from 'react-native-applovin-max';⋮<AdView adUnitId={«ad-unit-ID»} adFormat={AdFormat.MREC} placement={«placement»} />import { InterstitialAd } from 'react-native-applovin-max';⋮InterstitialAd.showAd(«ad-unit-ID», "«placement»");import { RewardedAd } from 'react-native-applovin-max';⋮RewardedAd.showAd(«ad-unit-ID», "«placement»");<NativeAdView adUnitId={«ad-unit-ID»} placement="«placement»" ⋮/>Kotlin
adView.setPlacement( "«placement»" )interstitial.showAd( "«placement»" )rewardedAd.showAd( "«placement»" )nativeAdLoader.setPlacement( "«placement»" )val settings = MaxAdPlacerSettings( "«ad-unit-ID»" )settings.placement = "«placement»"Lua
applovin.create_banner(«ad-unit-ID», «position»)applovin.set_banner_placement(«ad-unit-ID», «placement»)applovin.create_mrec(«ad-unit-ID», «position»)applovin.set_mrec_placement(«ad-unit-ID», «placement»)applovin.show_interstitial(«ad-unit-ID», «placement»);applovin.show_rewarded_ad(«ad-unit-ID», «placement»);Objective-C
adView.placement = @"«placement»";[adView loadAd];[interstitialAd showAdForPlacement: @"«placement»"];[rewardedAd showAdForPlacement: @"«placement»"];nativeAdLoader.placement = @"«placement»";MAAdPlacerSettings *settings = [MAAdPlacerSettings settingsWithAdUnitIdentifier: @"«ad-unit-ID»"];settings.placement = @"«placement»";Swift
adView.placement = "«placement»"adView.loadAd()interstitial.show(forPlacement: "«placement»")rewardedAd.show(forPlacement: "«placement»")nativeAdLoader.placement = "«placement»"let settings = MAAdPlacerSettings(adUnitIdentifier: "«ad-unit-ID»")settings.placement = @"«placement»"Setting an Internal User ID
下面的代码片段展示了如何使用您的内部用户 ID 来标记用户。 User ID 字符串的长度上限为 8192 个字符。
AppLovinMAX.setUserId("«user-ID»");MaxSdk.SetUserId("«user-ID»");val settings = AppLovinSdk.getInstance( this ).getSettings();settings.setUserIdentifier( "«user-ID»" );AppLovinMAX.setUserId("«user-ID»");val settings = AppLovinSdk.getInstance( this ).settingssettings.userIdentifier = "«user-ID»"applovin.set_user_id("«user-ID»")ALSdkSettings *settings = [ALSdk shared].settings;settings.userIdentifier = @"«user-ID»";let settings = ALSdk.shared().settingssettings.userIdentifier = "«user-ID»"Custom Data
以下代码片段展示了如何向回调添加自定义字符串数据。
该字符串数据将替换回调中的 {CUSTOM_DATA} 宏。
AppLovin 建议字符串不要超过 8192 个字符。
横幅和 MREC
MaxSdk.SetBannerCustomData("«ad-unit-ID»", "«custom-data»"); // BannersMaxSdk.SetMRecCustomData("«ad-unit-ID»", "«custom-data»"); // MRECsadViewAd.setCustomData( "«custom-data»" );BannerAd.setCustomData("«ad-unit-ID»", "«custom-data»"); // BannersMRec.setCustomData("«ad-unit-ID»", "«custom-data»"); // MRECsadView.setCustomData( "«custom-data»" )adView.customData = @"«custom-data»";adView.customData = "«custom-data»"插屏
MaxSdk.ShowInterstitial(«adUnitIdentifier», «placement», «custom data»);MaxInterstitialAd.showAd(«placement», «custom data»);InterstitialAd.showAd(interAdUnitId, "«placement»", "«custom data»");MaxInterstitialAd.showAd(«placement», «custom data»)-[MAInterstitialAd showAdForPlacement:customData:][interstitialAd showAdForPlacement: @"«placement»" customData: @"«custom-data»"];激励广告
MaxSdk.ShowRewardedAd(«adUnitIdentifier», «placement», «custom data»);MaxRewardedAd.showAd(«placement», «custom data»);RewardedAd.showAd(adUnitId, "«placement»", "«custom data»");MaxRewardedAd.showAd(«placement», «custom data»)-[MARewardedAd showAdForPlacement:customData:]rewardedAd.show(forPlacement: "«placement»" customData: "«custom-data»")原生广告
nativeAdLoader.setCustomData( "«custom data»" );<NativeAdView adUnitId={«ad-unit-ID»} customData="«custom-data»" ⋮/>nativeAdLoader.setCustomData( "«custom data»" )nativeAdLoader.customData = @"«custom data»";nativeAdLoader.customData = "«custom data»"


