The header bidding technology began to develop in 2015, and has actually considering that helped numerous publishers to grow their profits by as much as 40% (and even, in many cases, to levels of 100% or more.)
What Is Header Bidding?
Header bidding is a cutting-edge method where publishers provide their advertisement inventory to lots of advertisement exchanges, also called Supply-Side Platforms (or SSPs), simultaneously 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 site.
- Configure advertisement server.
- Pick an authorization management system.
- Test and debug.
Applying To SSP Partners
There are numerous SSP partners readily available in the list to apply, but I want to mention what I believe to be the most popular ones:
- Index Exchange.
- Amazon UAM/TAM.
- Xandr (formerly AppNexus).
- Magnite (previously Rubicon).
One requires to find their online application form and pass through the company’s verification process. For instance, in the case of Xandr, the contact page looks like this:
Screenshot from Xandr, December 2022 Take note of the minimum inventory size required to be eligible for applying. Yes, that is an incredible high of 50M advertisement impressions a month. You may require rather a remarkable website to be able to apply to some of the ad networks. We will call them more bidders, as they bid on inventory in genuine time. However, not all SSPs have such high thresholds for application.
For example, Sharethrough just requires 20M advertisement impressions. Besides, they consider likewise audience quality, traffic geolocation, just how much time users invest in the site, and so on. It usually takes a few weeks after using to be authorized and onboarded
with them, so it can be a fairly 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 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 highest
CPM targeting. In this case, that would be $1.50. At the ad server, in our case, Google Ad Supervisor, the request is received 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 offers a greater CPM, then the Google Advertisement will be served. If not, our ad with $1.50 CPM will win, and be served
by our SSP partner. Screenshot from Google Advertisement Manager, December 2022 The trick here is that auctions happen in real-time, which produces buying pressure on Google AdX to pay the highest
CPM possible. If Google AdX does not have any competitors, it will provide the most affordable CPM possible– as it wishes to buy stock for the most affordable rate
possible. With header bidding, bidders have the ability to contend and press CPMs (and therefore income) up. There are 2 methods to carry out header bidding
worked on the server. Let’s go over client-side header bidding. How To Carry Out Client-Side Header Bidding In order to establish header bidding, we require to execute Prebid.js on our site 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 pick the SSP partners you are working with
from the customize page and download the library developed for your particular configuration. Don’t forget to choose Permission Management modules to comply
with GDPR and GPP personal privacy requirements. Below is the sample code taken from the official documents. var div_1_sizes=[ [300, 250]
, [300, 600]]; var div_2_sizes= [[
728, 90], [970, 250]]
Standard Prebid.js Example
Let’s break down the code above.
- The very first lines pack all needed JS files and our personalized Prebid.JS file.
- Ad slots are defined in the adUnits array variable.
- In the adslot meanings, 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 request to be sent out to Google Advertisement Manager till Prebid.js completes the auction.
- pbjs.requestBids work calls SSP partners and determines the winner.
- initAdserver() function is contacted us to send an advertisement demand to the Google Advertisement Supervisor with hb_pb key, which contains the winning CPM value, e.g. hb_pb=”1.5 ″. (This step is connected with establishing Google Advertisement Supervisor in the next step.)
- When Google Ad Manager gets the request with the winning quote, it runs its own auction in Google AdX, and returns either the AdX ad with a greater CPM, or the ad of the winning SSP.
For your specific case, you may need to code in a different way and change the setup, but the principle stays the exact same.
Aside from that, I want to quickly review how to implement lazy loading, because it is a little 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 due to the fact that you require to run an auction, and figure out and set essential worths before sending a request to the advertisement server.
Because of that, I would advise using the Intersection Observer API to identify when to load the advertisement in the HTML
options = visible amount of product shown in relation to root; your_observer = brand-new IntersectionObserver( observer_handler, choices ); your_observer. observe( goog_adslots [i]; In the observer_handler call back function, you can run the prebid auction and call the advertisement server.
function observer_handler( entries, observer) dynamicAdUnit = [code: ‘your_html_div_id’, mediaTypes: , bids: [, bidder: “familiar”, params: ]]; pbjs.addAdUnits(dynamicAdUnit); slot = window.googletag.defineSlot(‘ function lazySlotPrebid(slot, div_id) // endd of initDynamicSlotPrebid Now, let’s get on establishing the ad server utilizing Google Advertisement Supervisor.
How To Establish GAM For Header Bidding
Ad servers need to have lots of price 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 essential value targeting
 This is the key point that makes the header bidding engine work. The auction runs in the internet browser on page load.
As I pointed out above, you would require to build line products in GAM with specific granularity, state 0.01– and for the CPM range $0-$20, you would require to produce 2,000 line items, which are difficult to do by hand.
For that, you would require to use GAM API.
Regrettably, there are no strong options that you can merely download and run in one click.
It is a rather intricate task, but thanks to factors 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 establish Google Advertisement Supervisor and understand the following:
Action 1: Enable API Access
In the Google Advertisement manager Global > General settings area, make sure API gain access to is made it possible for.
Click the Add service account button and produce a user with the sample name “GAM API USER” and email “[email protected]” with admin rights.
Screenshot from Google Advertisement Manager, December 2022 Step 2: Develop A New Task
Browse to Google API Console
Credentials page. From the job drop-down, select Create
a new project, go into a name for the task, and, additionally, edit the provided Project ID. Click Create.
On the Credentials page, choose Produce credentials, then choose Service account key.Select New service account, and choose JSON
. Click Develop to download a file containing a personal secret. Screenshot from Google API Console Qualifications page, Deccember 2022 Screenshot from Google API Console Credentials page, Deccember 2022 Complete the service account information you’ve created above. Designate the function “owner” and create the service account OAuth2 credentials. Then, click the developed user and produce JSON type secret, and download it. Screenshot from Google API Console Qualifications page, Deccember 2022 Step 3: Download Job Download the project zip file and
unzip it, directory site(additionally, you can utilize the git command tool to clone the repo). Set up composer for your os in order to develop the task. Step 4: Modification your PHP.INI Modification your php.ini( situated at/ xampp/php/php. ini)file and allow”
extension=soap”by eliminating”;” in front of and set”soap.wsdl _ cache_ttl=0″ and reboot Apache from the control panel of XAMPP. Step 5: Develop Subfolders And Build The Job As soon as you have everything established
and unzipped, open composer.json file and modification”googleads/googleads-php-lib”:”^ 44.0.0 “to use the latest variation” googleads/googleads-php-lib “:”^ 59.0.0″. Check for the most fresh version at the minute you perform this. Search and change in/ app / folder of the task”v201911″with” v202202″, since that git project was
n’t upgraded considering that 2019, to utilize the current version 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 installed), and run author update in the PC terminal or git terminal. It will create subfolders and develop the job. Action 6: Establish Your Google Ad Supervisor Credentials Move the downloaded JSON key “gam-api-54545-0c04qd8fcb. json” file into the root folder of
the task you’ve developed. 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 path to the JSON essential 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(‘ 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 need to see a message”= == =Connection OK====” Step 8: Set Up 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 parameters in the $entry and$containers selections per your requirements.
putenv(‘ HOUSE= ‘. dirname (__ DIR __).”/./”); require __ DIR __.’/././ vendor/autoload. php ‘; usage App Scripts HeaderBiddingScript;$bucket_range=variety(); $Your_Advertiser_Name=’Sample_Advertiser’; $buckets=[“pails”=> [[‘accuracy’=> 2,’min ‘=> 0,’max’= > 4.00,’increment’= > 0.01], [‘ precision ‘= > 2, ‘minutes’ => 4.01, ‘max’ => 8.00, ‘increment’ => 0.05],]]; foreach ($ containers [” buckets”] as $k => $bucket) prebid advertiserName ‘orderName’ => $order_name]; $script = brand-new HeaderBiddingScript(); $script-> createGlobalAdUnits($entry);
Additionally you can likewise specify ‘geoTargetingList’ => “dz, pk, ke, pt” or custom key value targeting customTargeting’ => [‘ amp_pages’ => yes’] if you desire your header bidding to work only when the customized essential worth is set.
Run the command listed below and it will start producing line products per the pail settings you have actually specified.
There is a tool utilizing Python that is used similarly; you might want to offer it a try also.
For debugging, there are a few web browser add-ons you can utilize to see if the auction runs without errors.
Additionally, open your webpage URL utilizing “/? pbjs_debug=real” criterion at the end of the URL, and enjoy console logs messages.
You require to ensure that hb_pb key worths are passed to Google Advertisement Manager. Use “/? google_console=1” at the end of the URL to open the GAM console, and click “Shipment Diagnostics” of each ad system.
You should see that hb_pb worths are set and passed to the advertisement server.
Screenshot from Google API Console Credentials page, Deccember 2022
Choose A Permission Management System
Users’ privacy is one of the most important elements, and you wish to make certain that you abide by both GDPR and GPP.
The detailed guidelines on how to set up an approval management system in your wrapper are here.
There are numerous suppliers which abide by IAB’s latest requirements, and here are a few of the most popular ones:
You might discover it surprising that setting up header bidding involves a lot of actions, however it is actually worth it to execute. It can quickly enhance your income by +30% or more by creating selling pressure on Google Ads.
This guide is for technically smart users– however if you have concerns and issues, there is an Adops slack channel you may sign up for and ask concerns to the neighborhood.
I hope that after reading this article, you will discover it much easier to establish header bidding and enhance the monetization of your site.
Featured Image: Best SMM Panel