0

如何与 Google 广告管理器 ( GAM ) 联系以获取预出价视频广告,我在 Google 广告管理器帐户中创建了视频广告单元、订单项和广告素材,并且还创建了巨大的 url 标签。我不知道如何使用 prebid.js 在我的网站中添加大量标签或视频单元。我是 prebid.js 的新手

我有以下来自 prebid 示例的示例

<!DOCTYPE html>
<html lang="en-US">

<head>
    <script async src="https://www.googletagservices.com/tag/js/gpt.js"></script>
    <script type="text/javascript" src="https://amp.akamaized.net/hosted/1.x/player?apikey=sample"></script>
    <script type="text/javascript"
        src="https://amp.akamaized.net/hosted/1.1/player.esi?apikey=prebid.org.samples"></script>
    <script async src="//acdn.adnxs.com/prebid/not-for-prod/prebid.js"></script>

    <script>

        var pbjs = pbjs || {};
        pbjs.que = pbjs.que || [];

        var googletag = googletag || {};
        googletag.cmd = googletag.cmd || [];

        var PREBID_TIMEOUT = 1000;

        var adUnits = [{
            code: 'video1',
            mediaTypes: {
                video: {
                    context: 'outstream',
                    playerSize: [640, 480],
                    mimes: ['video/mp4'],
                    protocols: [1, 2, 3, 4, 5, 6, 7, 8],
                    playbackmethod: [2],
                    skip: 1
                }
            },
            bids: [
                {
                    bidder: 'appnexus',
                    params: {
                        placementId: 13232385
                    }
                }
            ]
        }];

        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();
                    googletag.pubads().refresh();
                });
            });
        }

        setTimeout(function () {
            initAdserver();
        }, PREBID_TIMEOUT);

        googletag.cmd.push(function () {
            var slot1 = googletag.defineSlot('/19968336/prebid_outstream_adunit_1', [[1, 1]], 'video1').addService(googletag.pubads());
            googletag.pubads().disableInitialLoad();
            googletag.pubads().enableSingleRequest();
            googletag.enableServices();
        });

    </script>
</head>

<body>
    <div id='video1'>
        <p>Prebid Outstream Video Ad</p>
        <script type='text/javascript'>
            googletag.cmd.push(function () {
                googletag.display('video1');
            });

        </script>
    </div>
</body>

</html> 

我可以对上述代码进行哪些更改,因此在进行更改后,我将使用我在 GAM 中创建的 AdUnit 或 lineitem 在我的网站上获取广告。如果需要 DSP 进行测试,我是否可以在 Google Ad Manager 中添加我自己的视频或视频网址,或者我可以用我的巨大 url 标签在哪里添加大量标签或实现我真的很困惑要做什么有人可以帮忙吗?

4

0 回答 0