Enable cost data in attribution
By default, the Adtrace SDK does not include campaign cost fields in attribution data. To include these fields, enable cost data on your ADTConfig instance before SDK initialization.
Set this option before you call [Adtrace appDidLaunch:] / Adtrace.appDidLaunch(...). See Configuration for how to create the config.
Method signature
- (void)setNeedsCost:(BOOL)needsCost;
You can also assign the needsCost property directly on ADTConfig.
| Parameter | Type | Description |
|---|---|---|
needsCost | BOOL | Set YES / true to request cost fields in attribution (costType, costAmount, costCurrency). |
What this enables
When cost data is enabled and available for the campaign, Adtrace can return these fields in ADTAttribution:
costTypecostAmountcostCurrency
If cost data is not enabled, or not available for the attributed campaign, these fields are nil.
Enable cost data
Call setNeedsCost: on your ADTConfig instance before appDidLaunch.
Example
- Objective-C
- Swift
- Javascript
[adtraceConfig setNeedsCost:YES];
Or assign the property:
adtraceConfig.needsCost = YES;
adtraceConfig?.needsCost = true
adtraceConfig.setNeedsCost(true);