Monetization Framework

Batch Requests

If you have multiple ad zones on the same page, you can reduce network calls by batching the requests together using initBatch instead of init.

Converting your ad call from a single call to a batch call

This is relatively straight-forward. Let's say you have both the Sticky Box and Flex Bar unit on the same page. Currently, your code might looks like this:

Example of making several ad requests for multiple zones

<script>
(function() {
  if (typeof _bsa !== 'undefined' && _bsa) {
    _bsa.init('stickybox', 'CVADC53U', 'placement:yoursitedomain');
    _bsa.init('flexbar', 'CVADC53U', 'placement:yoursitedomain');
  }
})();
</script>

The code above creates two requests to the ad server. To batch this into a single request to the ad server, you simply change init to initBatch and call loadBatch to send the request:

Example of combining multiple ad requests into one

<script>
(function() {
  if (typeof _bsa !== 'undefined' && _bsa) {
    _bsa.initBatch('stickybox', 'CVADC53U', 'placement:yoursitedomain');
    _bsa.initBatch('flexbar', 'CVADC53U', 'placement:yoursitedomain');
    _bsa.loadBatch();
  }
})();

</script>

This will also work for custom templates.