What Is Header Bidding And How To Implement It

Posted by

[]The header bidding innovation began to establish in 2015, and has given that helped many publishers to grow their revenue by as much as 40% (and even, in many cases, to levels of 100% or more.)

What Is Header Bidding?

[]Header bidding is a cutting-edge technique where publishers provide their ad stock to numerous ad 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.
  • Implement Prebid.JS on site.
  • Set up advertisement server.
  • Select a permission management system.
  • Test and debug.

Using To SSP Partners

[]There are hundreds of SSP partners readily available in the list to use, but I wish to discuss what I believe to be the most popular ones:

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

[]One requires to find their online application form and travel through the business’s verification procedure. For example, when it comes to Xandr, the contact page appears like this:

Screenshot from Xandr, December 2022 Pay attention to the []minimum stock size needed to be eligible for using. Yes, that is a staggering high of 50M advertisement impressions a month. You might require rather a remarkable website to be able to apply to a few of the advertisement networks. We will call them additional bidders, as they bid on inventory in genuine time. However, not all SSPs have such high thresholds for application.

[]For example, Sharethrough only needs 20M ad impressions. Besides, they consider likewise audience quality, traffic geolocation, how much time users invest in the website, and so on. It usually takes a few weeks after applying to be approved and onboarded

[]with them, so it can be a relatively lengthy process that may even take months to end up. How Does Prebid.js Work? In nutshell, here is how Prebid.js works. When a user opens a webpage, an advertisement demand is made to all bidders(SSP partners). Bidders respond with their CPM bids– let’s state$1

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

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

[]paying $1.50 USD CPM for an ad. It runs another auction with Google Adsense or AdX. If Google provides a higher CPM, then the Google Advertisement 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 trick here is that auctions take place in real-time, which creates purchasing pressure on Google AdX to pay the highest

[]CPM possible. If Google AdX does not have any competitors, it will provide the most affordable CPM possible– as it wants to buy inventory for the most affordable price

[]possible. With header bidding, bidders have the ability to complete and press CPMs (and therefore revenue) up. There are 2 methods to execute header bidding

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

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

[]Google Ad Supervisor(or advertisement server).

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

from the customize page and download the library []developed for your specific configuration. Don’t forget to choose Authorization Management modules to comply

[]with GDPR and GPP 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]]

Basic Prebid.js Example



[]Let’s break down the code above.

  • The first lines fill all needed JS files and our tailored Prebid.JS file.
  • Advertisement slots are specified in the adUnits array 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 contacted us to disable ad demand to be sent to Google Ad Supervisor till Prebid.js finishes the auction.
  • pbjs.requestBids work calls SSP partners and figures out the winner.
  • initAdserver() function is called to send an ad demand to the Google Ad Manager with hb_pb secret, which contains the winning CPM value, e.g. hb_pb=”1.5 ″. (This step is gotten in touch with establishing Google Ad Manager in the next action.)
  • When Google Advertisement Supervisor 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 ad of the winning SSP.

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

[]Aside from that, I wish to rapidly go over how to implement lazy loading, due to the fact that it is a little different.

How To Carry Out Lazy Loading

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

[]This is since you require to run an auction, and identify and set essential values before sending out a request to the advertisement server.

[]Because of that, I would advise using the Intersection Observer API to determine when to fill the advertisement in the HTML

tag when it is about to enter into the viewport.

options = relative to record viewport rootMargin: ‘1500px’,; your_observer = brand-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) 1055389 function lazySlotPrebid(slot, div_id) // endd of initDynamicSlotPrebid []Now, let’s get on establishing the ad server utilizing Google Ad Supervisor.

How To Establish GAM For Header Bidding

[]Advertisement servers require to have lots of cost priority line items with essential hb_pb targeting all possible CPM worths, such as hb_pb=0.04, hb_pb=0.03, etc hb_pb essential value targeting

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

  • The winning SSP partner is sent to GAM with a crucial value targeting hb_pb = 2.62.
  • Given that the order has the same CPM worth, 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 display a Google Advertisement.
  • []As I discussed above, you would require to develop line products in GAM with certain granularity, say 0.01– and for the CPM range $0-$20, you would require to produce 2,000 line products, which are difficult to do manually.

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

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

    []It is a rather complex task, however thanks to factors who developed API tools (although 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 Manager and understand the following:

    Action 1: Enable API Access

    []In the Google Ad manager Global > General settings section, make sure API gain access to is enabled.

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

    Screenshot from Google Ad Manager, December 2022 Step 2: Create A New Project

    Browse to Google API Console

    []Qualifications page. From the project drop-down, select Develop

    []a brand-new project, get in a name for the task, and, additionally, modify the provided Project ID. Click Create.

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

    []. Click Create to download a file including a private key. Screenshot from Google API Console Qualifications page, Deccember 2022 Screenshot from Google API Console Qualifications page, Deccember 2022 Fill in the service account information you’ve produced above. Assign the role “owner” and create the service account OAuth2 qualifications. Then, click on the produced user and create JSON type key, and download it. Screenshot from Google API Console Credentials page, Deccember 2022 Step 3: Download Project Download the job zip file and

    unzip it, directory site(additionally, 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: Modification your PHP.INI Change your php.ini( situated at/ xampp/php/php. ini)file and allow”

    []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: Create Subfolders And Build The Task As soon as you have whatever established

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

    []n’t updated considering that 2019, to utilize the most recent variation course 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 composer update in the PC terminal or git terminal. It will produce subfolders and construct the task. Action 6: Establish Your Google Advertisement Supervisor Qualifications Move the downloaded JSON secret “gam-api-54545-0c04qd8fcb. json” file into the root folder of

    the task you have actually constructed. Next, download adsapi_php. ini file []and established your Google Ad 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 absolute directory site course to the JSON essential file in the folder root. Step 7: Set The Material Of The File Lastly, browse to the file/ script/tests/ConnexionTest

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

    “/./” ); require __ 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 are in the/ script/tests/ folder). php ConnexionTest.php You must see a message”= == =Connection okay====” Step 8: Configure The Parameters Browse to the

    file/ script/tests/ConnexionTest. php in your job and open it. Copy and paste the listed below code into that file, and configure the parameters in the $entry and$containers varieties per your needs.

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

    []Additionally you can likewise define ‘geoTargetingList’ => “dz, pk, ke, pt” or custom crucial value targeting customTargeting’ => [‘ amp_pages’ => yes’] if you want your header bidding to work only when the custom-made crucial value is set.

    []Run the command listed below and it will start creating line items per the bucket settings you have actually defined.

    []php ConnexionTest.php

    []There is a tool utilizing Python that is utilized similarly; you may wish to give it a try also.


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

    []Alternatively, open your webpage URL utilizing “/? pbjs_debug=real” parameter at the end of the URL, and see console logs messages.

    []You need to ensure that hb_pb secret values are passed to Google Advertisement Manager. Use “/? google_console=1” at the end of the URL to open the GAM console, and click “Shipment Diagnostics” of each advertisement unit.

    []You need to see that hb_pb worths are set and passed to the advertisement server.

    Screenshot from Google API Console Qualifications page, Deccember 2022

    Select A Consent Management System

    []Users’ personal privacy is among the most important aspects, and you wish to ensure that you abide by both GDPR and GPP.

    []The comprehensive instructions on how to establish a consent management system in your wrapper are here.

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


    []You may find it unexpected that establishing header bidding includes a lot of steps, however it is really worth it to implement. It can quickly enhance your income by +30% or more by developing selling pressure on Google Advertisements.

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

    []I hope that after reading this post, you will discover it simpler to set up header bidding and enhance the monetization of your website.

    []More resources:

    []Included Image: Best SMM Panel