Skip to main content

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.

ParameterTypeDescription
needsCostBOOLSet 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:

  • costType
  • costAmount
  • costCurrency

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

[adtraceConfig setNeedsCost:YES];

Or assign the property:

adtraceConfig.needsCost = YES;