What Is Header Bidding And How To Implement It

Posted by

[]The header bidding technology started to establish in 2015, and has actually since helped numerous publishers to grow their income by as much as 40% (and even, in some cases, to levels of 100% or more.)

What Is Header Bidding?

[]Header bidding is a technique where publishers use their advertisement stock to many advertisement exchanges, likewise called Supply-Side Platforms (or SSPs), simultaneously before making calls to their ad servers.

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

  • Apply to SSP partners and get approval.
  • Carry out Prebid.JS on site.
  • Configure ad server.
  • Select a consent management system.
  • Test and debug.

Using To SSP Partners

[]There are hundreds of SSP partners available in the list to use, but I want 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 discover their online application form and go through the business’s confirmation procedure. For example, when it comes to Xandr, the contact page appears like this:

Screenshot from Xandr, December 2022 Take note of the []minimum inventory size required to be eligible for using. Yes, that is a staggering high of 50M ad impressions a month. You might require rather an excellent website to be able to use to some of the ad networks. We will call them further bidders, as they bid on stock in real time. However, not all SSPs have such high thresholds for application.

[]For example, Sharethrough just requires 20M advertisement impressions. Besides, they consider likewise audience quality, traffic geolocation, how much time users spend on the website, etc. It generally takes a couple of weeks after applying to be approved and onboarded

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

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

[]CPM targeting. In this case, that would be $1.50. At the advertisement server, in our case, Google Advertisement Manager, the demand is received and it knows 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 ad 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 creates buying pressure on Google AdX to pay the highest

[]CPM possible. If Google AdX doesn’t have any competition, it will offer the lowest CPM possible– as it wishes to buy stock for the cheapest rate

[]possible. With header bidding, bidders are able to compete and press CPMs (and therefore income) up. There are 2 ways to implement header bidding

[]: Client-side: When the auction runs through JavaScript in the web browser. Server-side: When the auction is

[]run on the server. Let’s discuss client-side header bidding. How To Execute Client-Side Header Bidding In order to establish header bidding, we need to execute Prebid.js on our website and configure our

[]Google Advertisement Manager(or advertisement server).

Execute Prebid.js On Your Site Prebid.js []is a header bidding platform that has more than 200 demand sources incorporated. You need to select the SSP partners you are working with

from the customize page and download the library []built for your specific setup. Do not forget to select Consent Management modules to comply

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

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

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

Fundamental Prebid.js Example



[]Let’s break down the code above.

  • The very first lines load all required JS files and our personalized Prebid.JS file.
  • Advertisement slots are specified in the adUnits variety variable.
  • In the adslot definitions, you can see the SSP partners’ names and IDs you will be given when onboarding when them.
  • googletag.pubads(). disableInitialLoad(); is called to disable advertisement demand to be sent out to Google Ad Supervisor till 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 Supervisor with hb_pb key, which contains the winning CPM value, e.g. hb_pb=”1.5 ″. (This step is gotten in touch with setting up Google Advertisement Supervisor in the next action.)
  • When Google Ad Manager gets the request with the winning bid, it runs its own auction in Google AdX, and returns either the AdX advertisement with a greater CPM, or the advertisement of the winning SSP.

[]For your specific case, you might require to code differently and alter the setup, but the concept remains the very same.

[]Besides that, I would like to quickly discuss how to implement lazy loading, since it is a little bit different.

How To Implement Lazy Loading

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

[]This is due to the fact that you need to run an auction, and identify and set crucial values prior to sending a demand to the ad server.

[]Because of that, I would recommend utilizing the Intersection Observer API to determine when to load the advertisement in the HTML

tag when it will enter into the viewport.

choices = ; your_observer = brand-new IntersectionObserver( observer_handler, alternatives ); 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 jump on setting up the ad server utilizing Google Ad Manager.

How To Establish GAM For Header Bidding

[]Advertisement servers require to have dozens of price concern line items with key hb_pb targeting all possible CPM values, such as hb_pb=0.04, hb_pb=0.03, etc hb_pb essential worth targeting

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

  • The winning SSP partner is sent to GAM with an essential value targeting hb_pb = 2.62.
  • Because the order has the exact same CPM value, GAM comprehends that there is a bid at $2.62.
  • GAM runs an AdX auction and needs to pay more than $2.62 in order to win the quote and display a Google Advertisement.
  • []As I mentioned above, you would need to develop line items in GAM with specific granularity, say 0.01– and for the CPM range $0-$20, you would need to produce 2,000 line products, which are difficult to do manually.

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

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

    []It is a somewhat intricate task, however 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 Advertisement Supervisor and understand the following:

    Action 1: Allow API Access

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

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

    Screenshot from Google Ad Manager, December 2022 Action 2: Produce A New Task

    Navigate to Google API Console

    []Credentials page. From the project drop-down, select Produce

    []a new job, get in a name for the task, and, optionally, modify the offered Project ID. Click Create.

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

    []. Click Produce to download a file containing a private secret. Screenshot from Google API Console Qualifications page, Deccember 2022 Screenshot from Google API Console Credentials page, Deccember 2022 Complete the service account details you’ve created above. Appoint the function “owner” and develop the service account OAuth2 credentials. Then, click on the developed user and produce JSON type key, and download it. Screenshot from Google API Console Credentials page, Deccember 2022 Step 3: Download Job Download the project zip file and

    unzip it, directory(alternatively, you can use the git command tool to clone the repo). Install author for your operating system in order to build the task. Step 4: Change 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 reboot Apache from the control board of XAMPP. Step 5: Produce Subfolders And Build The Project Once you have whatever established

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

    []n’t upgraded since 2019, to use the latest variation course of libraries. Open the command line of your PC and switch to the directory site where you’ve unzipped the files(using cd command or right-click inside the folder” Git bash here “if you have actually git installed), and run author update in the PC terminal or git terminal. It will create subfolders and build the job. Step 6: Establish Your Google Advertisement Manager Credentials Move the downloaded JSON key “gam-api-54545-0c04qd8fcb. json” file into the root folder of

    the task you’ve developed. Next, download adsapi_php. ini file []and established your Google Advertisement Supervisor 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]”jsonKeyFilePath is the outright directory site path to the JSON essential file in the folder root. Action 7: Set The Content Of The File Lastly, navigate to the file/ script/tests/ConnexionTest

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

    “/./” ); need __ DIR __.’/./ []./ vendor/autoload. php’; $traffickerId=(new App AdManager UserManager ()) -> getUserId (); if(is_numeric($traffickerId)) else echo” n===Connexion KO==== n n “; 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 ought to see a message”= == =Connection okay====” Step 8: Set Up The Parameters Navigate to the

    file/ script/tests/ConnexionTest. php in your task and open it. Copy and paste the below code into that file, and set up the specifications in the $entry and$pails varieties per your needs.

    []putenv(‘ HOUSE= ‘. dirname (__ DIR __).”/./”); need __ DIR __.’/././ vendor/autoload. php ‘; usage App Scripts HeaderBiddingScript;$bucket_range=array(); $Your_Advertiser_Name=’Sample_Advertiser’; $buckets=[“buckets”=> [[‘accuracy’=> 2,’min ‘=> 0,’max’= > 4.00,’increment’= > 0.01], [‘ accuracy ‘= > 2, ‘minutes’ => 4.01, ‘max’ => 8.00, ‘increment’ => 0.05],]]; foreach ($ pails [” containers”] as $k => $bucket) $request_bucket = range( ‘containers’ => range( $bucket) ); $order_name=’Your_Order_name ‘.$bucket [‘ minutes’]’-‘.$bucket [‘ max’];

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

    []Run the command below and it will start developing line products per the pail settings you’ve defined.

    []php ConnexionTest.php

    []There is a tool using Python that is utilized likewise; you might wish to offer it a shot as well.


    []For debugging, there are a couple of web browser add-ons you can utilize 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 enjoy console logs messages.

    []You need to ensure that hb_pb key values are passed to Google Advertisement Supervisor. Usage “/? google_console=1” at the end of the URL to open the GAM console, and click on “Delivery Diagnostics” of each advertisement system.

    []You should see that hb_pb values are set and passed to the advertisement server.

    Screenshot from Google API Console Qualifications page, Deccember 2022

    Pick An Authorization Management System

    []Users’ personal privacy is one of the most essential elements, and you wish to make certain that you comply with both GDPR and GPP.

    []The in-depth directions on how to establish an authorization management system in your wrapper are here.

    []There are many companies which abide by IAB’s newest standards, and here are a few of the most popular ones:


    []You may find it surprising that setting up header bidding includes so many actions, but it is truly worth it to execute. It can easily enhance your revenue by +30% or more by producing selling pressure on Google Advertisements.

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

    []I hope that after reading this article, you will discover it easier to set up header bidding and improve the monetization of your site.

    []More resources:

    []Included Image: SMM Panel