The header bidding innovation started to establish in 2015, and has actually because helped numerous 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 innovative technique where publishers provide their advertisement inventory to numerous ad exchanges, likewise called Supply-Side Platforms (or SSPs), simultaneously before 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.
- Set up advertisement server.
- Pick a consent management system.
- Test and debug.
Applying To SSP Partners
There are numerous SSP partners readily available in the list to use, however I want 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 form and pass through the company’s verification procedure. For instance, in the case of Xandr, the contact page looks like this:
Screenshot from Xandr, December 2022 Pay attention to the minimum inventory size required to be qualified for using. Yes, that is an incredible 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 stock 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 also audience quality, traffic geolocation, how much time users spend on the site, etc. It generally takes a few weeks after using 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 webpage, an ad demand is made to all bidders(SSP partners). Bidders react with their CPM quotes– let’s state$1
and$ 1.50– and Prebid.js makes a request 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 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 offers a greater 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 develops buying pressure on Google AdX to pay the highest
CPM possible. If Google AdX doesn’t have any competitors, it will offer the most affordable CPM possible– as it wants to buy stock for the cheapest cost
possible. With header bidding, bidders have the ability to compete and push CPMs (and for that reason profits) up. There are 2 methods to implement header bidding
operated on the server. Let’s talk about client-side header bidding. How To Carry Out Client-Side Header Bidding In order to set up header bidding, we need to carry out Prebid.js on our website and configure our
Google Advertisement Supervisor(or advertisement server).
Carry out Prebid.js On Your Website Prebid.js is a header bidding platform that has more than 200 demand sources integrated. You need to select 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 Approval Management modules to comply
with GDPR and GPP personal privacy requirements. 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]]
Fundamental Prebid.js Example
Let’s break down the code above.
- The first lines load all needed JS files and our tailored 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 offered when onboarding when them.
- googletag.pubads(). disableInitialLoad(); is called to disable advertisement demand to be sent out to Google Ad Manager till Prebid.js ends up the auction.
- pbjs.requestBids operate calls SSP partners and determines the winner.
- initAdserver() function is called to send out an ad demand to the Google Advertisement Supervisor with hb_pb secret, which consists of the winning CPM worth, e.g. hb_pb=”1.5 ″. (This action is gotten in touch with setting up Google Ad Supervisor in the next action.)
- When Google Advertisement Supervisor gets the demand with the winning bid, it runs its own auction in Google AdX, and returns either the AdX ad with a higher CPM, or the advertisement of the winning SSP.
For your particular case, you might need to code differently and change the setup, however the principle remains the same.
Besides that, I want to rapidly review how to carry out lazy loading, because 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 due to the fact that you require to run an auction, and determine and set key worths prior to sending a demand to the ad server.
Due to the fact that of that, I would recommend using the Crossway Observer API to determine when to fill the advertisement in the HTML
options = relative to document viewport rootMargin: ‘1500px’,; 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 ad server.
function observer_handler( entries, observer) 1055389 function lazySlotPrebid(slot, div_id) // endd of initDynamicSlotPrebid Now, let’s jump on setting up the advertisement server using Google Ad Manager.
How To Establish GAM For Header Bidding
Advertisement servers need to have lots of price priority line items with crucial 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 pointed out above, you would need to construct line products in GAM with specific granularity, say 0.01– and for the CPM range $0-$20, you would require to develop 2,000 line items, which are difficult to do by hand.
For that, you would require to use GAM API.
Unfortunately, there are no strong services that you can merely download and run in one click.
It is a rather complex task, however thanks to factors who built 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:
Step 1: Enable API Gain Access To
In the Google Advertisement manager 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 Manager, December 2022 Action 2: Create A New Project
Navigate to Google API Console
Qualifications page. From the project drop-down, select Create
a new project, enter a name for the project, and, optionally, edit the supplied Task ID. Click Develop.
On the Credentials page, select Develop credentials, then select Service account secret.Select New service account, and choose JSON
. Click Produce 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 Fill out the service account information you have actually produced above. Assign the function “owner” and develop the service account OAuth2 qualifications. Then, click the produced user and create JSON type key, and download it. Screenshot from Google API Console Credentials page, Deccember 2022 Action 3: Download Project Download the task zip file and
unzip it, directory site(additionally, you can utilize the git command tool to clone the repo). Set up author for your os in order to construct the task. Step 4: Change your PHP.INI Change your php.ini( situated at/ xampp/php/php. ini)file and make it possible for”
extension=soap”by removing”;” 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 Task Once you have everything established
and unzipped, open composer.json file and modification”googleads/googleads-php-lib”:”^ 44.0.0 “to use the current variation” googleads/googleads-php-lib “:”^ 59.0.0″. Check for the most fresh version at the moment you perform this. Search and change in/ app / folder of the job”v201911″with” v202202″, because that git task was
n’t updated because 2019, to use the current version course of libraries. Open the command line of your PC and switch to the directory site where you have actually unzipped the files(utilizing cd command or right-click inside the folder” Git bash here “if you have git set up), and run author upgrade in the PC terminal or git terminal. It will develop subfolders and construct the task. Action 6: Set Up Your Google Advertisement Manager Credentials Move the downloaded JSON key “gam-api-54545-0c04qd8fcb. json” file into the root folder of
the project you’ve built. Next, download adsapi_php. ini file and established your Google Advertisement Supervisor 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 course to the JSON essential file in the folder root. Step 7: Set The Material Of The File Finally, navigate to the file/ script/tests/ConnexionTest
. php and set the material 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 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 remain in the/ script/tests/ folder). php ConnexionTest.php You should see a message”= == =Connection okay====” Action 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 configure the specifications in the $entry and$containers arrays per your requirements.
putenv(‘ HOME= ‘. dirname (__ DIR __).”/./”); require __ DIR __.’/././ vendor/autoload. php ‘; usage App Scripts HeaderBiddingScript;$bucket_range=selection(); $Your_Advertiser_Name=’Sample_Advertiser’; $buckets=[“pails”=> [[‘accuracy’=> 2,’min ‘=> 0,’max’= > 4.00,’increment’= > 0.01], [‘ precision ‘= > 2, ‘min’ => 4.01, ‘max’ => 8.00, ‘increment’ => 0.05],]]; foreach ($ pails [” pails”] as $k => $bucket) echo $order_name.”
Additionally you can likewise specify ‘geoTargetingList’ => “dz, pk, ke, pt” or customized key value targeting customTargeting’ => [‘ amp_pages’ => yes’] if you want your header bidding to work just when the customized key value is set.
Run the command below and it will begin developing line items per the container settings you have actually specified.
There is a tool utilizing Python that is utilized likewise; you may wish to provide it a try as well.
For debugging, there are a couple of internet browser add-ons you can utilize to see if the auction runs without errors.
Additionally, open your web page URL using “/? pbjs_debug=real” parameter at the end of the URL, and view console logs messages.
You need to make sure that hb_pb key values are passed to Google Ad Manager. Use “/? google_console=1” at the end of the URL to open the GAM console, and click on “Shipment Diagnostics” of each advertisement unit.
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’ personal privacy is among the most important elements, and you wish to make certain that you adhere to both GDPR and GPP.
The detailed directions on how to establish a consent management system in your wrapper are here.
There are lots of providers which abide by IAB’s most current requirements, and here are a few of the most popular ones:
You may find it unexpected that setting up header bidding involves many steps, but it is truly worth it to implement. It can easily improve your income by +30% or more by creating selling pressure on Google Ads.
This guide is for technically smart users– but if you have concerns and problems, there is an Adops slack channel you may register for and ask questions 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: Online SMM Panel