How can I get Google Funding Choices to work with PreBid.js

534 views Asked by At

We're using both GFC as our consent platform and client side PreBid along with Google DFP. The implementation looks correct and most of the time we see the bids appearing correctly along with the consent tokens, however, on some occasions we get the following error message from prebid:

ERROR: CMP not found. Canceling auction as per consentManagement config. undefined.

We load both scripts asynchronously, but we do load Google's script first and then Prebid.js right after that.

We suspect that Google's implementation doesn't create the __tcfapi or __cmp objects immediately on the global scope, and that if those are not present, PreBid cancels the auction and doesn't fire the bids.

Did anyone else stumble upon this issue and can verify? Is there a way to prevent this from happening without delaying the page load or the ads? If not, is there a way to register an error handler on prebid?

1

There are 1 answers

0
Janning Vygen On

We had the same problem. We use fundingchoices which is now integrated into Google AdManager.

Try

window.googlefc = window.googlefc || {};
window.googlefc.ccpa = window.googlefc.ccpa || {}
window.googlefc.callbackQueue = window.googlefc.callbackQueue || [];
// wait for consent
googlefc.callbackQueue.push({
  'CONSENT_DATA_READY': () => {
       // do prebidding
   }
});

But it seems to be very slow as the Google Publisher Tag (gpt.js) must be loaded which then decides that a FundingChoice/CMP is needed which gets loaded and then after a while the consent is available.

We don't have it production because it is too slow. Does somebody knwo how to speed things up with fundingchoice aka AdManger-GDPR-Messages