Making Dev Life Easier with requestMode and requestTiming

Here are a couple of nuggets for the developers out there keeping Adnuntius rolling on thousand of websites throughout the world.

requestMode

Try out our new requestMode: 'hasTarget' option. This option checks if the target HTML element is on the page before requesting an ad from Adnuntius Advertising. That also means you can use the same code throughout your site with as many ad units as you want and it will only send an ad request when it can find the target HTML elements on the page.

So, if this is the ad request code:

adn.request({ requestMode: 'hasTarget', adUnits: [{ auId: '123' }, { auId: '456' }] });

And if in your page only <div id="adn-123"></div> is present, then no ad request will be made for auId: '456'.

This greatly simplifies the scripting requirements on your site, especially within a CMS. Just one piece of ad request code can be used and then what ad requests are made can be decided by the target elements on the page.

requestTiming

By default, as soon as you call adn.request(), we make the request to Adnuntius Advertising for an ad.

Now, though, you can set requestTiming to onRequest or onLoad, and the adn.request() call will only execute when either:

  • the document is ready (the HTML is loaded and parsed); or
  • the document has loaded (the HTML is loaded, parsed and all its related files have been loaded – images, stylesheets, scripts, IFrames…)

Here’s what it looks like in code:

adn.request({ requestTiming: 'onReady', adUnits: [{ auId: '123' }, { auId: '456' }] });

A handy little thing to enable easier scripting throughout your website.