The header bidding innovation started to develop in 2015, and has because assisted 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 a strategy where publishers offer their ad stock to lots of advertisement exchanges, also called Supply-Side Platforms (or SSPs), at the same time prior to making calls to their advertisement 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.
- Execute Prebid.JS on website.
- Configure ad server.
- Pick a consent management system.
- Test and debug.
Using To SSP Partners
There are hundreds of SSP partners available in the list to apply, however I would like to mention what I think to be the most popular ones:
- Index Exchange.
- Amazon UAM/TAM.
- Xandr (previously AppNexus).
- Magnite (formerly Rubicon).
One needs to find their online application form and go through the company’s verification procedure. For example, in the case of Xandr, the contact page appears like this:
Screenshot from Xandr, December 2022 Take notice of the minimum stock size needed to be qualified for applying. Yes, that is a shocking high of 50M advertisement impressions a month. You might need quite an impressive website to be able to apply to a few of the advertisement networks. We will call them additional bidders, as they bid on inventory in real time. Nevertheless, not all SSPs have such high thresholds for application.
For example, Sharethrough just needs 20M ad impressions. Besides, they think about likewise audience quality, traffic geolocation, how much time users invest in the website, etc. It typically takes a few weeks after applying to be authorized and onboarded
with them, so it can be a fairly lengthy 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 webpage, an ad request 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 request 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 someone 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 Advertisement Supervisor, December 2022 The trick here is that auctions happen in real-time, which produces purchasing pressure on Google AdX to pay the greatest
CPM possible. If Google AdX doesn’t have any competition, it will use the lowest CPM possible– as it wants to buy stock for the most inexpensive price
possible. With header bidding, bidders are able to contend and press CPMs (and for that reason earnings) up. There are 2 ways to carry out header bidding
worked on the server. Let’s discuss client-side header bidding. How To Implement 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 Site Prebid.js is a header bidding platform that has more than 200 demand sources integrated. You require to select the SSP partners you are working with
from the customize page and download the library developed for your specific setup. Don’t forget to select Permission Management modules to comply
with GDPR and GPP personal privacy requirements. 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]]
Basic Prebid.js Example
Let’s break down the code above.
- The very first lines fill all required JS files and our customized Prebid.JS file.
- Advertisement slots are defined in the adUnits variety variable.
- In the adslot definitions, you can see the SSP partners’ names and IDs you will be provided when onboarding when them.
- googletag.pubads(). disableInitialLoad(); is contacted us to disable advertisement demand to be sent to Google Ad Manager till Prebid.js completes the auction.
- pbjs.requestBids work calls SSP partners and figures out the winner.
- initAdserver() function is contacted us to send an ad request to the Google Advertisement Manager with hb_pb key, which consists of the winning CPM worth, e.g. hb_pb=”1.5 ″. (This action is gotten in touch with setting up Google Ad Manager in the next action.)
- When Google Advertisement Supervisor 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 ad of the winning SSP.
For your particular case, you may require to code in a different way and alter the setup, but the concept remains the very same.
Aside from that, I wish to quickly discuss how to implement 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 essential values prior to sending out a demand to the advertisement server.
Since of that, I would recommend utilizing the Intersection Observer API to determine when to fill the advertisement in the HTML
options = root: null,; your_observer = new IntersectionObserver( observer_handler, alternatives ); your_observer. observe( goog_adslots [i]; In the observer_handler recall function, you can run the prebid auction and call the advertisement server.
function observer_handler( entries, observer) dynamicAdUnit = ; pbjs.addAdUnits(dynamicAdUnit); slot = window.googletag.defineSlot(‘ function lazySlotPrebid(slot, div_id) pbjs.que.push(function() pbjs.request bids( timeout: PREBID_TIMEOUT, adUnitCodes: [div_id], bidsBackHandler: function() pbjs.setTargetingForGPTAsync( [div_id]; googletag.pubads(). revitalize(slot); ); );// endd of initDynamicSlotPrebid Now, let’s jump on establishing the advertisement server utilizing Google Ad Supervisor.
How To Set Up GAM For Header Bidding
Ad servers require to have lots of cost concern line items with key hb_pb targeting all possible CPM values, such as hb_pb=0.04, hb_pb=0.03, and so on hb_pb key worth targeting
 This is the key point that makes the header bidding engine work. The auction runs in the browser on page load.
As I mentioned above, you would require to build line products in GAM with particular granularity, say 0.01– and for the CPM range $0-$20, you would require to develop 2,000 line items, which are impossible to do by hand.
For that, you would require to use GAM API.
Sadly, there are no solid solutions that you can just download and run in one click.
It is a rather complicated job, but thanks to contributors who developed API tools (even though 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 understand the following:
Action 1: Make It Possible For API Access
In the Google Advertisement supervisor Worldwide > General settings area, make sure API access is made it possible for.
Click the Include service account button and develop 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 Task
Navigate to Google API Console
Credentials page. From the task drop-down, choose Produce
a brand-new task, get in a name for the job, and, additionally, modify the provided Project ID. Click Create.
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 containing a personal secret. Screenshot from Google API Console Qualifications page, Deccember 2022 Screenshot from Google API Console Qualifications page, Deccember 2022 Complete the service account details you have actually produced above. Appoint the role “owner” and produce the service account OAuth2 credentials. Then, click on the produced user and produce JSON type secret, and download it. Screenshot from Google API Console Credentials page, Deccember 2022 Step 3: Download Project Download the job zip file and
unzip it, directory(alternatively, you can use the git command tool to clone the repo). Set up author for your os in order to develop the job. Step 4: Change your PHP.INI Change your php.ini( located 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 restart Apache from the control board of XAMPP. Step 5: Develop Subfolders And Build The Project As soon as you have whatever established
and unzipped, open composer.json file and modification”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 job”v201911″with” v202202″, because that git job was
n’t updated considering that 2019, to utilize 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 bash here “if you have actually git set up), and run composer update in the PC terminal or git terminal. It will create subfolders and develop the task. Step 6: Establish Your Google Advertisement Supervisor Qualifications Move the downloaded JSON secret “gam-api-54545-0c04qd8fcb. json” file into the root folder of
the job you have actually built. Next, download adsapi_php. ini file and set up your Google Advertisement 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 path to the JSON crucial file in the folder root. Action 7: Set The Material Of The File Lastly, navigate to the file/ script/tests/ConnexionTest
. php and set the content of the file like listed below: putenv(‘ HOME =’. dirname( __ DIR __ ).
“/./” ); require __ 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 bash console) test the connection by running the command(if you remain in the/ script/tests/ folder). php ConnexionTest.php You must see a message”= == =Connection OK====” Action 8: Configure The Parameters Navigate to the
file/ script/tests/ConnexionTest. php in your job and open it. Copy and paste the below code into that file, and configure the criteria in the $entry and$pails varieties per your needs.
putenv(‘ HOUSE= ‘. dirname (__ DIR __).”/./”); require __ DIR __.’/././ vendor/autoload. php ‘; usage App Scripts HeaderBiddingScript;$bucket_range=array(); $Your_Advertiser_Name=’Sample_Advertiser’; $containers=[“pails”=> [[‘accuracy’=> 2,’min ‘=> 0,’max’= > 4.00,’increment’= > 0.01], [‘ precision ‘= > 2, ‘min’ => 4.01, ‘max’ => 8.00, ‘increment’ => 0.05],]]; foreach ($ containers [” buckets”] as $k => $bucket)
Optionally you can also specify ‘geoTargetingList’ => “dz, pk, ke, pt” or custom-made essential value targeting customTargeting’ => [‘ amp_pages’ => yes’] if you desire your header bidding to work just when the custom crucial value is set.
Run the command below and it will begin producing line products per the container settings you’ve defined.
There is a tool using Python that is utilized likewise; you may want to provide it a shot as well.
For debugging, there are a few web browser add-ons you can utilize to see if the auction runs without errors.
Alternatively, open your web page URL utilizing “/? pbjs_debug=real” parameter at the end of the URL, and view console logs messages.
You require to ensure that hb_pb secret values are passed to Google Ad Supervisor. Usage “/? google_console=1” at the end of the URL to open the GAM console, and click on “Delivery Diagnostics” of each advertisement system.
You must see that hb_pb worths are set and passed to the ad server.
Screenshot from Google API Console Credentials page, Deccember 2022
Pick A Permission Management System
Users’ privacy is among the most crucial factors, and you want to make certain that you comply with both GDPR and GPP.
The comprehensive directions on how to establish a permission management system in your wrapper are here.
There are lots of suppliers which comply with IAB’s most current standards, and here are a few of the most popular ones:
You may discover it unexpected that establishing header bidding includes a lot of steps, but it is actually worth it to execute. It can quickly enhance your earnings by +30% or more by producing selling pressure on Google Advertisements.
This guide is for technically smart users– but if you have concerns and problems, 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 set up header bidding and improve the monetization of your website.
Included Image: Online SMM Panel