# iOS – TradPlus

Source: https://tenjin.com/docs/ios-tradplus/

The Tenjin SDK can listen to TradPlus impression level revenue data and send revenue events to Tenjin.


### Integration steps


1. Add the most recent TradPlus SDK version through your Podfile from [https://docs.tradplusad.com/en/docs/integration_ios/download](<https://docs.tradplusad.com/en/docs/integration_ios/download>).

2. In your TradPlus impression callback, pass the impression data to Tenjin in JSON format using the ` tradPlusImpressionFromJSON: ` method.


### Code sample


Objective-C

```
- (void)tradPlusAdImpression:(NSDictionary *)adInfo {
    NSDictionary *payload = @{
        @"revenue"           : @([adInfo[@"ecpm"] floatValue]),
        @"network_name"      : adInfo[@"adNetworkName"] ?: @"",
        @"ad_unit_id"        : adInfo[@"adunit_id"] ?: @"",
        @"revenue_precision" : adInfo[@"ecpm_precision"] ?: @"",
        @"format"            : adInfo[@"adType"] ?: @"",
        @"segment"           : adInfo[@"segment_id"] ?: @"",
        @"ab_test"           : adInfo[@"bucket_id"] ?: @"",
        @"country"           : adInfo[@"country_code"] ?: @"",
        @"creative_id"       : adInfo[@"creativeId"] ?: @""
    };

    NSData *data = [NSJSONSerialization dataWithJSONObject:payload options:0 error:nil];
    NSString *json = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];

    [TenjinSDK tradPlusImpressionFromJSON:json];
}
```


### Impression level revenue data parameters


| Parameter | TradPlus key | Required | Example |
| --- | --- | --- | --- |
| ` revenue ` | ` ecpm ` | Yes | 2.5 |
| ` network_name ` | ` adNetworkName ` | No | Admob |
| ` ad_unit_id ` | ` adunit_id ` | No | id-69082 |
| ` revenue_precision ` | ` ecpm_precision ` | No | exact |
| ` format ` | ` adType ` | No | interstitial |
| ` segment ` | ` segment_id ` | No | id-2 |
| ` ab_test ` | ` bucket_id ` | No | id-1 |
| ` country ` | ` country_code ` | No | US |
| ` creative_id ` | ` creativeId ` | No | id-41203 |


### Notes


- ` revenue ` is the eCPM value, not the revenue of a single impression. Pass the TradPlus ` ecpm ` value as-is. Tenjin divides it by 1,000 to derive the per-impression revenue. If you divide it yourself before sending, the revenue recorded in Tenjin will be 1,000 times lower than the actual value.

- TradPlus reports ` ecpm ` in USD.

- Only ` revenue ` is required. All other parameters are optional.

- ` adNetworkName ` requires TradPlus SDK v7.8.0 or later. ` adType `, ` segment_id ` and ` bucket_id ` require v7.1.0 or later. ` creativeId ` requires v14.6.0 or later and is only returned for InMobi and Mintegral.
