The header bidding technology began to establish in 2015, and has actually since assisted lots of 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 advanced method where publishers offer their ad inventory to lots of advertisement exchanges, likewise called Supply-Side Platforms (or SSPs), at the same time 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.
- Configure ad server.
- Pick a consent management system.
- Test and debug.
Using To SSP Partners
There are numerous SSP partners offered in the list to apply, however I wish to mention what I think to be the most popular ones:
- Index Exchange.
- Amazon UAM/TAM.
- Xandr (previously AppNexus).
- Magnite (previously Rubicon).
One needs to discover their online application 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 Focus on the minimum stock size needed to be qualified for applying. Yes, that is a staggering high of 50M advertisement impressions a month. You may need quite an excellent site to be able to apply to some of the ad networks. We will call them additional bidders, as they bid on stock in real time. Nevertheless, not all SSPs have such high limits for application.
For example, Sharethrough only needs 20M advertisement impressions. Besides, they think about likewise audience quality, traffic geolocation, how much time users spend on the website, etc. It generally takes a couple of weeks after applying to be authorized and onboarded
with them, so it can be a relatively lengthy 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 demand is made to all bidders(SSP partners). Bidders react with their CPM bids– let’s state$1
and$ 1.50– and Prebid.js makes a demand to the ad 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 understands that somebody is
paying $1.50 USD CPM for an advertisement. It runs another auction with Google Adsense or AdX. If Google provides a higher 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 Manager, December 2022 The technique here is that auctions happen in real-time, which creates purchasing pressure on Google AdX to pay the greatest
CPM possible. If Google AdX doesn’t have any competitors, it will use the most affordable CPM possible– as it wants to purchase stock for the most inexpensive cost
possible. With header bidding, bidders are able to contend and press CPMs (and for that reason income) up. There are two ways to execute 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 need to execute Prebid.js on our site and configure our
Google Ad Manager(or ad server).
Execute Prebid.js On Your Website Prebid.js is a header bidding platform that has more than 200 demand sources integrated. You require to pick the SSP partners you are dealing with
from the customize page and download the library built for your specific configuration. Do not forget to choose Approval Management modules to comply
with GDPR and GPP personal privacy standards. Below is the sample code drawn from the official documentation. 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 first lines pack all required JS files and our tailored Prebid.JS file.
- Ad slots are defined in the adUnits variety variable.
- In the adslot definitions, you can see the SSP partners’ names and IDs you will be offered when onboarding when them.
- googletag.pubads(). disableInitialLoad(); is called to disable advertisement request to be sent to Google Ad Manager until Prebid.js finishes the auction.
- pbjs.requestBids function calls SSP partners and determines the winner.
- initAdserver() function is contacted us to send an ad request to the Google Advertisement Supervisor with hb_pb key, which contains the winning CPM value, e.g. hb_pb=”1.5 ″. (This action is gotten in touch with establishing Google Ad Supervisor in the next step.)
- When Google Ad Supervisor gets the request with the winning quote, it runs its own auction in Google AdX, and returns either the AdX advertisement with a higher CPM, or the advertisement of the winning SSP.
For your particular case, you might require to code differently and alter the setup, but the principle stays the exact same.
Other than that, I want to quickly discuss how to execute lazy loading, because it is a little various.
How To Implement Lazy Loading
The Google tag for publishers has a lazy loading structure which will not operate in the case of header bidding.
This is due to the fact that you require to run an auction, and identify and set crucial values prior to sending a demand to the advertisement server.
Since of that, I would encourage using the Intersection Observer API to figure out when to load the advertisement in the HTML
alternatives = relative to record viewport rootMargin: ‘1500px’,; your_observer = 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 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 establishing the ad server using Google Ad Manager.
How To Set Up GAM For Header Bidding
Advertisement servers need to have dozens of rate concern line products with essential hb_pb targeting all possible CPM worths, such as hb_pb=0.04, hb_pb=0.03, and so on hb_pb essential 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 discussed above, you would need to construct line items in GAM with particular granularity, say 0.01– and for the CPM range $0-$20, you would need to create 2,000 line items, which are impossible to do by hand.
For that, you would require to utilize GAM API.
Sadly, there are no strong solutions that you can just download and run in one click.
It is a somewhat complex task, but thanks to contributors who built 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 Advertisement Supervisor and understand the following:
Step 1: Make It Possible For API Gain Access To
In the Google Ad manager Global > General settings section, make sure API gain access to is enabled.
Click on 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
Navigate to Google API Console
Credentials page. From the job drop-down, choose Produce
a new task, go into a name for the job, and, optionally, edit the supplied Project ID. Click Develop.
On the Credentials page, choose Produce credentials, then select Service account key.Select New service account, and choose JSON
. Click Create to download a file consisting of a personal key. Screenshot from Google API Console Credentials page, Deccember 2022 Screenshot from Google API Console Qualifications page, Deccember 2022 Complete the service account information you’ve created above. Designate the role “owner” and create the service account OAuth2 credentials. Then, click the created user and produce JSON type key, and download it. Screenshot from Google API Console Qualifications page, Deccember 2022 Step 3: Download Job Download the job zip file and
unzip it, directory site(alternatively, you can utilize the git command tool to clone the repo). Set up composer for your os in order to construct the project. 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 eliminating”;” in front of and set”soap.wsdl _ cache_ttl=0″ and restart Apache from the control panel of XAMPP. Step 5: Produce Subfolders And Build The Project When you have whatever established
and unzipped, open composer.json file and change”googleads/googleads-php-lib”:”^ 44.0.0 “to utilize the most recent version” 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″, because that git task was
n’t upgraded considering that 2019, to utilize the latest version course of libraries. Open the command line of your PC and switch to the directory 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 produce subfolders and construct the job. Step 6: Establish Your Google Advertisement Manager Qualifications Move the downloaded JSON secret “gam-api-54545-0c04qd8fcb. json” file into the root folder of
the job you’ve constructed. 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 course to the JSON essential 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 material of the file like 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 need to see a message”= == =Connection okay====” Action 8: Configure The Parameters Browse 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 parameters in the $entry and$buckets ranges per your needs.
putenv(‘ HOME= ‘. dirname (__ DIR __).”/./”); need __ DIR __.’/././ vendor/autoload. php ‘; usage App Scripts HeaderBiddingScript;$bucket_range=array(); $Your_Advertiser_Name=’Sample_Advertiser’; $buckets=[“pails”=> [[‘precision’=> 2,’minutes ‘=> 0,’max’= > 4.00,’increment’= > 0.01], [‘ accuracy ‘= > 2, ‘min’ => 4.01, ‘max’ => 8.00, ‘increment’ => 0.05],]]; foreach ($ buckets [” buckets”] as $k => $bucket) echo $order_name.”
Additionally you can likewise define ‘geoTargetingList’ => “dz, pk, ke, pt” or custom-made key worth targeting customTargeting’ => [‘ amp_pages’ => yes’] if you desire your header bidding to work only when the custom-made essential value is set.
Run the command listed below and it will start creating line products per the pail settings you have actually specified.
There is a tool using Python that is utilized similarly; you may want to give it a try too.
For debugging, there are a couple of browser add-ons you can use to see if the auction runs without mistakes.
Additionally, open your website URL using “/? pbjs_debug=real” criterion at the end of the URL, and view console logs messages.
You need to make certain that hb_pb secret worths are passed to Google Advertisement Supervisor. Usage “/? google_console=1” at the end of the URL to open the GAM console, and click “Shipment Diagnostics” of each ad system.
You ought to see that hb_pb worths are set and passed to the ad server.
Screenshot from Google API Console Credentials page, Deccember 2022
Pick A Consent Management System
Users’ privacy is one of the most crucial aspects, and you wish to make sure that you adhere to both GDPR and GPP.
The comprehensive instructions on how to set up a permission management system in your wrapper are here.
There are numerous service providers which adhere to IAB’s newest requirements, and here are a few of the most popular ones:
You may discover it unexpected that establishing header bidding involves many actions, but it is actually worth it to implement. It can easily boost your revenue by +30% or more by developing selling pressure on Google Advertisements.
This guide is for technically savvy users– but if you have questions and issues, there is an Adops slack channel you may subscribe to and ask questions to the neighborhood.
I hope that after reading this article, you will find it much easier to establish header bidding and boost the monetization of your site.
Included Image: Online Best SMM Panel