What Is Header Bidding And How To Implement It

Posted by

[]The header bidding technology started to establish in 2015, and has considering that assisted many publishers to grow their earnings by as much as 40% (and even, in some cases, to levels of 100% or more.)

What Is Header Bidding?

[]Header bidding is a strategy where publishers offer their advertisement stock to lots of advertisement exchanges, likewise called Supply-Side Platforms (or SSPs), simultaneously prior to making calls to their advertisement 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.
  • Configure advertisement server.
  • Choose a permission management system.
  • Test and debug.

Using To SSP Partners

[]There are hundreds of SSP partners available in the list to apply, however I wish to mention what I believe to be the most popular ones:

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

[]One needs to discover their online application and travel through the company’s verification procedure. For instance, in the case of Xandr, the contact page looks like this:

Screenshot from Xandr, December 2022 Focus on the []minimum inventory size needed to be qualified for applying. Yes, that is an incredible high of 50M advertisement impressions a month. You might require quite an excellent website to be able to apply to a few of the advertisement networks. We will call them more bidders, as they bid on stock in genuine time. Nevertheless, not all SSPs have such high thresholds for application.

[]For instance, Sharethrough only needs 20M advertisement impressions. Besides, they consider likewise audience quality, traffic geolocation, how much time users spend on the website, etc. It typically takes a couple of weeks after using to be authorized and onboarded

[]with them, so it can be a fairly time-consuming process that may even take months to complete. 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 react with their CPM quotes– 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 advertisement server, in our case, Google Ad Manager, the demand is gotten and it knows that somebody is

[]paying $1.50 USD CPM for an advertisement. It runs another auction with Google Adsense or AdX. If Google offers a greater 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 trick here is that auctions occur in real-time, which produces purchasing pressure on Google AdX to pay the greatest

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

[]possible. With header bidding, bidders have the ability to contend and push CPMs (and for that reason income) up. There are two methods to execute header bidding

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

[]operated on the server. Let’s discuss 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 Advertisement Manager(or ad server).

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

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

[]with GDPR and GPP personal privacy requirements. Below is the sample code taken from the official 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 needed JS files and our customized Prebid.JS file.
  • Ad 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 request to be sent out to Google Ad Manager until Prebid.js ends up the auction.
  • pbjs.requestBids work calls SSP partners and identifies the winner.
  • initAdserver() function is called to send out an advertisement demand to the Google Advertisement Manager with hb_pb key, which includes the winning CPM value, e.g. hb_pb=”1.5 ″. (This step is connected with setting up Google Advertisement Supervisor in the next step.)
  • When Google Advertisement Manager gets the demand with the winning quote, it runs its own auction in Google AdX, and returns either the AdX ad with a higher CPM, or the advertisement of the winning SSP.

[]For your particular case, you might need to code differently and change the setup, however the concept remains the exact same.

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

How To Implement 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 figure out and set crucial worths before sending a request to the advertisement server.

[]Due to the fact that of that, I would encourage using the Intersection Observer API to figure out when to load the ad in the HTML

tag when it is about to participate in the viewport.

choices = visible quantity of product displayed in relation to root; your_observer = new IntersectionObserver( observer_handler, alternatives ); your_observer. observe( goog_adslots [i]; []In the observer_handler call back function, you can run the prebid auction and call the advertisement server.

function observer_handler( entries, observer) dynamicAdUnit = []; pbjs.addAdUnits(dynamicAdUnit); slot = window.googletag.defineSlot(‘ function lazySlotPrebid(slot, div_id) pbjs.que.push(function() pbjs.request bids( timeout: PREBID_TIMEOUT, adUnitCodes: [div_id], bidsBackHandler: function() pbjs.setTargetingForGPTAsync( [div_id]; googletag.pubads(). revitalize(slot); ); );// endd of initDynamicSlotPrebid []Now, let’s jump on setting up the ad server utilizing Google Ad Manager.

How To Establish GAM For Header Bidding

[]Ad servers require to have lots of price 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 key worth 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 worth targeting hb_pb = 2.62.
  • Given that the order has the very same CPM value, 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 bid and display a Google Advertisement.
  • []As I mentioned above, you would require to construct line products in GAM with particular granularity, say 0.01– and for the CPM variety $0-$20, you would require to produce 2,000 line products, which are difficult to do manually.

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

    []Regrettably, there are no solid options that you can simply download and run in one click.

    []It is a somewhat complex job, however thanks to contributors who built API tools (despite the fact that 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 understand the following:

    Step 1: Allow API Gain Access To

    []In the Google Advertisement supervisor Global > General settings area, ensure API gain access to is allowed.

    []Click 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 Supervisor, December 2022 Action 2: Produce A New Job

    Browse to Google API Console

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

    []a brand-new project, enter a name for the project, and, additionally, edit the offered Project ID. Click Develop.

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

    []. Click Develop to download a file consisting of a private key. Screenshot from Google API Console Credentials page, Deccember 2022 Screenshot from Google API Console Credentials page, Deccember 2022 Fill out the service account information you’ve produced above. Assign the role “owner” and produce the service account OAuth2 credentials. Then, click the produced user and produce JSON type key, and download it. Screenshot from Google API Console Credentials page, Deccember 2022 Action 3: Download Task Download the project zip file and

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

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

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

    []n’t upgraded considering that 2019, to use 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(utilizing cd command or right-click inside the folder” Git celebration here “if you have actually git installed), and run author upgrade in the PC terminal or git terminal. It will create subfolders and construct the project. Action 6: Set Up Your Google Advertisement Supervisor Qualifications Move the downloaded JSON secret “gam-api-54545-0c04qd8fcb. json” file into the root folder of

    the job you’ve developed. 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 course to the JSON essential file in the folder root. Action 7: Set The Material Of The File Finally, navigate to the file/ script/tests/ConnexionTest

    []. php and set the material of the file like listed 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 celebration console) test the connection by running the command(if you remain in the/ script/tests/ folder). php ConnexionTest.php You should see a message”= == =Connection OK====” Step 8: Set Up The Parameters Navigate to the

    file/ script/tests/ConnexionTest. php in your task and open it. Copy and paste the listed below code into that file, and configure the criteria in the $entry and$containers selections per your requirements.

    []putenv(‘ HOME= ‘. dirname (__ DIR __).”/./”); need __ DIR __.’/././ vendor/autoload. php ‘; use App Scripts HeaderBiddingScript;$bucket_range=range(); $Your_Advertiser_Name=’Sample_Advertiser’; $containers=[“pails”=> [[‘precision’=> 2,’minutes ‘=> 0,’max’= > 4.00,’increment’= > 0.01], [‘ accuracy ‘= > 2, ‘min’ => 4.01, ‘max’ => 8.00, ‘increment’ => 0.05],]]; foreach ($ pails [” buckets”] as $k => $bucket) prebid advertiserName ‘orderName’ => $order_name]; $script = brand-new HeaderBiddingScript(); $script-> createGlobalAdUnits($entry);

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

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

    []php ConnexionTest.php

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


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

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

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

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

    Screenshot from Google API Console Qualifications page, Deccember 2022

    Pick An Approval Management System

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

    []The detailed instructions on how to set up a permission management system in your wrapper are here.

    []There are numerous companies which abide by IAB’s latest requirements, and here are a few of the most popular ones:


    []You might discover it surprising that establishing header bidding involves so many steps, however it is actually worth it to implement. It can quickly improve your earnings by +30% or more by creating selling pressure on Google Ads.

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

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

    []More resources:

    []Included Image: Online SMM Panel