Skip to main content
Version: SDK 5.0.x

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.

public class AdImpression
extends Object
Inheritance

java.lang.Object ← io.justtrack.AdImpression

Constructors

AdImpression

public AdImpression(@NonNull AdUnit unit, @NonNull String sdkName)

AdImpression

public AdImpression(@NonNull String unit, @NonNull String sdkName)

Methods

setBundleId

public AdImpression setBundleId(@Nullable String bundleId)

Sets the bundle ID for this ad impression.

Parameters

NameDescription
bundleIdThe bundle ID of the advertised app. May be null.

Returns

This instance to allow for method chaining.

setInstanceName

public AdImpression setInstanceName(@Nullable String instanceName)

Sets the instance name for this ad impression.

Parameters

NameDescription
instanceNameThe name of the instance of the ad. May be null.

Returns

This instance to allow for method chaining.

setNetwork

public AdImpression setNetwork(@Nullable String network)

Sets the network for this ad impression.

Parameters

NameDescription
networkThe name of the ad network which provided the ad. May be null.

Returns

This instance to allow for method chaining.

setPlacement

public AdImpression setPlacement(@Nullable String placement)

Sets the placement for this ad impression.

Parameters

NameDescription
placementThe placement of the ad. May be null.

Returns

This instance to allow for method chaining.

setRevenue

public AdImpression setRevenue(@Nullable Money revenue)

Sets the revenue for this ad impression.

Parameters

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

Returns

This instance to allow for method chaining.

setSegmentName

public AdImpression setSegmentName(@Nullable String segmentName)

Sets the segment name for this ad impression.

Parameters

NameDescription
segmentNameThe name of the segment of the ad. May be null.

Returns

This instance to allow for method chaining.

setTestGroup

public AdImpression setTestGroup(@Nullable String testGroup)

Sets the test group for this ad impression.

Parameters

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

Returns

This instance to allow for method chaining.