【问题标题】:Prebid not attempting to set key values in ad targetingPrebid 未尝试在广告定位中设置键值
【发布时间】:2019-10-21 05:18:02
【问题描述】:

我正在尝试在我的网站上设置 prebid 并使用 prebid 网站上的示例代码。目前我有 appnexus 和 Adx,这是控制台中的流程: https://i.imgur.com/qme7k26.png

正如您在上图中看到的那样,除了没有尝试设置键值之外,流程是完美的。

预期的流程应该是这样的: https://i.imgur.com/4oPnacA.png

不知道是什么原因造成的。

下面是我的代码:

        var unit_728x90 = [
            [728, 90],
            [600, 300]
        ];
        var unit_300x250 = [
            [336, 280],
            [300, 250],
            [300, 100],
            [320, 50]
        ];
        var unit_320x50 = [
            [320, 50]
        ];
        var unit_300 = [
            [300, 250]
        ];
        var PREBID_TIMEOUT =2000;
        var FAILSAFE_TIMEOUT = 3000;
        var ASSERT_TIMEOUT = 1000;

        var adUnits = [{
                code: '21791303143/upl_belowslidem_300x250',
                mediaTypes: {
                    banner: {
                        sizes: unit_300x250
                    }
                },
                bids: [{
                    bidder: 'appnexus',
                    params: {
                        placementId: 17076422
                    }
                }]
            }     
        ];

        var googletag = googletag || {};
        googletag.cmd = googletag.cmd || [];
        googletag.cmd.push(function() {
            googletag.pubads().disableInitialLoad();
        });
         if(window.screen.width < 769){
            googletag.cmd.push(function() {

             });
         }else{
            googletag.cmd.push(function() {
            googletag.defineSlot('/21791303143/upl_belowslidem_300x250', unit_300x250, 'div-side').addService(googletag.pubads());
            googletag.pubads().enableSingleRequest();
            googletag.enableServices();
            });
        }

        var pbjs = pbjs || {};
        pbjs.que = pbjs.que || [];
        pbjs.que.push(function() {
            pbjs.setConfig({ 
                priceGranularity: "high",
                enableSendAllBids: false,
                useBidCache: true
            })
        });

        pbjs.que.push(function() {
            pbjs.addAdUnits(adUnits);
            pbjs.requestBids({
                bidsBackHandler: initAdserver;
                 }
            });
        });

         function initAdserver() {
            if (pbjs.initAdserverSet) return;
            pbjs.initAdserverSet = true;
            googletag.cmd.push(function() {
                pbjs.que.push(function() {
                    pbjs.setTargetingForGPTAsync('div-side');
                    googletag.pubads().refresh();
                });
            });
        }
        setTimeout(function() {
            initAdserver();
        }, FAILSAFE_TIMEOUT);

【问题讨论】:

    标签: javascript prebid.js header-bidding prebid


    【解决方案1】:

    通常这是因为在您的 Prebid 应用将出价传递给 setTargeting 时,DFP 已经设置了定位并选择了获胜者并为您的广告位呈现了广告。您确定在 DFP/GAM 中使用 disableInitialLoadenableSingleRequest 函数吗?在他们的Basic Example page 上搜索这些内容,以了解他们如何加载 DFP。如果您可以通过链接发送到您的页面,我们也可以从那里准确地告诉您问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-06
      • 2016-02-18
      • 1970-01-01
      • 2012-08-06
      相关资源
      最近更新 更多