What Is Header Bidding And How To Implement It

Posted by

[]The header bidding innovation began to develop in 2015, and has actually given that helped lots of 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 an innovative strategy where publishers use their advertisement stock to lots of advertisement exchanges, also called Supply-Side Platforms (or SSPs), at the same time 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.
  • Implement Prebid.JS on website.
  • Configure advertisement server.
  • Pick a consent management system.
  • Test and debug.

Using To SSP Partners

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

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

[]One needs to discover their online application form and pass through the business’s confirmation procedure. For example, when it comes to Xandr, the contact page looks like this:

Screenshot from Xandr, December 2022 Take note of the []minimum inventory size needed to be eligible for applying. Yes, that is an incredible high of 50M advertisement impressions a month. You might need quite a remarkable website to be able to use to some of the ad networks. We will call them further bidders, as they bid on stock in genuine time. Nevertheless, not all SSPs have such high limits for application.

[]For example, Sharethrough just requires 20M ad impressions. Besides, they consider also audience quality, traffic geolocation, just how much time users invest in the site, etc. It usually takes a couple of weeks after using to be approved and onboarded

[]with them, so it can be a relatively lengthy procedure 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 website, an ad request is made to all bidders(SSP partners). Bidders react with their CPM bids– let’s state$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 advertisement server, in our case, Google Ad Manager, the demand is received and it understands that somebody is

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

[]by our SSP partner. Screenshot from Google Ad Manager, December 2022 The trick here is that auctions occur 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 provide the most affordable CPM possible– as it wishes to buy inventory for the cheapest price

[]possible. With header bidding, bidders have the ability to compete and press CPMs (and for that reason income) up. There are two ways to carry out header bidding

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

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

[]Google Ad Supervisor(or ad server).

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

from the customize page and download the library []built for your specific configuration. Do not forget to choose Approval Management modules to comply

[]with GDPR and GPP privacy requirements. Below is the sample code taken 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 load all needed JS files and our tailored Prebid.JS file.
  • Advertisement slots are defined in the adUnits selection variable.
  • In the adslot meanings, you can see the SSP partners’ names and IDs you will be offered when onboarding when them.
  • googletag.pubads(). disableInitialLoad(); is contacted us to disable ad request to be sent out to Google Advertisement Manager till Prebid.js finishes the auction.
  • pbjs.requestBids function calls SSP partners and determines the winner.
  • initAdserver() function is contacted us to send an advertisement request to the Google Advertisement Supervisor with hb_pb secret, which includes the winning CPM value, e.g. hb_pb=”1.5 ″. (This action is gotten in touch with setting up Google Ad Manager in the next action.)
  • When Google Advertisement Manager gets the demand with the winning bid, it runs its own auction in Google AdX, and sends back either the AdX advertisement with a greater CPM, or the advertisement of the winning SSP.

[]For your specific case, you might need to code differently and alter the setup, however the principle remains the same.

[]Aside from that, I would like to quickly discuss how to carry out lazy loading, due to the fact that it is a bit various.

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 because you require to run an auction, and identify and set crucial values before sending a demand to the ad server.

[]Because of that, I would advise utilizing the Intersection Observer API to figure out when to load the advertisement in the HTML

tag when it is about to participate in the viewport.

choices = ; your_observer = brand-new IntersectionObserver( observer_handler, options ); 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() pbjs.request quotes( );// endd of initDynamicSlotPrebid []Now, let’s jump on setting up the ad server using Google Ad Manager.

How To Establish GAM For Header Bidding

[]Ad servers need to have dozens of price top priority line items with crucial hb_pb targeting all possible CPM worths, such as hb_pb=0.04, hb_pb=0.03, etc hb_pb key 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 to GAM with a crucial worth targeting hb_pb = 2.62.
  • Because the order has the very same CPM worth, GAM comprehends that there is a bid at $2.62.
  • GAM runs an AdX auction and has to pay more than $2.62 in order to win the quote and display a Google Advertisement.
  • []As I mentioned above, you would require 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 items, which are difficult to do manually.

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

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

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

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

    Action 1: Enable API Access

    []In the Google Ad supervisor Global > General settings area, make certain API gain access to is enabled.

    []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: Create A New Job

    Navigate to Google API Console

    []Credentials page. From the job drop-down, choose Produce

    []a brand-new project, enter a name for the task, and, optionally, modify the supplied Project ID. Click Develop.

    []On the Credentials page, []select Create qualifications, then select Service account secret.Select New service account, and select JSON

    []. Click Produce to download a file consisting of a personal key. Screenshot from Google API Console Qualifications page, Deccember 2022 Screenshot from Google API Console Credentials page, Deccember 2022 Fill out the service account details you have actually developed above. Assign the function “owner” and develop the service account OAuth2 qualifications. Then, click the developed user and develop JSON type secret, and download it. Screenshot from Google API Console Credentials page, Deccember 2022 Action 3: Download Project Download the task zip file and

    unzip it, directory(alternatively, you can use the git command tool to clone the repo). Install composer for your operating system in order to build the task. Step 4: Modification your PHP.INI Modification your php.ini( situated at/ xampp/php/php. ini)file and enable”

    []extension=soap”by eliminating”;” in front of and set”soap.wsdl _ cache_ttl=0″ and restart Apache from the control board of XAMPP. Step 5: Create Subfolders And Build The Project When you have whatever set up

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

    []n’t updated considering that 2019, to use the most recent version 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 bash here “if you have actually git installed), and run author upgrade in the PC terminal or git terminal. It will produce subfolders and build the job. Action 6: Establish Your Google Advertisement Supervisor Qualifications Move the downloaded JSON key “gam-api-54545-0c04qd8fcb. json” file into the root folder of

    the task you have actually built. Next, download adsapi_php. ini file []and established your Google Ad Supervisor qualifications 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 key 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 content of the file like below: putenv(‘ HOME =’. dirname( __ DIR __ ).

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

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

    []putenv(‘ HOME= ‘. dirname (__ DIR __).”/./”); need __ DIR __.’/././ vendor/autoload. php ‘; usage App Scripts HeaderBiddingScript;$bucket_range=array(); $Your_Advertiser_Name=’Sample_Advertiser’; $pails=[“containers”=> [[‘accuracy’=> 2,’min ‘=> 0,’max’= > 4.00,’increment’= > 0.01], [‘ accuracy ‘= > 2, ‘min’ => 4.01, ‘max’ => 8.00, ‘increment’ => 0.05],]]; foreach ($ pails [” buckets”] as $k => $bucket) >
    Optionally you can also specify ‘geoTargetingList’ => “dz, pk, ke, pt” or custom crucial worth targeting customTargeting’ => [‘ amp_pages’ => yes’] if you desire your header bidding to work just when the custom essential worth is set.

    []Run the command listed below and it will begin producing line products per the pail settings you have actually specified.

    []php ConnexionTest.php

    []There is a tool using Python that is utilized likewise; you may want to provide it a try too.


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

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

    []You need to make sure that hb_pb secret values are passed to Google Ad Manager. Use “/? google_console=1” at the end of the URL to open the GAM console, and click on “Shipment Diagnostics” of each ad system.

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

    Screenshot from Google API Console Qualifications page, Deccember 2022

    Select An Authorization Management System

    []Users’ personal privacy is among the most essential factors, and you want to ensure that you adhere to 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 newest 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 execute. It can easily increase your revenue by +30% or more by producing selling pressure on Google Ads.

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

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

    []More resources:

    []Included Image: Best SMM Panel