S2S Impression Revenue API

Impression-level revenue data helps you better understand your users, calculate ROI precisely, and build accurate LTV models. MAX gives you revenue information associated with each impression, as well as information about the demand source and the creative served for supported networks.

You can either process the data directly yourself, or work with any of our supported analytics providers, which are listed in the “MMP Integration: MAX to MMP” section of this page.

Direct Integration: MAX to You

There are three ways you can get user-level revenue data:

  1. Use this API to retrieve user-level revenue data on a daily basis. You can retrieve this data aggregated for a particular user or with one row per impression. Data is available eight hours after UTC day end. Read more about it on the User Revenue API documentation page.
  2. Starting in SDK version 10.3.0+, you can access impression-level user revenue data on the client side in real-time. You can find integration instructions in the Advanced Settings page.
  3. If you want to access real-time revenue data on the server side, you can provide an impression postback to track impression-level user ad revenue data. Please contact your account team or the support team 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 Integration: MAX to MMP

MAX partners with various analytics solutions to help you easily access your data in a single dashboard. You can work with any of our supported partners such as Adjust, GameAnalytics, AppsFlyer, or Singular to access impression-level ad revenue or aggregated ad revenue data. Please refer to the documentation pages maintained by those partners for more information.

Server-to-Server Impression Revenue API

Please contact your account team or the support team to enable this feature.

AppLovin can send (HTTP or HTTPS) GET requests, from its servers to an external endpoint that you define, whenever a MAX impression is recorded. AppLovin makes these postbacks soon after the impression, but they may be delayed by up to a few minutes. You can use an impression timestamp macro to reconcile any delay between the impression and the postback times.

If the postback receives a non-200 response code, AppLovin will retry the postback up to three more times: twice right away and then once more about 60 seconds later. The postback request will timeout if five seconds pass without a response.

Example

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

Available Macros

You can incorporate any of the macros in the following table into your postback URL (as in the example URL above). AppLovin’s servers will replace these macro names with accurate values at the time it makes the postback to your server.

Name Description Example
{AD_UNIT_ID} MAX Ad Unit ID (16 hex characters) 9ad0816ac071552a
{AD_UNIT_NAME} Ad Unit name (URL-encoded) My%20App%20Banners
{AD_UNIT_TEST_NAME} Name of the ad unit test, URL-encoded Control
{ALL_REVENUE} Estimated revenue, including FB Bidding estimates 0.0121, 5.74466e-05
{CC} Two-letter country code of the user gb
{CUSTOM_DATA} Custom data passed in from the integration. AppLovin recommends that you keep the size of the string under 8192 characters. gb
{DEVICE_TYPE} User’s device type. Tablet
{EVENT_ID} Unique event ID, 40 hex characters 8dc948013d71f04264b8e5c1c61933154b226e08
{EVENT_TOKEN} sha1( EVENT_ID + Your_Event_Key ) e000949f6d851c1f34adae08e6ef1076ba43cf31
{EVENT_TOKEN_ALL} sha256( All macros alphabetically + Your_Event_Key )If you also include EVENT_TOKEN it will be omitted from the “All macros alphabetically” string. eba615583ed59bc679a495ec58439f4b82b5460d822348eff6be5f218702a97a
{FORMAT} Ad Unit format reward, banner, inter
{IDFA} iOSIDFA or Google Advertising ID 860635ea-65bc-eaed-d355-1b5283b30b94
{IDFV} Identifier for Vendor 4CD1C3C4-3FD7-00F5-1635-7BC6D9387E60
{IP} User’s IP address 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 ManagementAPI. APPLOVIN_NETWORK
{NETWORK_PLACEMENT} Placement name of the external ad network ca-app-pub-12345678%2F0987654321
{PACKAGE_NAME} App Package Name (Android) / Bundle ID (iOS) com.test.app
{PLACEMENT} Publisher-defined MAX ad placement name (URL-encoded) Launch%20Screen
{PLATFORM} Platform android, ios
{PRECISION} Information on how precise the revenue value is. Options are:
if revenue is the price assigned to the line item by the publisher
if revenue is the resulting price of a real-time auction
if the revenue amount is based on Auto CPM or FB Bidding estimates
if no line item amount is defined and there is not enough data to estimate
exact
{REVENUE} Estimated revenue. Set to 0 when FB Bidding. 0.0121, 5.74466e-05
{TS} Timestamp of impression (integer, seconds since epoch) 1546300800
{USER_ID} URL-encoded, publisher-defined, user ID; maximum length is 8192 characters 7634657898
{WATERFALL_NAME} The name of the Ad Unit waterfall LAT

Setting an Ad Placement Name

  • // Banners
    UAppLovinMAX::SetBannerPlacement(ad-unit-id, placement);
    
    // MRECs
    UAppLovinMAX::SetMRecPlacement(ad-unit-id, placement);
  • // Banners
    MaxSdk.SetBannerPlacement(ad-unit-id, "placement");
    
    // Interstitials
    MaxSdk.ShowInterstitial(ad-unit-id, "placement");
    
    // Rewarded Ads
    MaxSdk.ShowRewardedAd(ad-unit-id, "placement");
  • // Banners
    adViewAd.setPlacement( "placement" );
    
    // Interstitials
    interstitial.showAd( "placement" );
    
    // Rewarded Ads
    rewardedAd.showAd( "placement" );
    
    // Native Ads
    nativeAdLoader.setPlacement( "placement" );
  • // Banners
    adView.setPlacement( "placement" )
    
    // Interstitials
    interstitial.showAd( "placement" )
    
    // Rewarded Ads
    rewardedAd.showAd( "placement" )
    
    // Native Ads
    nativeAdLoader.setPlacement( "placement" )
  • // Banners
    adView.placement = @"placement";
    
    // Interstitials
    [interstitialAd showAdForPlacement: @"placement"];
    
    // Rewarded Ads
    [rewardedAd showAdForPlacement: @"placement"];
    
    // Native Ads
    nativeAdLoader.placement = @"placement";
  • // Banners
    adView.placement = "placement"
    
    // Interstitials
    interstitial.show(forPlacement: "placement")
    
    // Rewarded Ads
    rewardedAd.show(forPlacement: "placement")
    
    // Native Ads
    nativeAdLoader.placement = "placement"

Setting an Internal User ID

If you want to tag users with your own internal User ID, do so with code like the following. The maximum size of the User ID string is 8192 characters.

  • AppLovinMAX.setUserId("user-id");
  • MaxSdk.SetUserId("user-id");
  • AppLovinSdk.getInstance( context ).setUserIdentifier( "user-id" );
  • AppLovinMAX.setUserId("user-id");
  • AppLovinSdk.getInstance( context ).userIdentifier = "user-id"
  • [ALSdk shared].userIdentifier = @"user-id";
  • ALSdk.shared()!.userIdentifier = "user-id"

Custom Data

Starting in SDK version 11.0.0, you can tag data/postbacks with custom string data. Do this with the code like the following. AppLovin recommends that you keep the size of the string under 8192 characters.

You must set custom data before you load a banner or MREC ad. Otherwise that data will not appear in the postbacks associated with the ad.

Banners

  • MaxSdk.SetBannerCustomData(adUnitId, "custom data");
  • adViewAd.setCustomData( "custom data" )
  • adView.setCustomData( "custom data" );
  • adView.customData = @"custom data";
  • adView.customData = "custom data"

MRECs

  • MaxSdk.SetMRecCustomData(adUnitId, "custom data");
  • adView.setCustomData( "custom data" )
  • adView.setCustomData( "custom data" );
  • adView.customData = @"custom data";
  • adView.customData = "custom data"

Interstitials

  • MaxSdk.ShowInterstitial(adUnitIdentifier, placement, custom data);
  • MaxInterstitialAd.showAd(placement, custom data);
  • MaxInterstitialAd.showAd(placement, custom data)
  • -[MAInterstitialAd showAdForPlacement:customData:]

Rewarded Ads

  • MaxSdk.ShowRewardedAd(adUnitIdentifier, placement, custom data);
  • MaxRewardedAd.showAd(placement, custom data);
  • MaxRewardedAd.showAd(placement, custom data)
  • -[MARewardedAd showAdForPlacement:customData:]

Native Ads

  • nativeAdLoader.setCustomData( "my custom data" );
  • nativeAdLoader.setCustomData( "my custom data" )
  • nativeAdLoader.customData = @"my custom data";
  • nativeAdLoader.customData = "my custom data"