Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
AuctionLot = {
  adUnit: string,
  placement: string,
  gpIdUniquifier: string,
  lazyLoad?: boolean,
  contentVideoUrl?: string,
  sizes?: Array<Array<integer> | string>,
  adUnitPath?: string
};

...

The function getAvailableAdUnitNames can be used in the browser console to get the existing ad units under AdEngine.

AuctionLot.gpIdUniquifier

The gpIdUniquifier allows you to pass a specific string to help SSPs better identify ad units when multiple instances of the same unit are called on the same page. It should always match the div ID of the first instance of the unit, which is typically the default ID generated by the AdEngine-app.

Code Block
AuctionLot = {
  adUnit: "adUnit1Name",
  placement: "adUnit1DivName",
  gpIdUniquifier: "adUnit1DivName of the first instance of the adUnit"
};
AuctionLot.lazyLoad

AdEngine also allows to lazy load ads that are not initially visible in the publisher's page. This can lead to better page performance, by loading the ads only when they get into view, but please take into consideration that it may also impact earnings if the page rarely gets scrolled to the lazy loaded ad position.
To enable lazy loading for a particular lot, the lazyLoad field needs to be added to the AuctionLot structure as follows:

...

Code Block
window.addEventListener('adnginLoaderReady', function() {
  adngin.queue.push(function() {
    // trigger a new auction
    adngin.cmd.startAuction([
      {
        adUnit: "adUnit1",
        placement: "otherdiv1",
        gpIdUniquifier: "otherdiv1"
      },
      {
        adUnit: "adUnit1",
        placement: "otherdiv2",
        gpIdUniquifier: "otherdiv1"
      }
    ]);
  });
});

Using GAM path per page with custom sizes

...

Code Block
window.addEventListener('adnginLoaderReady', function() {
  adngin.queue.push(function() {
    // trigger a new auction
    adngin.cmd.startAuction([
      {
        adUnit: "adUnit1",
        placement: "otherdiv1",
        gpIdUniquifier: "otherdiv1",
        sizes: [[300, 250]],
        adUnitPath: "pageGAMAdUnitPathName"
      },
      {
        adUnit: "adUnit1",
        placement: "otherdiv2",
        gpIdUniquifier: "otherdiv1",
        sizes: [[300, 600]],
        adUnitPath: "pageGAMAdUnitPathName"
      }
    ]);
  });
});

...