adjust-icon

Send ad revenue information

You can record ad revenue for supported network partners using the Adjust SDK.

Instantiate an AdjustAdRevenue object

Method signature
void AdjustAdRevenue2dx::initAdRevenue(std::string source);

To send ad revenue information with the Adjust SDK, you need to instantiate an AdjustAdRevenue object. This object contains variables that are sent to Adjust when ad revenue is recorded in your app.

To instantiate an ad revenue object, create a new AdjustAdRevenue instance and pass the following parameters:

  • source (String): The source of the ad revenue. See the table below for available sources
ParameterSource
AdjustConfig2dx.AdjustAdRevenueSourceAppLovinMAXAppLovin MAX
AdjustConfig2dx.AdjustAdRevenueSourceMopubMopub
AdjustConfig2dx.AdjustAdRevenueSourceAdMobAdMob
AdjustConfig2dx.AdjustAdRevenueSourceIronSourceironSource
AdjustConfig2dx.AdjustAdRevenueSourceAdMostSourceAdMost
AdjustConfig2dx.AdjustAdRevenueSourceUnityUnity
AdjustConfig2dx.AdjustAdRevenueSourceHeliumChartboostHelium Chartboost
AdjustConfig2dx.AdjustAdRevenueSourceAdxAd(X)
AdjustConfig2dx.AdjustAdRevenueSourcePublisherGeneric source
AdjustAdRevenue2dx adjustAdRevenue = AdjustAdRevenue2dx(AdjustConfig2dx::AdjustAdRevenueSourceAppLovinMAX);
Adjust2dx::trackAdRevenueNew(adjustAdRevenue);

Send ad revenue

Method signature
static void trackAdRevenueNew(AdjustAdRevenue2dx adRevenue);

To send ad revenue to Adjust, call the trackAdRevenueNew method with your ad revenue instance as an argument.

AdjustAdRevenue2dx adjustAdRevenue = AdjustAdRevenue2dx(AdjustConfig2dx::AdjustAdRevenueSourceAppLovinMAX);
Adjust2dx::trackAdRevenueNew(adjustAdRevenue);

Record ad revenue amount

Method signature
void AdjustAdRevenue2dx::setRevenue(double amount, std::string currency);

To send the ad revenue amount, call the setRevenue method and pass the following arguments:

  • amount (Double): The amount of revenue
  • currency (String): The 3 character ISO 4217 code of your reporting currency
AdjustAdRevenue2dx adjustAdRevenue = AdjustAdRevenue2dx(AdjustConfig2dx::AdjustAdRevenueSourceAppLovinMAX);
adjustAdRevenue.setRevenue(0.01, "EUR");
Adjust2dx::trackAdRevenueNew(adjustAdRevenue);

Record ad campaign details

The AdjustAdRevenue class contains properties you can use to report on your ad campaigns.

Ad impressions

Method signature
void AdjustAdRevenue2dx::setAdImpressionsCount(int adImpressionsCount);

To send the number of recorded ad impressions, call the setAdImpressionsCount method and pass the following arguments:

  • adImpressionsCount (Integer): The number of ad impressions.
AdjustAdRevenue2dx adjustAdRevenue = AdjustAdRevenue2dx(AdjustConfig2dx::AdjustAdRevenueSourceAppLovinMAX);
adjustAdRevenue.setAdImpressionsCount(10);
Adjust2dx::trackAdRevenueNew(adjustAdRevenue);

Ad revenue network

Method signature
void AdjustAdRevenue2dx::setAdRevenueNetwork(std::string adRevenueNetwork);

To send the ad revenue network, call the setAdRevenueNetwork method and pass the following arguments:

  • adRevenueNetwork (String): The network name.
AdjustAdRevenue2dx adjustAdRevenue = AdjustAdRevenue2dx(AdjustConfig2dx::AdjustAdRevenueSourceAppLovinMAX);
adjustAdRevenue.setAdImpressionsCount("network1");
Adjust2dx::trackAdRevenueNew(adjustAdRevenue);

Ad revenue unit

Method signature
void AdjustAdRevenue2dx::setAdRevenueUnit(std::string adRevenueUnit);

To send the ad revenue unit, call the setAdRevenueUnit method and pass the following arguments:

  • adRevenueUnit (String): The ad unit.
AdjustAdRevenue2dx adjustAdRevenue = AdjustAdRevenue2dx(AdjustConfig2dx::AdjustAdRevenueSourceAppLovinMAX);
adjustAdRevenue.setAdImpressionsCount("unit1");
Adjust2dx::trackAdRevenueNew(adjustAdRevenue);

Ad revenue placement

Method signature
void AdjustAdRevenue2dx::setAdRevenuePlacement(std::string adRevenuePlacement);

To send the ad revenue placement, call the setAdRevenuePlacement method and pass the following arguments:

  • adRevenuePlacement (String): The ad placement.
AdjustAdRevenue2dx adjustAdRevenue = AdjustAdRevenue2dx(AdjustConfig2dx::AdjustAdRevenueSourceAppLovinMAX);
adjustAdRevenue.setAdRevenuePlacement("banner");
Adjust2dx::trackAdRevenueNew(adjustAdRevenue);

Add callback parameters

Method signature
void AdjustAdRevenue2dx::addCallbackParameter(std::string key, std::string value);

If you register a callback URL in the Adjust dashboard, the SDK sends a GET request to your callback URL when it records an event.

You can configure callback parameters to your servers. Once you configure parameters on an event, the SDK appends them to your callback URL. You can use this information to analyze your users’ in-app behavior with your BI system.

Add callback parameters to your event by calling the addCallbackParameter method with string key-value arguments. You can add multiple parameters by calling this method multiple times.

The Adjust SDK measures the event and sends a request to your URL with the callback parameters. For example, if you register the URL https://www.mydomain.com/callback, your callback looks like this:

https://www.mydomain.com/callback?key=value&foo=bar

If you are using CSV uploads, make sure to add the parameters to your CSV definition.

Adjust supports many placeholders which you can use to pass information from the SDK to your URL. For example, the {idfa} placeholder for iOS and the {gps_adid} placeholder for Android. The {publisher_parameter} placeholder presents all callback parameters in a single string.

AdjustAdRevenue2dx adjustAdRevenue = AdjustAdRevenue2dx(AdjustConfig2dx::AdjustAdRevenueSourceAppLovinMAX);
adjustAdRevenue.addCallbackParameter("key", "value");
adjustAdRevenue.addCallbackParameter("foo", "bar");
Adjust2dx::trackAdRevenueNew(adjustAdRevenue);

Add partner parameters

Method signature
void AdjustAdRevenue2dx::addPartnerParameter(std::string key, std::string value);

You can send extra information to your network partners by adding partner parameters.

Adjust sends partner parameters to external partners you have set up. This information is useful for more granular analysis and retargeting purposes. Adjust’s servers forward these parameters once you have set them up and enabled them for a partner.

Add partner parameters to your event by calling the addPartnerParameter method with string key-value arguments. You can add multiple parameters by calling this method multiple times.

AdjustAdRevenue2dx adjustAdRevenue = AdjustAdRevenue2dx(AdjustConfig2dx::AdjustAdRevenueSourceAppLovinMAX);
adjustAdRevenue.addPartnerParameter("key", "value");
adjustAdRevenue.addPartnerParameter("foo", "bar");
Adjust2dx::trackAdRevenueNew(adjustAdRevenue);

Example

This example shows how to set up and record an ad revenue object with the following properties:

  • AppLovin MAX as the revenue source
  • 1 Euro as the revenue amount
  • 10 ad impressions
  • "network1" as the ad revenue network
  • "unit1" as the ad revenue unit
  • "banner" as the ad revenue placement
  • A callback parameter: "key1" = "value1"
  • A partner parameter: "key2" = "value2"
AdjustAdRevenue2dx adjustAdRevenue = AdjustAdRevenue2dx(AdjustConfig2dx::AdjustAdRevenueSourceAppLovinMAX);
adjustAdRevenue.setRevenue(1, "EUR");
adjustAdRevenue.setAdImpressionsCount(10);
adjustAdRevenue.setAdRevenueNetwork("network1");
adjustAdRevenue.setAdRevenueUnit("unit1");
adjustAdRevenue.setAdRevenuePlacement("banner");
adjustAdRevenue.addCallbackParameter("key1", "value1");
adjustAdRevenue.addPartnerParameter("key2", "value2");
Adjust2dx::trackAdRevenueNew(adjustAdRevenue);