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

Detect Missing Ads #3397

Closed or-daniel closed 5 years ago

or-daniel commented 5 years ago

Type of issue

Question

Description

In our company, we use prebid.js together with DFP for our header bidding.

An issue we're now facing with is detecting when ads are missing. We'd like to be alerted when ads don't show, to prevent income loss. From my understanding, one of the reasons an ad won't show is when the ad can't render.

We are currently using two prebid.js events that detect when the slot is empty and when an ad render fails, and send alerts to Google Analytics. The problem is the is.empty event doesn't seem to reflect solid information - sometimes ad shows but it still says slot is empty. regarding the adRenderFailed, I just can't get it to work.

googletag.cmd.push(function () {

     //... our code
     //... our code

    //Sending Errors to Google Analytics
            pbjs.onEvent('adRenderFailed', function () {
                console.log("Ad failed to load, check Google Analytics");
                ga('send', 'event', 'ERROR', 'Ad Render Failed', 'Ad Render Failed');
            });

            googletag.pubads().addEventListener('slotRenderEnded', function (event) {

                if (event.isEmpty) {
                    ga('send', 'event', 'ERROR', 'Event is EMPTY', 'Event is EMPTY');
                    console.log("Slot is empty, Ad not rendered");
                }

            });

I tried to simulate a scenario in which the ad rendering fails, but I couldn't figure how.

So I have two questions:

  1. What can cause an ad to fail to render, and how can we avoid it?
  2. Is there another way to make sure ads appear on a page?

Thanks in advance

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

jayzach99 commented 5 years ago

Might be valuable to ascertain the conditions for adRenderFailed (working backwards from here https://github.com/prebid/Prebid.js/blob/65afce66fd25b3724173e960c8901e92e7d2cf36/src/constants.json#L39 // https://github.com/prebid/Prebid.js/blob/65afce66fd25b3724173e960c8901e92e7d2cf36/src/prebid.js#L269-L271). Might be able to find that inspecting code / docs.

Re: forced failures -- some thoughts:

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.