prebid / Prebid.js

Setup and manage header bidding advertising partners without writing code or confusing line items. Prebid.js is open source and free.
https://docs.prebid.org
Apache License 2.0
1.28k stars 2.05k forks source link

Paapi Module: Autoconfig behavior #11242

Open lksharma opened 6 months ago

lksharma commented 6 months ago

Description

Prebid version 8.37.0 introduced new features allowing auction configurations to be independent of GPT. This version also introduced functionality to clear cached auction configurations by resetting them with null values using setConfig. However, in certain scenarios, cached auction configurations can persist, leading to duplicate impression calls, as observed in version 8.36.0. This ticket also provides additional context to issue #11102 which is pending discussions on the desired default autoconfig behaviour.

Issue Details

Problem Scenario:

If the publisher neglects to call pbjs.setPAAPIConfigForGPT() for subsequent refresh calls, Prebid does not reset the previously set auction configuration, leading to potential duplicate impression calls.

Example Setup:


function initAdserver() {
    pbjs.initAdserverSet = true;
    googletag.cmd.push(function() {
        pbjs.que.push(function() {
            pbjs.setPAAPIConfigForGPT();
            ...
        });
    });
}

function refreshBid() {
    pbjs.que.push(function() {
        pbjs.requestBids({
            timeout: 1000,
            bidsBackHandler: function() {
                // pbjs.setPAAPIConfigForGPT(); not called
                ...
            }
        });
    });
}

Steps to Reproduce:

Potential Solution:

Previously set auction configs are reset by the logic within the slotConfigurator function, which executes when pbjs.setPAAPIConfigForGPT() is called. Automating pbjs.setPAAPIConfigForGPT() calls within setTargetingForGPTAsync() or similar functions could reduce the likelihood of configuration errors and mitigate potential duplicate impression calls.

patmmccann commented 6 months ago

If the publisher neglects to call pbjs.setPAAPIConfigForGPT() for subsequent refresh calls, Prebid does not reset the previously set auction configuration, leading to potential duplicate impression calls.

Another solution is we just tell pubs not to make this mistake. We could potentially warn them if they request bids on a slot thrice but only called pbjs.setPAAPIConfigForGPT() once

Thanks for flagging as relevant to #11102

patmmccann commented 5 months ago

@lksharma any objection to closing this and tracking on #11102 ? Or the inverse, closing that and tracking here?

lksharma commented 5 months ago

Let's close issue https://github.com/prebid/Prebid.js/issues/11102 and continue discussions within this ticket since it contains most of the relevant context.

patmmccann commented 5 months ago

Sounds good, ty!

patmmccann commented 4 months ago

One thought: if we start handing auction configs to gam or another TLS before targeting is ready, marrying them together might present some challenges as we try and solve for latency

patmmccann commented 3 months ago

Spoke with the GAM team, a 'allAuctionConfigAreSubmitted' function might be coming to GPT. That would make marrying these more difficult if publishers plan to take advantage.

patmmccann commented 3 months ago

Consensus - provide this feature request with a new name and delete the autoconfig feature. The new name could be ‘submitAuctionConfigsWithTargeting’ or something more compact

lksharma commented 3 months ago

Reviewing the MR, it looks like the issue of cached auction configurations has not yet been addressed. As long as pbjs.setPAAPIConfigForGPT() can be misconfigured for subsequent refresh calls, cached auction configurations remain a possibility. Is there a concern with including a call to pbjs.setPAAPIConfigForGPT() within setTargetingForGPTAsync consistently?

patmmccann commented 3 months ago

That's covered in #10930

patmmccann commented 1 month ago

@lksharma we're chatting about this and realizing we may have achieved your goals; where do we go from here?

lksharma commented 1 month ago

Agreed. I've also recently updated the documentation to reflect this case as well: https://github.com/prebid/prebid.github.io/pull/5526. I think we are good to close this out. Thanks.