What Is Header Bidding And How To Implement It

Posted by

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

What Is Header Bidding?

[]Header bidding is a cutting-edge technique where publishers provide their advertisement stock to numerous ad exchanges, also called Supply-Side Platforms (or SSPs), all at once before making calls to their advertisement servers.

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

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

Using To SSP Partners

[]There are numerous SSP partners available in the list to apply, however I would like to discuss what I believe to be the most popular ones:

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

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

Screenshot from Xandr, December 2022 Take notice of the []minimum stock size required to be eligible for using. Yes, that is an incredible high of 50M advertisement impressions a month. You might need quite an outstanding site to be able to use to some of the ad networks. We will call them additional bidders, as they bid on inventory in genuine time. Nevertheless, not all SSPs have such high thresholds for application.

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

[]with them, so it can be a relatively time-consuming process that may even take months to end up. How Does Prebid.js Work? In nutshell, here is how Prebid.js works. When a user opens a website, an advertisement demand 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 advertisement server, with the highest

[]CPM targeting. In this case, that would be $1.50. At the advertisement server, in our case, Google Advertisement Supervisor, the demand is gotten and it understands that somebody is

[]paying $1.50 USD CPM for an ad. It runs another auction with Google Adsense or AdX. If Google provides 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 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 does not have any competition, it will provide the lowest CPM possible– as it wants to purchase inventory for the cheapest cost

[]possible. With header bidding, bidders have the ability to compete and press CPMs (and therefore earnings) up. There are two methods to implement header bidding

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

[]operated on the server. Let’s talk about client-side header bidding. How To Execute Client-Side Header Bidding In order to set up header bidding, we require to implement Prebid.js on our site and configure our

[]Google Advertisement Supervisor(or ad server).

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

from the customize page and download the library []developed for your specific configuration. Don’t forget to choose Permission Management modules to comply

[]with GDPR and GPP personal privacy standards. Below is the sample code drawn from the official 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 first lines load all needed JS files and our personalized Prebid.JS file.
  • Ad slots are defined in the adUnits variety variable.
  • In the adslot meanings, 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 ad request to be sent out to Google Ad Supervisor up until Prebid.js ends up the auction.
  • pbjs.requestBids operate calls SSP partners and determines the winner.
  • initAdserver() function is contacted us to send an advertisement request to the Google Ad Manager with hb_pb key, which contains the winning CPM worth, e.g. hb_pb=”1.5 ″. (This step is connected with setting up Google Ad Manager in the next action.)
  • When Google Advertisement Manager gets the request with the winning bid, it runs its own auction in Google AdX, and sends back either the AdX advertisement with a higher CPM, or the ad of the winning SSP.

[]For your specific case, you may need to code in a different way and alter the setup, but the principle stays the same.

[]Besides that, I want to rapidly go over how to execute lazy loading, due to the fact that it is a little different.

How To Carry Out Lazy Loading

[]The Google tag for publishers has a lazy loading framework which will not operate in the case of header bidding.

[]This is since you need to run an auction, and identify and set crucial worths before sending a request to the advertisement server.

[]Because of that, I would recommend utilizing the Crossway Observer API to identify when to pack the advertisement in the HTML

tag when it is about to enter into the viewport.

options = relative to record viewport rootMargin: ‘1500px’,; 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) // endd of initDynamicSlotPrebid []Now, let’s get on setting up the advertisement server using Google Ad Manager.

How To Set Up GAM For Header Bidding

[]Ad servers require to have lots of price priority line products with key hb_pb targeting all possible CPM values, such as hb_pb=0.04, hb_pb=0.03, and so on hb_pb crucial 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 crucial worth targeting hb_pb = 2.62.
  • Considering that the order has the same CPM worth, GAM comprehends 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 need to develop line items in GAM with particular granularity, state 0.01– and for the CPM range $0-$20, you would need to develop 2,000 line products, which are difficult 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 somewhat intricate job, however thanks to factors who constructed 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 set up Google Ad Manager and comprehend the following:

    Action 1: Allow API Access

    []In the Google Ad supervisor International > General settings section, make sure API gain access to is enabled.

    []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: Create A New Project

    Browse to Google API Console

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

    []a new task, enter a name for the project, and, optionally, edit the offered Project ID. Click Create.

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

    []. Click Develop to download a file consisting of a personal 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’ve developed above. Appoint the function “owner” and produce the service account OAuth2 qualifications. Then, click on the developed user and develop JSON type key, and download it. Screenshot from Google API Console Qualifications page, Deccember 2022 Action 3: Download Task Download the job 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 job. Step 4: Change your PHP.INI Modification your php.ini( located at/ xampp/php/php. ini)file and make it possible for”

    []extension=soap”by eliminating”;” in front of and set”soap.wsdl _ cache_ttl=0″ and reboot Apache from the control board of XAMPP. Step 5: Create Subfolders And Build The Project Once you have whatever set up

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

    []n’t upgraded since 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’ve unzipped the files(utilizing cd command or right-click inside the folder” Git bash here “if you have actually git set up), and run composer update in the PC terminal or git terminal. It will develop subfolders and construct the job. Action 6: Set Up Your Google Ad Supervisor Credentials 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 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 outright directory site path to the JSON essential 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(‘ HOME =’. dirname( __ DIR __ ).

    “/./” ); require __ DIR __.’/./ []./ vendor/autoload. php’; $traffickerId=(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 are in the/ script/tests/ folder). php ConnexionTest.php You must 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 selections per your needs.

    []putenv(‘ HOME= ‘. dirname (__ DIR __).”/./”); require __ DIR __.’/././ vendor/autoload. php ‘; use App Scripts HeaderBiddingScript;$bucket_range=selection(); $Your_Advertiser_Name=’Sample_Advertiser’; $buckets=[“containers”=> [[‘accuracy’=> 2,’min ‘=> 0,’max’= > 4.00,’increment’= > 0.01], [‘ accuracy ‘= > 2, ‘min’ => 4.01, ‘max’ => 8.00, ‘increment’ => 0.05],]]; foreach ($ pails [” containers”] as $k => $bucket) can be ‘low’, ‘med’, ‘high’, ‘auto’,’dense’, ‘test’ ‘currency’ => ‘USD’,

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

    []Run the command listed below and it will begin producing line items per the container settings you’ve defined.

    []php ConnexionTest.php

    []There is a tool using Python that is utilized similarly; you may wish to offer 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.

    []Additionally, open your webpage URL using “/? pbjs_debug=true” parameter at the end of the URL, and see console logs messages.

    []You require to make certain that hb_pb key 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 advertisement unit.

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

    Screenshot from Google API Console Credentials page, Deccember 2022

    Choose An Approval Management System

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

    []The in-depth guidelines on how to set up a permission management system in your wrapper are here.

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

    Conclusion

    []You might find it surprising that setting up header bidding includes a lot of actions, but it is actually worth it to implement. It can easily improve your revenue by +30% or more by producing selling pressure on Google Advertisements.

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

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

    []More resources:

    []Featured Image: Online Best SMM Panel