Header Bidding Debug Guide

1. Check the implementation of prebid snippet on your page. 

 You can find integration snippet in the site settings on the Integration Script tab. Please, notice that snippet is unique for each site.

Integration snippet example:

<script>
    var dayMs = 864e5,  // daily milliseconds
    cb = parseInt(Date.now() / dayMs),
    vpbSrc = '//player.adtelligent.com/prebid/wrapper_hb_pubID_siteID.js?cb=' + cb,
    gptSrc = '//www.googletagservices.com/tag/js/gpt.js',
    c = document.head || document.body || document.documentElement;
    function loadScript(src, cb) {
    var s = document.createElement('script');
    s.src = src;
    c.appendChild(s);
    s.onload = cb;
    s.onerror = cb;
    return s;
}
    loadScript(vpbSrc, function () {
    loadScript(gptSrc);
})
</script>

Where: 

  1. pubID - is your ID in member zone
  2. siteID - is ID of the site in member zone,

So your steps are:

  1. Check if the gpt.js script is removed from the page and present only in prebid snippet code. Open page source code (Ctrl + U → Ctrl+F → type gpt.js → check whether snippet is present only in prebid snippet)
  2. Check if the prebid snippet code is implemented properly, check if site ID & user ID in the script matches to IDs in your member zone. (Ctrl+Shift+I → Elements → Ctrl+F → ?prebid=pubID_siteID).
  3. Next you have to open the Network tab and check if this script is delivered and no 404 error received. (Ctrl+Shift+I → Network → F5 → Filter → wrapper_hb_pubID_siteID.js →  General → Status Code)

If everything is correct, you should find snippet on the page and vmpbjs object in console. For example:

If you received 404, or other error that means not delivering the script, please check the script itself, it should be same as the scripts generated in your member zone. Next, check if the buyers are added to this site in client's member zone, as with no buyers we won't be able to build script on the server and will answer with 404. Please, note that in case you are using the iframe, you won’t have vmpbjs object in your console in this way. Please, go to point 2 to solve it.

2. Checking of the vmpbjs object in case you are using the iframe.

Now you can check the vmpbjs object. If you can find script on the page and no errors received, probably you are dealing with iframe. You need to find a snippet (1), it will be in an iframe (2), as you probably know the iframe has its own scope, so in order to find the vmpbjs object, you need to change global scope(4) to iframe scope by clicking on the #document(3) of the iframe. See a screenshot below:

3. Checking bidders and prebid config with vmpbjs and vpb

 If you receive the vmpbjs and vpb objects in the console, in the website you are debugging, it means that the script is launched and working correctly, the next step is to check an auction and bidders. By checking auctions and bidders on the site you can get an overview of receiving correct config and bidders. I would recommend comparing it with a client member zone, if it is consistent and you see that configs are the same, next is checking delivering the responses. With vmpbjs, you can check:

  • prebid version: vmpbjs.version
  • prebid auction timeout: vmpbjs.getConfig().bidderTimeout
  • returned bids: vmpbjs.getBidResponses()
  • all winning bids: vmpbjs.getAllWinningBids()
  • check key-values set for bidders: vmpbjs.getAdserverTargeting()

For example:

With vpb, you can check prebid config: vpb.cleanConfig (the prebid config, with a breakdown for every ad unit)

In addition, you can use our shippet of JS code to receive a table with all important information. Snippet code:

(function() {
    var responses = vmpbjs.getBidResponses();
    var winners = vmpbjs.getAllWinningBids();
    var output = [];
    Object.keys(responses).forEach(function(adUnitCode) {
        var response = responses[adUnitCode];
        response.bids.forEach(function(bid) {
            output.push({
                bid: bid,
                adunit: adUnitCode,
                adId: bid.adId,
                bidder: bid.bidder,
                time: bid.timeToRespond,
                cpm: bid.cpm,
                msg: bid.statusMessage,
                rendered: !!winners.find(function(winner) {
                    return winner.adId==bid.adId;
                })
            });
        });
    });
    if (output.length) {
        if (console.table) {
            console.table(output);
        } else {
            for (var j = 0; j < output.length; j++) {
                console.log(output[j]);
            }
        }
    } else {
        console.warn('NO prebid responses');
    }
})();

 

There are two ways to use this snippet: 

1. You can copy it to your browser console, on website you are debugging, and press Enter. 

2. You can add it to the snippet in Google Chrome. There are a few easy steps for doing that:  Ctrl+Shift+I → Sources → Press the double arrow symbol in the upper left corner → Snippets → New Snippet → Copy our JS code in it → Press Ctrl+Enter to run it.

So, actions in this guide will allow you to check the implementation of the script on your page and work of our prebid wrapper.