What Is Header Bidding And How To Implement It

Posted by

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

What Is Header Bidding?

[]Header bidding is an advanced method where publishers offer their ad inventory to lots of advertisement exchanges, likewise called Supply-Side Platforms (or SSPs), all at once prior to making calls to their advertisement servers.

[]Here are the actions 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.
  • Choose an authorization management system.
  • Test and debug.

Using To SSP Partners

[]There are numerous SSP partners available in the list to use, but I wish 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 (formerly Rubicon).
  • OpenX.
  • Sonobi.
  • GumGum.
  • Sharethrough.
  • Unurly.

[]One needs to discover their online application form and travel through the company’s verification process. For instance, 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 using. Yes, that is an incredible high of 50M advertisement impressions a month. You may require quite an outstanding website to be able to apply to a few of the ad networks. We will call them further bidders, as they bid on inventory in genuine 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 invest in the site, etc. It normally takes a few weeks after using to be approved and onboarded

[]with them, so it can be a fairly time-consuming procedure 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 website, an ad demand is made to all bidders(SSP partners). Bidders respond 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 Advertisement Manager, the request is received and it knows that someone is

[]paying $1.50 USD CPM for an ad. It runs another auction with Google Adsense or AdX. If Google offers 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 Supervisor, December 2022 The technique here is that auctions take place in real-time, which produces purchasing pressure on Google AdX to pay the greatest

[]CPM possible. If Google AdX doesn’t have any competitors, it will use the lowest CPM possible– as it wants to buy stock for the least expensive price

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

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

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

[]Google Advertisement Manager(or ad server).

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

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

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

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

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

Basic Prebid.js Example

Div-1

Div-2

[]Let’s break down the code above.

  • The very first lines fill 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 given when onboarding when them.
  • googletag.pubads(). disableInitialLoad(); is called to disable advertisement demand to be sent out to Google Advertisement Supervisor till Prebid.js ends up the auction.
  • pbjs.requestBids operate calls SSP partners and figures out the winner.
  • initAdserver() function is contacted us to send out an ad request to the Google Advertisement Manager with hb_pb key, which contains the winning CPM value, e.g. hb_pb=”1.5 ″. (This step is connected with setting up Google Advertisement Manager in the next step.)
  • When Google Ad 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 specific case, you may need to code in a different way and alter the setup, but the concept stays the very same.

[]Aside from that, I want to quickly discuss how to execute lazy loading, because it is a little different.

How To Carry Out 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 need to run an auction, and identify and set crucial worths before sending a demand to the advertisement server.

[]Because of that, I would recommend using the Crossway Observer API to figure out when to load the advertisement in the HTML

tag when it will participate in the viewport.

alternatives = margin around root. Values resemble css residential or commercial property. Unitless worths not enabled limit: 0; your_observer = new IntersectionObserver( observer_handler, options ); your_observer. observe( goog_adslots [i]; []In the observer_handler call back 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 get on setting up the ad server utilizing Google Advertisement Supervisor.

How To Establish GAM For Header Bidding

[]Ad servers require to have lots of rate 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 crucial worth targeting

[] This is the key point 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 a key worth targeting hb_pb = 2.62.
  • Because the order has the exact same CPM value, GAM comprehends 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 build line products in GAM with specific 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 by hand.

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

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

    []It is a somewhat complicated job, however thanks to contributors who constructed 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 comprehend the following:

    Step 1: Enable API Access

    []In the Google Advertisement supervisor Worldwide > General settings section, make certain API access is enabled.

    []Click on the Add 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 Action 2: Create A New Job

    Browse to Google API Console

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

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

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

    []. Click Develop to download a file containing a personal key. Screenshot from Google API Console Qualifications page, Deccember 2022 Screenshot from Google API Console Credentials page, Deccember 2022 Fill in the service account information you’ve produced above. Appoint the function “owner” and develop the service account OAuth2 credentials. Then, click the produced user and produce JSON type key, and download it. Screenshot from Google API Console Qualifications page, Deccember 2022 Step 3: Download Project Download the task zip file and

    unzip it, directory(alternatively, you can utilize the git command tool to clone the repo). Install author for your os in order to construct the task. Step 4: Modification your PHP.INI Modification your php.ini( situated 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 reboot Apache from the control board of XAMPP. Step 5: Develop Subfolders And Build The Job As soon as you have everything established

    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″. Look for the most fresh variation at the moment you perform this. Search and change in/ app []/ folder of the project”v201911″with” v202202″, since that git project was

    []n’t upgraded given that 2019, to use the latest version path of libraries. Open the command line of your PC and switch to the directory where you’ve unzipped the files(using cd command or right-click inside the folder” Git celebration here “if you have git set up), and run composer upgrade in the PC terminal or git terminal. It will develop subfolders and develop the job. Step 6: Set Up Your Google Ad 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 Advertisement Manager 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 essential file in the folder root. Step 7: Set The Material Of The File Finally, navigate to the file/ script/tests/ConnexionTest

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

    “/./” ); require __ DIR __.’/./ []./ vendor/autoload. php’; $traffickerId=(brand-new App AdManager UserManager ()) -> getUserId (); if(is_numeric($traffickerId))echo” n====Connexion okay=== = n n”; 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 should see a message”= == =Connection okay====” Action 8: Configure The Parameters Browse to the

    file/ script/tests/ConnexionTest. php in your project 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 requirements.

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

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

    []Run the command below and it will begin creating line items per the bucket settings you’ve defined.

    []php ConnexionTest.php

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

    Debugging

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

    []Additionally, open your web page URL utilizing “/? pbjs_debug=real” specification at the end of the URL, and enjoy console logs messages.

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

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

    Screenshot from Google API Console Credentials page, Deccember 2022

    Pick A Permission Management System

    []Users’ personal privacy is among the most essential factors, and you wish to make sure that you comply with both GDPR and GPP.

    []The comprehensive directions on how to set up a consent management system in your wrapper are here.

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

    Conclusion

    []You may find it surprising that setting up header bidding involves many steps, however it is truly worth it to execute. It can quickly enhance your revenue by +30% or more by developing selling pressure on Google Advertisements.

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

    []I hope that after reading this short article, you will find it much easier to establish header bidding and enhance the money making of your website.

    []More resources:

    []Included Image: SMM Panel