You can record ad revenue for supported network partners using the Adjust SDK.
Instantiate an ADJAdRevenue object
- (nullable id )initWithSource:(nonnull NSString * )source;
To send ad revenue information with the Adjust SDK, you need to instantiate an ADJAdRevenue
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 ADJAdRevenue
instance and pass the following argument:
source
(NSString
): The source of the ad revenue. See the table below for available sources.
Argument Ad revenue Source "applovin_max_sdk"
AppLovin MAX "admob_sdk"
AdMob "ironsource_sdk"
ironSource "admost_sdk"
AdMost "unity_sdk"
Unity "helium_chartboost_sdk"
Helium Chartboost "adx_sdk"
Ad(X) "publisher_sdk"
Generic source "tradplus_sdk"
TradPlus "topon_sdk"
TopOn "mopub"
Mopub
guard let adRevenue = ADJAdRevenue ( source : "applovin_max_sdk" ) else { return }
Adjust. trackAdRevenue (adRevenue)
ADJAdRevenue * adRevenue = [[ADJAdRevenue alloc ]
initWithSource: @"applovin_max_sdk" ];
[Adjust trackAdRevenue: adRevenue];
Send ad revenue
+ ( void )trackAdRevenue:(nonnull ADJAdRevenue * )adRevenue;
To send ad revenue to Adjust, call the trackAdRevenue
method with your ad revenue instance as an argument.
guard let adRevenue = ADJAdRevenue ( source : "applovin_max_sdk" ) else { return }
Adjust. trackAdRevenue (adRevenue)
ADJAdRevenue * adRevenue = [[ADJAdRevenue alloc ]
initWithSource: @"applovin_max_sdk" ];
[Adjust trackAdRevenue: adRevenue];
Record ad revenue amount
- ( void )setRevenue:( double )amount currency:(nonnull NSString * )currency;
To send the ad revenue amount, call the setRevenue
method and pass the following arguments:
revenue
(double
): The amount of revenue
currency
(NSString
): The 3 character ISO 4217 code of your reporting currency
guard let adRevenue = ADJAdRevenue ( source : "applovin_max_sdk" ) else { return }
adRevenue. setRevenue ( 1.6 , currency : "USD" )
Adjust. trackAdRevenue (adRevenue)
ADJAdRevenue * adRevenue = [[ADJAdRevenue alloc ]
initWithSource: @"applovin_max_sdk" ];
[adRevenue setRevenue:1.6 currency: @"USD" ];
[Adjust trackAdRevenue: adRevenue];
Record ad campaign details
The ADJAdRevenue
class contains properties you can use to report on your ad campaigns.
Ad impressions
- ( void )setAdImpressionsCount:( int )adImpressionsCount;
To send the number of recorded ad impressions, call the setAdImpressionsCount
method and pass the following argument:
adImpressionsCount
(int
): The number of ad impressions.
guard let adRevenue = ADJAdRevenue ( source : "applovin_max_sdk" ) else { return }
adRevenue. setAdImpressionsCount ( 1 )
Adjust. trackAdRevenue (adRevenue)
ADJAdRevenue * adRevenue = [[ADJAdRevenue alloc ]
initWithSource: @"applovin_max_sdk" ];
[adRevenue setAdImpressionsCount:1 ];
[Adjust trackAdRevenue: adRevenue];
Ad revenue network
- ( void )setAdRevenueNetwork:(nonnull NSString * )adRevenueNetwork;
To send the ad revenue network, call the setAdRevenueNetwork
method and pass the following argument:
adRevenueNetwork
(NSString
): The network name.
guard let adRevenue = ADJAdRevenue ( source : "applovin_max_sdk" ) else { return }
adRevenue. setAdRevenueNetwork ( "network1" )
Adjust. trackAdRevenue (adRevenue)
ADJAdRevenue * adRevenue = [[ADJAdRevenue alloc ]
initWithSource: @"applovin_max_sdk" ];
[adRevenue setAdRevenueNetwork: @"network1" ];
[Adjust trackAdRevenue: adRevenue];
Ad revenue unit
- ( void )setAdRevenueUnit:(nonnull NSString * )adRevenueUnit;
To send the ad revenue unit, call the setAdRevenueUnit
method and pass the following argument:
adRevenueUnit
(NSString
): The ad unit.
guard let adRevenue = ADJAdRevenue ( source : "applovin_max_sdk" ) else { return }
adRevenue. setAdRevenueUnit ( "unit1" )
Adjust. trackAdRevenue (adRevenue)
ADJAdRevenue * adRevenue = [[ADJAdRevenue alloc ]
initWithSource: @"applovin_max_sdk" ];
[adRevenue setAdRevenueUnit: @"unit1" ];
[Adjust trackAdRevenue: adRevenue];
Ad revenue placement
- ( void )setAdRevenuePlacement:(nonnull NSString * )adRevenuePlacement;
To send the ad revenue placement, call the setAdRevenuePlacement
method and pass the following argument:
adRevenuePlacement
(NSString
): The ad placement.
guard let adRevenue = ADJAdRevenue ( source : "applovin_max_sdk" ) else { return }
adRevenue. setAdRevenuePlacement ( "banner" )
Adjust. trackAdRevenue (adRevenue)
ADJAdRevenue * adRevenue = [[ADJAdRevenue alloc ]
initWithSource: @"applovin_max_sdk" ];
[adRevenue setAdRevenuePlacement: @"banner" ];
[Adjust trackAdRevenue: adRevenue];
Add callback parameters
- ( void )addCallbackParameter:(nonnull NSString * )key value:(nonnull NSString * )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 NSString
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.
guard let adRevenue = ADJAdRevenue ( source : "applovin_max_sdk" ) else { return }
adRevenue. addCallbackParameter (key, value : value)
Adjust. trackAdRevenue (adRevenue)
ADJAdRevenue * adRevenue = [[ADJAdRevenue alloc ]
initWithSource: @"applovin_max_sdk" ];
[adRevenue addCallbackParameter: key value: value];
[Adjust trackAdRevenue: adRevenue];
Add partner parameters
- ( void )addPartnerParameter:(nonnull NSString * )key value:(nonnull NSString * )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 NSString
key-value arguments. You can add multiple parameters by calling this method multiple times.
guard let adRevenue = ADJAdRevenue ( source : "applovin_max_sdk" ) else { return }
adRevenue. addPartnerParameter (key, value : value)
Adjust. trackAdRevenue (adRevenue)
ADJAdRevenue * adRevenue = [[ADJAdRevenue alloc ]
initWithSource: @"applovin_max_sdk" ];
[adRevenue addPartnerParameter: key value: value];
[Adjust trackAdRevenue: adRevenue];
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"
guard let adRevenue = ADJAdRevenue ( source : "applovin_max_sdk" ) else { return }
adRevenue. setRevenue ( 1 , currency : "EUR" )
adRevenue. setAdImpressionsCount ( 10 )
adRevenue. setAdRevenueNetwork ( "network1" )
adRevenue. setAdRevenueUnit ( "unit1" )
adRevenue. setAdRevenuePlacement ( "banner" )
adRevenue. addCallbackParameter ( "key1" , value : "value1" )
adRevenue. addPartnerParameter ( "key2" , value : "value2" )
Adjust. trackAdRevenue (adRevenue)
ADJAdRevenue * adRevenue = [[ADJAdRevenue alloc ]
initWithSource: @"applovin_max_sdk" ];
[adRevenue setRevenue:1 currency: @"EUR" ];
[adRevenue setAdImpressionsCount:10 ];
[adRevenue setAdRevenueNetwork: @"network1" ];
[adRevenue setAdRevenueUnit: @"unit1" ];
[adRevenue setAdRevenuePlacement: @"banner" ];
[adRevenue addCallbackParameter: @"key1" value: @"value1" ];
[adRevenue addPartnerParameter: @"key2" value: @"value2" ];
[Adjust trackAdRevenue: adRevenue];