Open In App

AdTech | A Complete Beginner’s Guide

AdTech, or Advertising Technology, refers to the various tools and platforms used to target, deliver, and optimize digital advertising. Understanding AdTech is essential for Publishers, Adops, Advertisers, Developers, and anyone interested in the digital advertising landscape.

Evolution of Programmatic Ads

Programmatic advertising represents a significant shift in ad buying, moving from traditional manual processes to automated bidding for digital advertising space.

This evolution began with the advent of ad exchanges and real-time bidding (RTB), allowing advertisers to buy ad space in real time, targeting specific audiences more effectively. Over time, programmatic advertising has become more sophisticated with the integration of artificial intelligence and machine learning, enabling even more precise targeting and optimization of ad campaigns.



Components of AdTech

What is Prebid?

Prebid is an open-source framework that allows publishers to implement header bidding, where multiple ad exchanges bid on ad inventory simultaneously before calling the ad server and the partner with highest bids get to serve the ads on the website.

Components of Prebid and a Sample Example Code




<html>
  
    <head>
        <link rel="icon" type="image/png" href="/favicon.png">
        <script async src=
"//www.googletagservices.com/tag/js/gpt.js">
        </script>
        <script async src=
"//cdn.jsdelivr.net/npm/prebid.js@latest/dist/not-for-prod/prebid.js">
        </script>
        <script>
            var div_1_sizes = [
                [300, 250],
                [300, 600]
            ];
            var div_2_sizes = [
                [728, 90],
                [970, 250]
            ];
            var PREBID_TIMEOUT = 1000;
            var FAILSAFE_TIMEOUT = 3000;
  
            var adUnits = [
                {
                    code: '/19968336/header-bid-tag-0',
                    mediaTypes: {
                        banner: {
                            sizes: div_1_sizes
                        }
                    },
                    bids: [{
                        bidder: 'appnexus',
                        params: {
                            placementId: 13144370
                        }
                    }]
                },
                {
                    code: '/19968336/header-bid-tag-1',
                    mediaTypes: {
                        banner: {
                            sizes: div_2_sizes
                        }
                    },
                    bids: [{
                        bidder: 'appnexus',
                        params: {
                            placementId: 13144370
                        }
                    }]
                }
            ];
  
            // ======== DO NOT EDIT BELOW THIS LINE =========== //
            var googletag = googletag || {};
            googletag.cmd = googletag.cmd || [];
            googletag.cmd.push(function() {
                googletag.pubads().disableInitialLoad();
            });
  
            var pbjs = pbjs || {};
            pbjs.que = pbjs.que || [];
  
            pbjs.que.push(function() {
                pbjs.addAdUnits(adUnits);
                pbjs.requestBids({
                    bidsBackHandler: initAdserver,
                    timeout: PREBID_TIMEOUT
                });
            });
  
            function initAdserver() {
                if (pbjs.initAdserverSet) return;
                pbjs.initAdserverSet = true;
                googletag.cmd.push(function() {
                    pbjs.que.push(function() {
                        pbjs.setTargetingForGPTAsync();
                        googletag.pubads().refresh();
                    });
                });
            }
            // in case PBJS doesn't load
            setTimeout(function() {
                initAdserver();
            }, FAILSAFE_TIMEOUT);
  
            googletag.cmd.push(function() {
                googletag.defineSlot('/19968336/header-bid-tag-0', div_1_sizes, 'div-1').addService(googletag.pubads());
                googletag.pubads().enableSingleRequest();
                googletag.enableServices();
            });
            googletag.cmd.push(function() {
                googletag.defineSlot('/19968336/header-bid-tag-1', div_2_sizes, 'div-2').addService(googletag.pubads());
                googletag.pubads().enableSingleRequest();
                googletag.enableServices();
            });
  
        </script>
  
    </head>
  
    <body>
        <h2>Basic Prebid.js Example</h2>
        <h5>Div-1</h5>
        <div id='div-1'>
            <script type='text/javascript'>
                googletag.cmd.push(function() {
                    googletag.display('div-1');
                });
  
            </script>
        </div>
  
        <br>
  
        <h5>Div-2</h5>
        <div id='div-2'>
            <script type='text/javascript'>
                googletag.cmd.push(function() {
                    googletag.display('div-2');
                });
  
            </script>
        </div>
  
    </body>
  
</html>

Output:

The above sample code is very basic implementation of Prebid.js on a page that involved Google Ad Manager as a primary Ad Server. Working of the above code in a brief is added below.

Defining Ad Units

At the heart of the script are the definitions of ad units. An ad unit represents a space on a webpage where an ad can be displayed. In this example, two ad units are defined:

Each ad unit is given a unique ‘code’ (an identifier), and the sizes of ads it can accommodate are specified.

Step 1: Prebid.js Configuration

The integration with GAM is where the real-time bidding magic happens:

Step 2: Significance of disableInitialLoad(): It instructs GAM to wait before loading ads, allowing Prebid.js to conduct its auction first.

Step 3: Initialising Ad Server: Once bids are received, or after a failsafe timeout (FAILSAFE_TIMEOUT), the ad server is initialized. Prebid.js sets targeting information based on the auction’s results and then hands control over to GAM.

Finally, the ad slots (div-1 and div-2) on the webpage are linked to the respective ad units in GAM. When the page is loaded, GAM displays the winning ads in these slots.

How Does This Benefit Publishers?

By implementing this setup, publishers can maximize their ad revenue. Prebid.js allows multiple demand sources to bid on the ad inventory simultaneously, ensuring that the highest bid wins the slot. This competition naturally drives up the bid prices, potentially leading to higher revenues than traditional, sequential bidding processes.

Importance of Timeouts

Note the use of timeouts in the script (PREBID_TIMEOUT and FAILSAFE_TIMEOUT). These ensure that the user experience remains smooth. If the auction takes too long, the ad server is called in to display the ads without further delay, striking a balance between revenue optimization and user experience.


Article Tags :