Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impression tracking for Mobile Original api #5713

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,28 @@ This section describes the integration details for different ad formats. In each

{% include mobile/adunit-config-android.md %}

### Impression tracking

In the Bidding Only integration scenario, PUC is responsible for tracking events for banner ads, like `burl`, `imp`, and `win`. The disadvantage of this approach is that PUC doesn't have reliable information about the viewability of the WebView. As a result, impression tracking happens at the rendering stage of the ad. Or, if MRAID is supported, once the `viewableChange` event is fired. It leads to big discrepancies since the "1 pixel in view" requirement is not met.

Starting with version `2.4.0`, Prebid SDK introduced the API to track the viewability of the ad and track impression event, respectively.

To activate impression tracking for the banner ad unit - use the `activatePrebidImpressionTracker(adView)` method. The `adView` parameter should be an instance of AdManagerAdView:

```java
adUnit.activatePrebidImpressionTracker(adView)
adUnit.fetchDemand(builder, resultCode -> { ... })
```

For activation for the interstitial ad unit, you should set `activatePrebidImpressionTracker()` flag:

```java
Interstitial adUnit = InterstitialAdUnit(CONFIG_ID, WIDTH, HEIGTH);
adUnit.activatePrebidImpressionTracker();
```

After the invocation of `activatePrebidImpressionTracker(),` the Prebid SDK will start analyzing the View Hierarchy and track the viewability of the ad view. Once the ad view is viewable for the user for at least 1 pixel for 1 second, the SDK will track an impression event for the presented ad. The SDK will stop analyzing the View Hierarchy once the caller object of `activatePrebidImpressionTracker()` is destroyed.

## Further Reading

- [Prebid Mobile Overview](/prebid-mobile/prebid-mobile.html)
Expand Down
24 changes: 24 additions & 0 deletions prebid-mobile/pbm-api/ios/ios-sdk-integration-gam-original-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,30 @@ This section describes the integration details for different ad formats. In each

{% include mobile/adunit-config-ios.md %}

### Impression tracking

In the Bidding Only integration scenario, PUC is responsible for tracking events for banner ads, like `burl`, `imp`, and `win`. The disadvantage of this approach is that PUC doesn't have reliable information about the viewability of the WebView. As a result, impression tracking happens at the rendering stage of the ad. Or, if MRAID is supported, once the `viewableChange` event is fired. It leads to big discrepancies since the "1 pixel in view" requirement is not met.

Starting with version `2.4.0`, Prebid SDK introduced the API to track the viewability of the ad and track impression event, respectively.

To activate impression tracking for the banner ad unit - use the `activatePrebidImpressionTracker(adView)` method. The `adView` parameter should be an instance of AdManagerAdView:

```swift
adUnit.activatePrebidImpressionTracker(adView: gamBanner)
adUnit.fetchDemand(adObject: gamRequest) { [weak self] resultCode in
// ...
}
```

For activation for the interstitial ad unit, you should set `activatePrebidImpressionTracker()` flag:

```swift
let adUnit = InterstitialAdUnit(configId: CONFIG_ID, minWidthPerc: WIDTH_PERC, minHeightPerc: HEIGTH_PERC)
adUnit.activatePrebidImpressionTracker()
```

After the invocation of `activatePrebidImpressionTracker(),` the Prebid SDK will start analyzing the View Hierarchy and track the viewability of the ad view. Once the ad view is viewable for the user for at least 1 pixel for 1 second, the SDK will track an impression event for the presented ad. The SDK will stop analyzing the View Hierarchy once the caller object of `activatePrebidImpressionTracker()` is destroyed.

## Further Reading

- [Prebid Mobile Overview](/prebid-mobile/prebid-mobile.html)
Expand Down