What Is Header Bidding And How To Implement It

Posted by

[]The header bidding innovation began to develop in 2015, and has because assisted lots of publishers to grow their earnings by as much as 40% (and even, sometimes, to levels of 100% or more.)

What Is Header Bidding?

[]Header bidding is an innovative strategy where publishers use their advertisement inventory to numerous advertisement exchanges, also called Supply-Side Platforms (or SSPs), concurrently prior to making calls to their ad servers.

[]Here are the steps a publisher needs to pass to have this innovation power up its monetization.

  • Apply to SSP partners and get approval.
  • Execute Prebid.JS on website.
  • Set up ad server.
  • Choose a permission management system.
  • Test and debug.

Using To SSP Partners

[]There are hundreds of SSP partners offered in the list to use, however I would like to mention what I think to be the most popular ones:

  • TripleLift.
  • Index Exchange.
  • Amazon UAM/TAM.
  • Xandr (formerly AppNexus).
  • Teads.
  • Pubmatic.
  • Sovrn.
  • Verizon.
  • Magnite (previously Rubicon).
  • OpenX.
  • Sonobi.
  • GumGum.
  • Sharethrough.
  • Unurly.

[]One requires to find their online application and go through the company’s verification procedure. For instance, in the case of Xandr, the contact page appears like this:

Screenshot from Xandr, December 2022 Pay attention to the []minimum inventory size needed to be qualified for using. Yes, that is an incredible high of 50M advertisement impressions a month. You may require rather a remarkable website to be able to use to some of the ad networks. We will call them more bidders, as they bid on stock in real time. Nevertheless, not all SSPs have such high limits for application.

[]For instance, Sharethrough just requires 20M ad impressions. Besides, they consider also audience quality, traffic geolocation, how much time users spend on the site, etc. It typically takes a couple of weeks after applying to be approved and onboarded

[]with them, so it can be a fairly lengthy procedure that may even take months to finish. How Does Prebid.js Work? In nutshell, here is how Prebid.js works. When a user opens a website, an ad demand is made to all bidders(SSP partners). Bidders react with their CPM quotes– let’s say$1

[]and$ 1.50– and Prebid.js makes a demand to the ad server, with the highest

[]CPM targeting. In this case, that would be $1.50. At the ad server, in our case, Google Ad Manager, the request is received and it understands that someone is

[]paying $1.50 USD CPM for an advertisement. It runs another auction with Google Adsense or AdX. If Google offers a higher CPM, then the Google Ad will be served. If not, our advertisement with $1.50 CPM will win, and be served

[]by our SSP partner. Screenshot from Google Advertisement Manager, December 2022 The technique here is that auctions happen in real-time, which produces purchasing pressure on Google AdX to pay the highest

[]CPM possible. If Google AdX doesn’t have any competitors, it will use the lowest CPM possible– as it wishes to purchase stock for the most inexpensive price

[]possible. With header bidding, bidders are able to compete and push CPMs (and therefore revenue) up. There are two ways to carry out header bidding

[]: Client-side: When the auction runs by means of JavaScript in the browser. Server-side: When the auction is

[]operated on the server. Let’s go over client-side header bidding. How To Implement Client-Side Header Bidding In order to set up header bidding, we require to implement Prebid.js on our website and configure our

[]Google Advertisement Manager(or advertisement server).

Carry out Prebid.js On Your Website Prebid.js []is a header bidding platform that has more than 200 need sources incorporated. You require to choose the SSP partners you are working with

from the customize page and download the library []constructed for your particular configuration. Do not forget to select Approval Management modules to comply

[]with GDPR and GPP privacy requirements. Below is the sample code drawn from the main documentation. var div_1_sizes=[ [300, 250]

[], [300, 600]]; var div_2_sizes= [[

[]728, 90], [970, 250]]

Basic Prebid.js Example



[]Let’s break down the code above.

  • The very first lines load all required JS files and our customized Prebid.JS file.
  • Ad slots are specified in the adUnits selection variable.
  • In the adslot meanings, you can see the SSP partners’ names and IDs you will be provided when onboarding when them.
  • googletag.pubads(). disableInitialLoad(); is contacted us to disable advertisement request to be sent out to Google Ad Manager until Prebid.js finishes the auction.
  • pbjs.requestBids operate calls SSP partners and identifies the winner.
  • initAdserver() function is called to send out an ad request to the Google Advertisement Manager with hb_pb secret, which includes the winning CPM value, e.g. hb_pb=”1.5 ″. (This step is gotten in touch with establishing Google Ad Manager in the next step.)
  • When Google Advertisement Manager gets the request with the winning quote, it runs its own auction in Google AdX, and sends back either the AdX ad with a greater CPM, or the ad of the winning SSP.

[]For your particular case, you might need to code in a different way and alter the setup, however the principle stays the exact same.

[]Besides that, I want to rapidly go over how to execute lazy loading, since it is a little different.

How To Execute Lazy Loading

[]The Google tag for publishers has a lazy loading structure which will not work in the case of header bidding.

[]This is because you require to run an auction, and determine and set crucial values prior to sending a demand to the advertisement server.

[]Since of that, I would recommend utilizing the Intersection Observer API to identify when to load the ad in the HTML

tag when it is about to enter into the viewport.

options = noticeable amount of item displayed in relation to root; your_observer = new IntersectionObserver( observer_handler, choices ); your_observer. observe( goog_adslots [i]; []In the observer_handler recall function, you can run the prebid auction and call the ad server.

function observer_handler( entries, observer) header-bid-tag -0′, [728,90], ‘your_html_div_id’ ). addService(googletag.pubads()); lazySlotPrebid(slot, ‘your_html_div_id’) function lazySlotPrebid(slot, div_id) pbjs.que.push(function() // endd of initDynamicSlotPrebid []Now, let’s get on setting up the ad server using Google Ad Supervisor.

How To Establish GAM For Header Bidding

[]Advertisement servers require to have dozens of rate concern line items with essential hb_pb targeting all possible CPM worths, such as hb_pb=0.04, hb_pb=0.03, etc hb_pb crucial value targeting

[] This is the bottom line that makes the header bidding engine work. The auction runs in the web browser on page load.

  • The winning SSP partner is sent out to GAM with a key value targeting hb_pb = 2.62.
  • Given that the order has the same CPM value, GAM understands that there is a quote at $2.62.
  • GAM runs an AdX auction and needs to pay more than $2.62 in order to win the quote and show a Google Ad.
  • []As I pointed out above, you would require to construct line products in GAM with particular granularity, state 0.01– and for the CPM range $0-$20, you would need to create 2,000 line products, which are difficult to do manually.

    []For that, you would require to utilize GAM API.

    []Unfortunately, there are no solid solutions that you can just download and run in one click.

    []It is a somewhat intricate job, but thanks to factors who developed API tools (even though they are not actively supporting them), we can still customize it a little and make it work.

    []Let’s dive into how to set up Google Ad Supervisor and comprehend the following:

    Action 1: Enable API Gain Access To

    []In the Google Ad manager Global > General settings area, make sure API access is made it possible for.

    []Click on the Include service account button and create a user with the sample name “GAM API USER” and email “[email protected]” with admin rights.

    Screenshot from Google Advertisement Manager, December 2022 Step 2: Develop A New Project

    Browse to Google API Console

    []Credentials page. From the task drop-down, choose Create

    []a new task, enter a name for the job, and, additionally, modify the provided Task ID. Click Create.

    []On the Qualifications page, []choose Develop qualifications, then choose Service account key.Select New service account, and select JSON

    []. Click Develop to download a file including a private secret. Screenshot from Google API Console Qualifications page, Deccember 2022 Screenshot from Google API Console Qualifications page, Deccember 2022 Fill out the service account details you’ve produced above. Appoint the role “owner” and create the service account OAuth2 qualifications. Then, click on the developed user and develop JSON type secret, and download it. Screenshot from Google API Console Credentials page, Deccember 2022 Step 3: Download Task Download the task zip file and

    unzip it, directory site(alternatively, you can utilize the git command tool to clone the repo). Install composer for your os in order to construct the job. Step 4: Modification your PHP.INI Modification your php.ini( situated at/ xampp/php/php. ini)file and enable”

    []extension=soap”by getting rid of”;” in front of and set”soap.wsdl _ cache_ttl=0″ and restart Apache from the control board of XAMPP. Step 5: Produce Subfolders And Build The Job As soon as you have everything established

    and unzipped, open composer.json file and change”googleads/googleads-php-lib”:”^ 44.0.0 “to use the most recent variation” googleads/googleads-php-lib “:”^ 59.0.0″. Look for the most fresh version at the minute you perform this. Browse and replace in/ app []/ folder of the job”v201911″with” v202202″, because that git task was

    []n’t updated given that 2019, to utilize the current version path of libraries. Open the command line of your PC and switch to the directory where you have actually unzipped the files(using cd command or right-click inside the folder” Git celebration here “if you have actually git set up), and run author update in the PC terminal or git terminal. It will develop subfolders and build the job. Step 6: Set Up Your Google Advertisement Manager Credentials Move the downloaded JSON key “gam-api-54545-0c04qd8fcb. json” file into the root folder of

    the job you have actually built. Next, download adsapi_php. ini file []and set up your Google Ad Manager credentials in it. networkCode= “899899” applicationName =”My GAM APP” jsonKeyFilePath=”

    []D: xampp htdocs dfp-prebid-lineitems gam-api-54545-0c04qd8fcb. json”scopes=”https://www.googleapis.com/auth/dfp” impersonatedEmail =” [email protected]nt.com”jsonKeyFilePath is the absolute directory path to the JSON essential file in the folder root. Action 7: Set The Material Of The File Lastly, navigate to the file/ script/tests/ConnexionTest

    []. php and set the content of the file like below: putenv(‘ HOME =’. dirname( __ DIR __ ).

    “/./” ); need __ DIR __.’/./ []./ vendor/autoload. php’; $traffickerId=(new App AdManager UserManager ()) -> getUserId (); if(is_numeric($traffickerId)) else In your terminal(or git bash console) test the connection by running the command(if you remain in the/ script/tests/ folder). php ConnexionTest.php You need to see a message”= == =Connection OK====” Step 8: Set Up The Parameters Navigate to the

    file/ script/tests/ConnexionTest. php in your job and open it. Copy and paste the below code into that file, and set up the criteria in the $entry and$containers arrays per your requirements.

    []putenv(‘ HOUSE= ‘. dirname (__ DIR __).”/./”); need __ DIR __.’/././ vendor/autoload. php ‘; use App Scripts HeaderBiddingScript;$bucket_range=selection(); $Your_Advertiser_Name=’Sample_Advertiser’; $containers=[“containers”=> [[‘precision’=> 2,’minutes ‘=> 0,’max’= > 4.00,’increment’= > 0.01], [‘ precision ‘= > 2, ‘minutes’ => 4.01, ‘max’ => 8.00, ‘increment’ => 0.05],]]; foreach ($ pails [” buckets”] as $k => $bucket) >; $entry = [‘ priceGranularity’ => $request_bucket,

    []Optionally you can also specify ‘geoTargetingList’ => “dz, pk, ke, pt” or custom essential value targeting customTargeting’ => [‘ amp_pages’ => yes’] if you desire your header bidding to work just when the custom key value is set.

    []Run the command listed below and it will start developing line items per the container settings you’ve specified.

    []php ConnexionTest.php

    []There is a tool utilizing Python that is used similarly; you might want to give it a shot as well.


    []For debugging, there are a few web browser add-ons you can use to see if the auction runs without errors.

    []Additionally, open your website URL using “/? pbjs_debug=true” criterion at the end of the URL, and see console logs messages.

    []You need to make sure that hb_pb key worths are passed to Google Advertisement Manager. Usage “/? google_console=1” at the end of the URL to open the GAM console, and click “Shipment Diagnostics” of each advertisement system.

    []You must see that hb_pb worths are set and passed to the ad server.

    Screenshot from Google API Console Qualifications page, Deccember 2022

    Select An Approval Management System

    []Users’ privacy is one of the most essential factors, and you want to ensure that you comply with both GDPR and GPP.

    []The in-depth guidelines on how to set up an approval management system in your wrapper are here.

    []There are numerous companies which comply with IAB’s most current requirements, and here are a few of the most popular ones:


    []You might discover it unexpected that establishing header bidding includes many actions, but it is really worth it to carry out. It can quickly enhance your revenue by +30% or more by creating selling pressure on Google Ads.

    []This guide is for technically savvy users– however if you have questions and concerns, there is an Adops slack channel you might register for and ask concerns to the neighborhood.

    []I hope that after reading this article, you will discover it much easier to establish header bidding and boost the money making of your site.

    []More resources:

    []Featured Image: Online Best SMM Panel