What Is Header Bidding And How To Implement It

Posted by

[]The header bidding technology started to develop in 2015, and has considering that helped many publishers to grow their profits by as much as 40% (and even, sometimes, to levels of 100% or more.)

What Is Header Bidding?

[]Header bidding is an innovative method where publishers use their advertisement stock to lots of advertisement exchanges, also called Supply-Side Platforms (or SSPs), at the same time before 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.
  • Carry out Prebid.JS on site.
  • Configure advertisement server.
  • Choose an approval management system.
  • Test and debug.

Using To SSP Partners

[]There are numerous SSP partners offered 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 (previously AppNexus).
  • Teads.
  • Pubmatic.
  • Sovrn.
  • Verizon.
  • Magnite (previously Rubicon).
  • OpenX.
  • Sonobi.
  • GumGum.
  • Sharethrough.
  • Unurly.

[]One requires to discover their online application and travel through the company’s verification procedure. For instance, when it comes to Xandr, the contact page looks like this:

Screenshot from Xandr, December 2022 Focus on the []minimum inventory size needed to be eligible for using. Yes, that is a staggering high of 50M ad impressions a month. You may need quite a remarkable site 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. However, not all SSPs have such high limits for application.

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

[]with them, so it can be a fairly lengthy 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 web page, an ad demand is made to all bidders(SSP partners). Bidders react with their CPM quotes– let’s say$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 Advertisement Manager, the request is received 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 provides 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 Supervisor, December 2022 The trick 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 does not have any competition, it will offer the lowest CPM possible– as it wants to buy inventory for the least expensive price

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

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

[]worked on the server. Let’s talk about 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 Manager(or advertisement server).

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

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

[]with GDPR and GPP privacy requirements. Below is the sample code taken from the main documentation. var div_1_sizes=[ [300, 250]

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

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

Standard Prebid.js Example

Div-1

Div-2

[]Let’s break down the code above.

  • The first lines load all needed JS files and our customized Prebid.JS file.
  • Advertisement slots are defined in the adUnits array variable.
  • In the adslot definitions, 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 advertisement request to be sent to Google Advertisement Manager till Prebid.js finishes the auction.
  • pbjs.requestBids work calls SSP partners and figures out the winner.
  • initAdserver() function is contacted us to send an advertisement demand to the Google Ad Supervisor with hb_pb secret, which includes the winning CPM worth, e.g. hb_pb=”1.5 ″. (This action is connected with establishing Google Ad Manager in the next step.)
  • When Google Advertisement Supervisor gets the request with the winning quote, it runs its own auction in Google AdX, and sends back either the AdX advertisement with a greater CPM, or the ad of the winning SSP.

[]For your specific case, you might need to code in a different way and change the setup, but the concept stays the same.

[]Besides that, I want to rapidly discuss how to execute lazy loading, because it is a bit 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 need to run an auction, and identify and set key values prior to sending out a request to the advertisement server.

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

tag when it will enter into the viewport.

choices = margin around root. Worths resemble css residential or commercial property. Unitless worths not enabled limit: 0; your_observer = brand-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 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 bids( timeout: PREBID_TIMEOUT, adUnitCodes: [div_id], bidsBackHandler: function() ); );// endd of initDynamicSlotPrebid []Now, let’s get on setting up the advertisement server using Google Ad Supervisor.

How To Establish GAM For Header Bidding

[]Ad servers require to have dozens of price concern line items with essential hb_pb targeting all possible CPM worths, such as hb_pb=0.04, hb_pb=0.03, and so on hb_pb crucial 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 out to GAM with an essential value targeting hb_pb = 2.62.
  • Because the order has the exact same CPM worth, GAM understands that there is a quote at $2.62.
  • GAM runs an AdX auction and has to pay more than $2.62 in order to win the quote and show a Google Ad.
  • []As I mentioned above, you would require to construct line products in GAM with certain granularity, say 0.01– and for the CPM range $0-$20, you would need to create 2,000 line items, which are impossible to do by hand.

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

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

    []It is a rather complicated job, however thanks to contributors 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 establish Google Ad Manager and comprehend the following:

    Action 1: Make It Possible For API Access

    []In the Google Ad manager International > General settings section, make sure API gain access to is made it possible for.

    []Click on 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 Ad Manager, December 2022 Action 2: Create A New Job

    Browse to Google API Console

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

    []a new project, go into a name for the project, and, additionally, modify the supplied Project ID. Click Develop.

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

    []. Click Create to download a file containing a private key. Screenshot from Google API Console Qualifications page, Deccember 2022 Screenshot from Google API Console Credentials page, Deccember 2022 Fill in the service account details you have actually developed above. Appoint the role “owner” and develop the service account OAuth2 qualifications. Then, click the created user and develop JSON type secret, and download it. Screenshot from Google API Console Qualifications page, Deccember 2022 Action 3: Download Task Download the project zip file and

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

    []extension=soap”by removing”;” in front of and set”soap.wsdl _ cache_ttl=0″ and reboot Apache from the control panel of XAMPP. Step 5: Create Subfolders And Build The Project Once 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″. Check for the most fresh version at the moment you perform this. Search and replace in/ app []/ folder of the job”v201911″with” v202202″, since that git job was

    []n’t upgraded given that 2019, to utilize the most recent variation path of libraries. Open the command line of your PC and switch to the directory site where you have actually unzipped the files(utilizing cd command or right-click inside the folder” Git celebration here “if you have actually git set up), and run author upgrade in the PC terminal or git terminal. It will produce subfolders and construct the job. Action 6: Set Up Your Google Ad Supervisor Qualifications Move the downloaded JSON secret “gam-api-54545-0c04qd8fcb. json” file into the root folder of

    the task you’ve built. Next, download adsapi_php. ini file []and established your Google Advertisement Manager 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 course to the JSON crucial file in the folder root. Action 7: Set The Content Of The File Lastly, browse to the file/ script/tests/ConnexionTest

    []. php and set the content of the file like below: putenv(‘ HOUSE =’. 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 celebration 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 criteria in the $entry and$pails varieties per your requirements.

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

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

    []Run the command listed below and it will start developing line items per the container settings you’ve specified.

    []php ConnexionTest.php

    []There is a tool utilizing Python that is used likewise; you may want to give it a shot as well.

    Debugging

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

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

    []You require to make certain that hb_pb secret worths 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 ad unit.

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

    Screenshot from Google API Console Credentials page, Deccember 2022

    Select An Authorization Management System

    []Users’ privacy is among the most essential aspects, and you wish to make sure that you abide by both GDPR and GPP.

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

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

    Conclusion

    []You might discover it surprising that setting up header bidding includes numerous actions, however it is truly worth it to carry out. It can easily improve your profits by +30% or more by creating selling pressure on Google Advertisements.

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

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

    []More resources:

    []Included Image: Online Best SMM Panel