Skip to content

Commit 40cf5bc

Browse files
ValentinPostindustriaOlenaPostindustriaYuriyVelichkoPImuuki88
authored
Impression tracking for Mobile Original api (prebid#5713)
* Impression tracking for Mobile Original api. * Lint correction. * doc: add ios impression tracking section * Update android-sdk-integration-gam-original-api.md doc: update Android section * Update ios-sdk-integration-gam-original-api.md doc: update iOS DOC * doc: minor change in ios-sdk-integration-gam-original-api.md * Update android-sdk-integration-gam-original-api.md doc: small change --------- Co-authored-by: Olena Stepaniuk <olena.stepaniuk@postindustria.com> Co-authored-by: Yuriy Velichko <yuriy.velichko@postindustria.com> Co-authored-by: Muki Seiler <muuki88@users.noreply.github.com>
1 parent 14d6cb4 commit 40cf5bc

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

prebid-mobile/pbm-api/android/android-sdk-integration-gam-original-api.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,28 @@ This section describes the integration details for different ad formats. In each
4141

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

44+
### Impression tracking
45+
46+
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.
47+
48+
Starting with version `2.4.0`, Prebid SDK introduced the API to track the viewability of the ad and track impression event, respectively.
49+
50+
To activate impression tracking for the banner ad unit - use the `activatePrebidImpressionTracker(adView)` method. The `adView` parameter should be an instance of AdManagerAdView:
51+
52+
```java
53+
adUnit.activatePrebidImpressionTracker(adView)
54+
adUnit.fetchDemand(builder, resultCode -> { ... })
55+
```
56+
57+
For activation for the interstitial ad unit, you should set `activatePrebidImpressionTracker()` flag:
58+
59+
```java
60+
Interstitial adUnit = InterstitialAdUnit(CONFIG_ID, WIDTH, HEIGTH);
61+
adUnit.activatePrebidImpressionTracker();
62+
```
63+
64+
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.
65+
4466
## Further Reading
4567

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

prebid-mobile/pbm-api/ios/ios-sdk-integration-gam-original-api.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,30 @@ This section describes the integration details for different ad formats. In each
4141

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

44+
### Impression tracking
45+
46+
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.
47+
48+
Starting with version `2.4.0`, Prebid SDK introduced the API to track the viewability of the ad and track impression event, respectively.
49+
50+
To activate impression tracking for the banner ad unit - use the `activatePrebidImpressionTracker(adView)` method. The `adView` parameter should be an instance of AdManagerAdView:
51+
52+
```swift
53+
adUnit.activatePrebidImpressionTracker(adView: gamBanner)
54+
adUnit.fetchDemand(adObject: gamRequest) { [weak self] resultCode in
55+
// ...
56+
}
57+
```
58+
59+
For activation for the interstitial ad unit, you should set `activatePrebidImpressionTracker()` flag:
60+
61+
```swift
62+
let adUnit = InterstitialAdUnit(configId: CONFIG_ID, minWidthPerc: WIDTH_PERC, minHeightPerc: HEIGTH_PERC)
63+
adUnit.activatePrebidImpressionTracker()
64+
```
65+
66+
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.
67+
4468
## Further Reading
4569

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

0 commit comments

Comments
 (0)