跳转到内容

S2S 展示收益 API

展示层级收入数据能帮助您更好地理解用户,精准计算 ROI,并打造精确的 LTV 模型。对于受支持的平台,MAX 会为您提供每个展示的数据,包括收入、广告来源和素材信息。

您可以直接自行处理此数据。 您还可以让任何 AppLovin 支持的数据分析提供商对数据进行分析 (您可以在本页的 MMP 集成:从 MAX 到 MMP 部分查看这些服务商的列表)。

将 MAX 接入您的应用

您可以通过以下三种方式获取用户层级收入数据:

  1. 用户收入 API: 使用该 API 调取每日用户层级收入数据。您可以用两种形式导出这些数据:汇总某个特定用户的数据,或以每次展示一行的形式导出。数据会在 UTC 当日结束 8 小时后提供。要了解更多信息,请参阅用户收入 API 文档页面
  2. 客户端: 您可以在客户端实时访问展示层级用户收入数据。在本文档中,您可以找到 AndroidiOS 的集成说明。
  3. Server-to-Server: You can also access real-time revenue data on the server side. To do this, provide an impression postback that tracks impression-level user ad revenue data. Contact your account team or <SupportLink title=“支持团队” /> to enable this feature. This feature, and the macros that the impression postback supports, are described in the “Server-to-Server Impression Revenue API” section of this page.

MMP 集成:MAX 到 MMP

MAX 拥有多位分析合作伙伴,他们可以帮助您在一个控制面板中就访问您的所有数据。您可以与任何 AppLovin 支持的合作伙伴合作,获取展示层级广告收入或汇总广告收入数据。这些受支持的合作伙伴包括 AdjustGameAnalyticsAppsFlyerSingular。如需了解这些合作伙伴的能力,请参阅他们维护的文档页面。

服务器端到服务器端展示收入 API

Contact your account team or <SupportLink title=“支持团队” /> to enable this feature.

AppLovin’s servers can send postbacks to an external endpoint whenever they record a MAX impression. You define which endpoint receives these requests. The postbacks are in the form of HTTP or HTTPS GET requests. AppLovin makes these postbacks soon after the impression, but they may be delayed by a few minutes. You can use an impression timestamp macro to reconcile any delay between the impression and the postback times.

如果 5 秒后,您的终端没有做出响应,那么回调请求就会超时。回调请求不可重试。

示例

https://myimpressionserver.com/impression?idfa={IDFA}&user_id={USER_ID}&event={EVENT_ID}&token={EVENT_TOKEN}

可用宏

您可以将下表中的任意宏加入到回调 URL 。上述示例 URL 中包含 {IDFA}{USER_ID}{EVENT_ID}{EVENT_TOKEN} 宏。当 AppLovin 服务器向您的终端发出请求时,这些宏就会被准确的值代替。

名称描述
{AD_UNIT_ID}MAX ad unit ID (16 hex characters)<br /><br />Example: 9ad0816ac071552a
{AD_UNIT_NAME}Ad unit name (URL-encoded)<br /><br />Example: My%20App%20Banners
{AD_UNIT_TEST_NAME}Name of the ad unit test, URL-encoded<br /><br />Example: Control
{ALL_REVENUE}Estimated revenue, including FB Bidding estimates<br /><br />Examples: 0.0121, 5.74466e-05
{CC}Two-letter country code of the user<br /><br />Example: gb
{CUSTOM_DATA}Custom data passed in from the integration (URL-encoded). AppLovin recommends that you keep the size of the string under 8192 characters. You must not include ampersand (&amp;) characters in the custom data if you include this macro.<br /><br />Example: my%20custom%20data
{DEVICE_TYPE}User’s device type.<br /><br />Example: Tablet
{EVENT_ID}Unique event ID, 40 hex characters<br /><br />Example: 8dc948013d71f04264b8e5c1c61933154b226e08
{EVENT_TOKEN}sha1( «event-ID» + «your-event-key» )<br /><br />Example: e000949f6d851c1f34adae08e6ef1076ba43cf31
{EVENT_TOKEN_ALL}<code>sha256( «All macros alphabetically as-is, <em>not</em> URL-decoded» + «your-event-key» )</code><br /><br />Note: If EVENT_TOKEN is one of your macros, omit it from the “All macros alphabetically” string.<br /><br />Example: eba615583ed59bc679a495…ff6be5f218702a97a
{FORMAT}Ad Unit format<br /><br />Examples: reward, banner, inter
{IDFA}iOS IDFA or Google Advertising ID<br /><br />Example: 860635ea-65bc-eaed-d355-1b5283b30b94
{IDFV}Identifier for Vendor<br /><br />Example: 4CD1C3C4-3FD7-00F5-1635-7BC6D9387E60
{IP}User’s IP address. (IPv6 values are URL-encoded)<br /><br />Examples: 162.1.1.1, fe80%3A%3A1ff%3Afe23%3A4567%3A890a%0A
{NETWORK}Name of the ad network that served the impression. Names should match the names used in the Management API.<br /><br />Example: APPLOVIN_NETWORK
{NETWORK_PLACEMENT}Placement name of the external ad network<br /><br />Example: ca-app-pub-12345678%2F0987654321
{PACKAGE_NAME}应用包名 (Android) 或 Bundle ID (iOS)。URL 编码。
{PLACEMENT}Publisher-defined MAX ad placement name (URL-encoded)<br /><br />Example: Launch%20Screen
{PLATFORM}Platform<br /><br />Examples: android, ios
{PRECISION}Information on how precise the revenue value is. Options are: <dl><dt>publisher_defined</dt><dd>if revenue is the price assigned to the line item by the publisher</dd><dt>exact</dt><dd>if revenue is the resulting price of a real-time auction</dd><dt>estimated</dt><dd>if the revenue amount is based on Auto-CPM or FB Bidding estimates</dd><dt>undefined</dt><dd>if no line item amount is defined and there is not enough data to estimate</dd></dl><br />Example: exact
{REVENUE}Estimated revenue. Set to 0 when FB Bidding.<br /><br />Examples: 0.0121, 5.74466e-05
{TS}Timestamp of impression (integer, seconds since epoch)<br /><br />Example: 1546300800
{USER_ID}Publisher-defined, URL-encoded, user ID; maximum length is 8192 characters<br /><br />Example: 7634657898
{WATERFALL_NAME}The name of the Ad Unit waterfall<br /><br />Example: LAT

设置广告位名称

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

ActionScript
AppLovinMAX.setBannerPlacement(«ad-unit-ID», «placement»);
Blueprint

Ad Unit Identifier. Create Banner: Ad Unit Identifier. Banner Position: Bottom Center. Set Banner Placement: Ad Unit Identifier, Placement: YOUR_BANNER_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()

设置内部用户 ID

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

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

设置自定义数据

以下代码片段展示了如何向回调添加自定义字符串数据。 该字符串数据将替换回调中的 {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»" );