Skip to main content
Version: 4.2.0

Revenue Tracking

Every load and impression event delivers an AdInfo (BMAdInfo) object to delegate callbacks.

AdInfo Fields

FieldTypeDescription
placementIdStringPlacement ID from the BidMachine dashboard
priceDoubleeCPM ÷ 1000 (e.g. 0.005 = $5 CPM)
precisionRevenuePrecisionConfidence level of the reported price
info[String: String]Raw metadata; known keys: networkName, dsp, ecpm

Revenue Precision

RevenuePrecision is an Int-backed enum with three cases (no string name is exposed — use .rawValue for an Int):

SwiftObj-CDescription
.exactRevenuePrecisionExactReal-time auction price
.estimatedRevenuePrecisionEstimatedEstimated based on historical data
.unknownRevenuePrecisionUnknownPrecision could not be determined

Revenue Callback

The didPayRevenue callback is fired when a billable impression is recorded — use it to forward revenue data to your analytics platform.

func didPayRevenue(adInfo: AdInfo) {
analytics.trackRevenue(
adUnit: adInfo.placementId,
revenue: adInfo.price,
precision: adInfo.precision.rawValue,
network: adInfo.info["networkName"]
)
}