This post was most recently updated on July 11th, 2019
PubGuru Header Bidding exposes interfaces publicly to adops and the publisher’s dev team for debugging and per-pageview customizations.
To use any of the following API tools on page, make sure you include the following code first. Then include the settings you want. Then embed your header bidding config file.
This only needs to be included once, above the rest of our code.
The GET parameter m2debug=true is the most frequently used debugging tool. This flag will dump a significant amount of debugging information into the javascript console, and shortly after the page and ads have loaded, will execute the MonetizeMore configuration test and display the testing results in the footer of the page.
For debugging purposes, the GET parameter disabledUnits can be used to disable units for the immediate pageview. To disable more than one unit at a time, comma separate the values. Each ad unit name is the full DFP ad unit code (e.g. /1234567/DfpAdUnitCode). Here’s an example:
http://www.pubsite.com/page/id/article.html?disabledUnits=/1234567/DfpAdUnitCode1,/1234567/DfpAdUnitCode2
Publishers can also disable units in javascript on page. Publishers using PubGuru Header Bidding offpage should find the <script> tag that loads your PubGuru Header Bidding (m2hb) config file, and before that script tag, include the following code (change the ad units to your ad unit names that you want to exclude):
Publishers using PubGuru Header Bidding onpage should include this between when window.m2hb is instantiated and when m2hb.loadJS() loads your config file.
Some publishers have very complicated pages that can load a variable number of ad units, but the publisher doesn’t know how many or what units will be loaded until runtime. This is most common where the publisher has some short articles and some long articles, and a page can have dynamically between 3 and 8 ad units based on the content length. In this case, the HB config includes all units. Then the publisher should include the following code before the m2hb.m2.ai script:
In this case, only these two units will load regardless of what else is in the configuration.
For debugging purposes, the GET parameter disabledBidders can be used to disable units for the immediate pageview. To disable more than one bidder at a time, comma separate the values. Here’s an example:
http://www.pubsite.com/page/id/article.html?disabledBidders=sovrn,pulsepoint
Publishers can also disable bidders in javascript on page. Publishers using PubGuru Header Bidding offpage should find the script tag that loads your PubGuru Header Bidding (m2hb) config file, and before that script tag, include the following code (change the bidders that you want to exclude):
Publishers using PubGuru Header Bidding onpage should include this between when window.m2hb is instantiated and when m2hb.loadJS() loads your config file.
If you specify bidders to be disabled in the URL for diagnostic purposes, it will override anything set on the page.
Publishers using PubGuru Header Bidding offpage should find the script tag that loads your PubGuru Header Bidding (m2hb) config file, and before that script tag, include the following code example:
Publishers using PubGuru Header Bidding onpage should find the first line in their onpage code, and add the second line after it. The publisher can pass any value they want, including articleID.
Some publishers have extensively complicated ad unit names for reporting that gets around KVP limitations. If you’d like to script your ad unit names, use the following code:
When the unit is configured for HB, all instances of “{section}” in our unit names will be dynamically changed to “culture”, allowing the same HB PIDs to be used for multiple units.
Since early versions of PubGuru Header Bidding, we’ve supported chainloading configs. This is so we can load an entirely different config in a prod environment without relying on the publisher changing the code. To do this, add the m2hb= GET parameter. For security reasons, the chainloaded target MUST be on the MonetizeMore cloudfront CDN.
Chainloading will also intelligently import ad units and ad bidders, enabling chain loading to be used by both dev and ops. If chain loaded config does not have these configured, the chain loaded config will inherit them from the parent config.
Here’s an example: http://www.pubsite.com/page/id/article.html?m2hb=m2hb.pubsite-otherconfig.min.js
David Loschiavo is the Chief Product Officer of MonetizeMore. He believes artificial intelligence & machine learning, coupled with technology available to everyone, will change the world for the better and forever.
10X your ad revenue with our award-winning solutions.