Repository navigation
Description
[Rendering API][GAM] Make manual impression counting configurable — false loses Prebid impressions, true loses viewability (and is unsupported on backfill ad units)
Summary
GamBannerEventHandler hard-codes setManualImpressionsEnabled(true) for every GAM request. Publishers cannot change it, and neither value works fully today:
| Setting | Prebid wins | GAM wins |
|---|---|---|
true (current, hard-coded) |
Impression counted via recordManualImpression() ✅Active View never fires ❌ |
No impression pixel observed ❌ (nothing calls recordManualImpression() on this path) |
false (not possible without patching) |
Impression never counted ❌ Active View never fires ❌ |
Impression + Active View counted automatically ✅ |
Background: how the GAM Rendering API counts impressions
- Prebid sends the GAM request with
hb_*targeting throughPublisherAdViewWrapper(AdManagerAdView). - If the Prebid line item wins, its 1x1 creative fires
PrebidAppEvent. GamBannerEventHandler.handleAppEvent()keeps the GAM view as a hiddenproxyBannerand callsonPrebidSdkWin().BannerView.displayPrebidView()renders Prebid's own creative. The GAM view is never added to the view hierarchy.- On
onAdDisplayed→trackImpression()→proxyBanner.recordManualImpression().
Why true was likely chosen as the default
We could not find a documented rationale (the code arrived with #305 "Introduce Rendering API", which migrated an earlier SDK; #278 has no description).
Problems
1. Not configurable
Publishers whose GAM ad units serve backfill or mediation cannot follow Google's guidance without forking the handler.
2. true → GAM's own winning ads may not be counted
With d_imp_hdr=1 GAM returns the impression URL in manual_impression_urls for all winners. When GAM wins, the view is displayed, but nothing calls recordManualImpression(). In our test the GAM view was displayed and onAdImpression fired, but no pcs/view request was sent.
3. true → no Active View for Prebid wins
pcs/view is sent natively by GMA on recordManualImpression(). pcs/activeview is sent by Active View JS (lidar.js) inside the GAM creative's WebView and needs that view to be measured on screen. The proxy view is never attached, so Active View only loads (gen_204?id=av-js) and never reports.
4. false → Prebid wins are never counted
With manual impressions off, GAM returns impression_urls (display-triggered). The proxy view never gets a displayed pixel, so pcs/view never fires; recordManualImpression() is a no-op.
Questions for maintainers
- Can you confirm the original reason for hard-coding manual impressions to
true? - Is the missing
recordManualImpression()on the GAM-win path known/intended? - Would you accept a PR for configurable impression tracking, and which option for ?
- Any guidance on viewability?
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTriage
Activity
[-]GAM Manual impression[/-][+]GAM Manual impression ISSUE[/+]YuriyVelichkoPI commentedon Oct 22, 2026
Hi @vivekyadav15 thank you for the report and for describing the issue during the PMC call.
The reason is that we needed to track impressions when Prebid won, so this had to be handled manually. Otherwise, as mentioned in the ticket, the impression was never counted.
This is not intended. It definitely looks like a bug.
Absolutely—please open a PR.
We do not have specific guidance at this time, as it is difficult to determine how to address the Active View issue in this scenario. At a minimum, the OM tag can be used to measure the viewability of ads rendered by the Prebid SDK.
YuriyVelichkoPI commentedon Oct 24, 2026
@vivekyadav15 , please take a look @justadreamer PR's. let us know if they address your issue or there are some uncovered corner cases.
The PR's don't solve Active View issue.
vivekyadav15 commentedon Nov 18, 2026
@YuriyVelichkoPI I believe that with the proposed approach, the Active View (viewability) pixel might not fire, since it relies on the GAM view being part of the view hierarchy. Setting manualImpression to true may trigger the impression event, but it won't necessarily trigger the viewability pixel.
Could we instead consider adding a GAM view and embedding the Prebid view inside it? This would be somewhat similar to how things work on the web, where the GAM iframe acts as the container and the creative iframe is rendered inside it.
This way, we could potentially ensure that both GAM and Prebid have their respective views in the hierarchy, allowing the impression and viewability pixels to fire correctly for both.
YuriyVelichkoPI commentedon Nov 18, 2026
@vivekyadav15, sure let's try this way.
Have you already tried internally and can make PRs?
vivekyadav15 commentedon Nov 20, 2026
Proposed Approaches: GAM Impression and Active View Measurement for Prebid Rendered Creatives
1. Overview
When Prebid wins, the creative is rendered by the Prebid SDK, while GAM's
AdManagerAdViewis not responsible for rendering the actual ad creative.We have identified three possible approaches based on the positioning of the Prebid creative relative to
AdManagerAdView.2. Impression Tracking Configuration: Manual Impressions Disabled
For the proposed approaches to work, manual impression tracking should be disabled so that GAM can handle impression counting through its automatic impression mechanism.
Configuration:
With manual impressions disabled:
recordManualImpression()for Prebid rendered ads.Important: This configuration must be applied before loading the ad.
3. Android: Three Possible Approaches
GAM Container:
AdManagerAdViewApproach 1: Prebid creative as the topmost view (GAM below Prebid)
Expected behavior:
/pcs/viewimpression pixel fires.lidar2/lidartos) fire.Approach 2: GAM as the topmost view (Prebid below GAM)
Expected behavior:
/pcs/viewimpression pixel fires.lidar2/lidartos) fire.Potential Cons:
Approach 3: Prebid creative inside AdManagerAdView
AdManagerAdViewextendsBaseAdView, which extendsViewGroup, making it a potential candidate for hosting the Prebid creative as a child view.Expected behavior:
/pcs/viewimpression pixel fires.lidar2/lidartos) fire.Potential Cons:
AdManagerAdView.4. Important Implementation Caveat: Creative Dimensions
One important consideration across all three approaches is the size of the GAM creative associated with the Prebid line item.
Currently, the Prebid line item can have a 1×1 creative size. Since Active View relies on the dimensions of the measured ad view, a 1×1 creative may prevent Active View from considering the ad view viewable.
5. Open Questions
AdManagerAdViewinterfere with its native rendering lifecycle?6. Conclusion
We have identified three possible approaches for integrating the Prebid creative with the GAM view hierarchy on Android.
The common prerequisites are:
At this point, we are not certain which approach is correct or officially supported by GMA. We would like feedback on the recommended view hierarchy and whether there is a supported way to achieve both GAM impression tracking and Active View measurement while preserving Prebid's own OMID measurement.