What Is Header Bidding And How To Implement It

Posted by

[]The header bidding innovation began to develop in 2015, and has since assisted many 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 method where publishers offer their advertisement inventory to many advertisement exchanges, likewise called Supply-Side Platforms (or SSPs), at the same time before making calls to their ad servers.

[]Here are the actions a publisher requires to pass to have this technology power up its money making.

  • Apply to SSP partners and get approval.
  • Carry out Prebid.JS on site.
  • Set up advertisement server.
  • Select an approval management system.
  • Test and debug.

Using To SSP Partners

[]There are hundreds of SSP partners readily available in the list to apply, but I would like to mention 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 discover their online application form and go through the company’s confirmation procedure. For example, when it comes to Xandr, the contact page appears like this:

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

[]For example, Sharethrough only needs 20M ad impressions. Besides, they consider likewise 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 authorized and onboarded

[]with them, so it can be a fairly time-consuming process that might 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 advertisement request is made to all bidders(SSP partners). Bidders respond with their CPM bids– let’s say$1

[]and$ 1.50– and Prebid.js makes a request to the ad 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 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 uses a higher CPM, then the Google Ad will be served. If not, our advertisement 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 happen in real-time, which creates buying 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 purchase stock for the least expensive price

[]possible. With header bidding, bidders are able to compete and press CPMs (and for that reason earnings) up. There are two ways to implement header bidding

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

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

[]Google Advertisement Supervisor(or ad server).

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

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

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

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

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

Fundamental Prebid.js Example

Div-1

Div-2

[]Let’s break down the code above.

  • The first lines fill all needed JS files and our personalized Prebid.JS file.
  • Ad slots are specified in the adUnits selection 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 called to disable advertisement demand to be sent to Google Advertisement Supervisor up until Prebid.js completes the auction.
  • pbjs.requestBids operate calls SSP partners and figures out the winner.
  • initAdserver() function is called to send out an ad demand to the Google Ad Manager with hb_pb secret, which contains the winning CPM worth, e.g. hb_pb=”1.5 ″. (This step is connected with establishing Google Ad 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 may require to code differently and change the setup, but the concept stays the exact same.

[]Other than that, I would like to quickly discuss how to carry out lazy loading, since it is a little bit different.

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 since you need to run an auction, and figure out and set essential worths prior to sending out a demand to the advertisement server.

[]Because of that, I would encourage utilizing the Crossway Observer API to figure out when to pack the ad in the HTML

tag when it will participate in the viewport.

choices = ; your_observer = 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) // endd of initDynamicSlotPrebid []Now, let’s jump on establishing the advertisement server using Google Ad Supervisor.

How To Establish GAM For Header Bidding

[]Ad servers need to have dozens of cost top priority line products with crucial hb_pb targeting all possible CPM values, such as hb_pb=0.04, hb_pb=0.03, etc hb_pb key value 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 an essential worth targeting hb_pb = 2.62.
  • Since the order has the same CPM value, 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 bid and show a Google Advertisement.
  • []As I discussed above, you would require to develop line products in GAM with certain granularity, state 0.01– and for the CPM variety $0-$20, you would need to produce 2,000 line items, which are impossible to do manually.

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

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

    []It is a somewhat complicated job, but thanks to contributors who built 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: Allow API Access

    []In the Google Ad supervisor Worldwide > General settings area, ensure 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 Supervisor, December 2022 Step 2: Develop A New Job

    Navigate to Google API Console

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

    []a new job, enter a name for the job, and, optionally, edit the supplied Task ID. Click Develop.

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

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

    unzip it, directory site(additionally, you can use the git command tool to clone the repo). Set up composer for your operating system in order to develop the job. 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 getting rid of”;” in front of and set”soap.wsdl _ cache_ttl=0″ and reboot Apache from the control board of XAMPP. Step 5: Produce Subfolders And Build The Job As soon as you have whatever established

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

    []n’t upgraded because 2019, to utilize the most recent variation course 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 bash here “if you have git set up), and run author upgrade in the PC terminal or git terminal. It will develop subfolders and develop the project. 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 project you’ve 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. Action 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(‘ HOUSE =’. dirname( __ DIR __ ).

    “/./” ); need __ DIR __.’/./ []./ vendor/autoload. php’; $traffickerId=(new App AdManager UserManager ()) -> getUserId (); if(is_numeric($traffickerId)) 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 OK====” Action 8: Configure The Parameters Browse to the

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

    []putenv(‘ HOUSE= ‘. dirname (__ DIR __).”/./”); need __ DIR __.’/././ vendor/autoload. php ‘; use App Scripts HeaderBiddingScript;$bucket_range=range(); $Your_Advertiser_Name=’Sample_Advertiser’; $containers=[“buckets”=> [[‘precision’=> 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) >; $entry = [‘ priceGranularity’ => $request_bucket,

    []Optionally you can also define ‘geoTargetingList’ => “dz, pk, ke, pt” or custom-made key worth targeting customTargeting’ => [‘ amp_pages’ => yes’] if you want your header bidding to work just when the custom essential worth is set.

    []Run the command listed below and it will begin developing line products per the bucket settings you’ve defined.

    []php ConnexionTest.php

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

    Debugging

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

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

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

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

    Screenshot from Google API Console Qualifications page, Deccember 2022

    Select An Approval Management System

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

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

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

    Conclusion

    []You might discover it unexpected that setting up header bidding involves many steps, however it is truly worth it to execute. It can easily improve your income by +30% or more by developing selling pressure on Google Advertisements.

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

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

    []More resources:

    []Included Image: SMM Panel