Skip to main content
Version: SDK 5.0.x

AdImpression

public class AdImpression

Represents an ad impression to be sent to the justtrack backend. This class is used to collect data related to ad impressions, which can be utilized to calculate the ad revenue generated by your app.

init(...)

public init(unit: String, sdkName: String)

init(...)

public convenience init(unit: AdUnit, sdkName: String)

set(network:)

Sets the network for this ad impression.

public func set(network: String?) -> Self

Parameters

networkThe name of the ad network which provided the ad. May be nil.

Return Value

This instance to allow for method chaining.

set(placement:)

Sets the placement for this ad impression.

public func set(placement: String?) -> Self

Parameters

placementThe placement of the ad. May be nil.

Return Value

This instance to allow for method chaining.

set(testGroup:)

Sets the test group for this ad impression.

public func set(testGroup: String?) -> Self

Parameters

testGroupThe test group of the user if we are A/B testing. May be nil.

Return Value

This instance to allow for method chaining.

set(segmentName:)

Sets the segment name for this ad impression.

public func set(segmentName: String?) -> Self

Parameters

segmentNameThe name of the segment of the ad. May be nil.

Return Value

This instance to allow for method chaining.

set(instanceName:)

Sets the instance name for this ad impression.

public func set(instanceName: String?) -> Self

Parameters

instanceNameThe name of the instance of the ad. May be nil.

Return Value

This instance to allow for method chaining.

set(bundleId:)

Sets the bundle ID for this ad impression.

public func set(bundleId: String?) -> Self

Parameters

bundleIdThe bundle ID of the advertised app. May be nil.

Return Value

This instance to allow for method chaining.

set(revenue:)

Sets the revenue for this ad impression.

public func set(revenue: Money?) -> Self

Parameters

revenueThe amount of revenue this ad generated. May be zero but must not be negative.

Return Value

This instance to allow for method chaining.