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 AdTraceConfig instance before SDK initialization.

Method signature

public void setNeedsCost(boolean needsCost)
ParameterTypeDescription
needsCostbooleanSet 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 AdTraceAttribution:

  • costType
  • costAmount
  • costCurrency

If cost is not enabled, or not available for the attributed campaign, these fields are null.

Enable cost data

Call setNeedsCost(true) on your AdTraceConfig instance before AdTrace.onCreate(). See Configuration for how to create the config.

config.setNeedsCost(true);