What Is Header Bidding And How To Implement It

Posted by

[]The header bidding technology began to develop in 2015, and has actually given that assisted lots of publishers to grow their profits 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 stock to lots of ad exchanges, also called Supply-Side Platforms (or SSPs), at the same time prior to making calls to their ad servers.

[]Here are the actions a publisher needs to pass to have this technology power up its monetization.

  • Apply to SSP partners and get approval.
  • Execute Prebid.JS on website.
  • Configure advertisement server.
  • Pick an approval management system.
  • Test and debug.

Applying To SSP Partners

[]There are numerous SSP partners readily available in the list to use, however I wish 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 needs to find their online application form and go through the business’s verification procedure. For example, when it comes to Xandr, the contact page looks like this:

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

[]For instance, Sharethrough only requires 20M ad impressions. Besides, they consider also audience quality, traffic geolocation, just how much time users spend on the website, and so on. It typically takes a couple of weeks after applying to be approved and onboarded

[]with them, so it can be a fairly time-consuming procedure that may even take months to finish. 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 respond with their CPM bids– let’s state$1

[]and$ 1.50– and Prebid.js makes a demand to the advertisement server, with the highest

[]CPM targeting. In this case, that would be $1.50. At the ad server, in our case, Google Ad Manager, the request is gotten and it knows that somebody is

[]paying $1.50 USD CPM for an ad. 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 Ad Supervisor, December 2022 The technique here is that auctions take place 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 wishes to purchase stock for the least expensive cost

[]possible. With header bidding, bidders have the ability to contend and push CPMs (and for that reason profits) up. There are two ways to execute 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 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 Manager(or advertisement server).

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

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

[]with GDPR and GPP personal privacy standards. Below is the sample code taken from the main paperwork. 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 very first lines pack all needed JS files and our tailored Prebid.JS file.
  • Ad slots are defined 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 demand to be sent out to Google Advertisement Supervisor up until Prebid.js completes the auction.
  • pbjs.requestBids work calls SSP partners and figures out the winner.
  • initAdserver() function is called to send out an advertisement demand to the Google Advertisement Supervisor 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 action.)
  • When Google Advertisement Supervisor gets the request with the winning bid, it runs its own auction in Google AdX, and returns either the AdX advertisement with a greater CPM, or the advertisement of the winning SSP.

[]For your particular case, you might need to code in a different way and change the setup, however the principle remains the exact same.

[]Besides that, I would like to rapidly review how to execute lazy loading, due to the fact that it is a little bit different.

How To Execute 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 need to run an auction, and determine and set key values prior to sending a request to the advertisement server.

[]Due to the fact that of that, I would advise 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.

alternatives = ; 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 ad server.

function observer_handler( entries, observer) 1055389 function lazySlotPrebid(slot, div_id) // endd of initDynamicSlotPrebid []Now, let’s jump on establishing the advertisement server using Google Ad Supervisor.

How To Set Up GAM For Header Bidding

[]Advertisement servers require to have lots of price priority line items with key 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 web browser on page load.

  • The winning SSP partner is sent 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 needs to pay more than $2.62 in order to win the quote and show a Google Advertisement.
  • []As I discussed above, you would require to develop line products in GAM with particular 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.

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

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

    Action 1: Make It Possible For API Gain Access To

    []In the Google Ad manager Worldwide > General settings section, make certain API gain access to is enabled.

    []Click on the Add service account button and develop a user with the sample name “GAM API USER” and email “[email protected]” with admin rights.

    Screenshot from Google Ad Manager, December 2022 Step 2: Produce A New Task

    Browse to Google API Console

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

    []a new project, get in a name for the task, and, additionally, edit the provided Project ID. Click Produce.

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

    []. Click Create to download a file including a private key. Screenshot from Google API Console Qualifications page, Deccember 2022 Screenshot from Google API Console Qualifications page, Deccember 2022 Complete the service account information you have actually developed above. Assign the role “owner” and develop the service account OAuth2 credentials. Then, click the created user and create JSON type secret, and download it. Screenshot from Google API Console Qualifications page, Deccember 2022 Action 3: Download Job Download the project zip file and

    unzip it, directory site(additionally, you can use the git command tool to clone the repo). Set up author for your operating system in order to build the job. Step 4: Change your PHP.INI Change your php.ini( situated at/ xampp/php/php. ini)file and allow”

    []extension=soap”by getting rid of”;” 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 whatever established

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

    []n’t updated because 2019, to use the current variation path of libraries. Open the command line of your PC and switch to the directory site where you have actually unzipped the files(using cd command or right-click inside the folder” Git celebration here “if you have git set up), and run composer update in the PC terminal or git terminal. It will develop subfolders and develop the job. Step 6: Set Up Your Google Advertisement Supervisor Credentials Move the downloaded JSON secret “gam-api-54545-0c04qd8fcb. json” file into the root folder of

    the project you have actually built. Next, download adsapi_php. ini file []and set up your Google Ad 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 path to the JSON crucial file in the folder root. Action 7: Set The Content Of The File Finally, navigate to the file/ script/tests/ConnexionTest

    []. php and set the content 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))echo” n====Connexion OK=== = n n”; else In your terminal(or git bash 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 OK====” Step 8: Configure The Parameters Browse 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 ranges per your needs.

    []putenv(‘ HOME= ‘. dirname (__ DIR __).”/./”); need __ DIR __.’/././ vendor/autoload. php ‘; usage App Scripts HeaderBiddingScript;$bucket_range=range(); $Your_Advertiser_Name=’Sample_Advertiser’; $pails=[“containers”=> [[‘accuracy’=> 2,’minutes ‘=> 0,’max’= > 4.00,’increment’= > 0.01], [‘ accuracy ‘= > 2, ‘minutes’ => 4.01, ‘max’ => 8.00, ‘increment’ => 0.05],]]; foreach ($ buckets [” containers”] as $k => $bucket) ‘sizes’ => [[ 1,1], [160, 600], [250, 250], [300, 250], [300, 600], [320, 50], [320, 100], [300, 100], [336, 280], [728, 90], [970, 90], [970, 250]], ‘sizes’ => [[ 250, 250]], ‘orderPrefix’ => $Your_Advertiser_Name,

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

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

    []php ConnexionTest.php

    []There is a tool utilizing Python that is used likewise; you might wish to provide it a try also.

    Debugging

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

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

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

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

    Screenshot from Google API Console Credentials page, Deccember 2022

    Pick An Authorization Management System

    []Users’ privacy is among the most essential aspects, and you want to ensure that you comply with both GDPR and GPP.

    []The comprehensive instructions on how to establish a consent management system in your wrapper are here.

    []There are lots of service providers which abide by IAB’s most current requirements, and here are a few of the most popular ones:

    Conclusion

    []You may find it unexpected that establishing header bidding includes many actions, but it is really worth it to execute. It can quickly boost your income by +30% or more by producing selling pressure on Google Advertisements.

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

    []I hope that after reading this post, you will find it much easier to set up header bidding and improve the monetization of your site.

    []More resources:

    []Featured Image: Online Best SMM Panel