Options
All
  • Public
  • Public/Protected
  • All
Menu

NitroPay Ads

NitroPay Ads

Installing

Please refer to the setup guide for details on how to include the ad script on your site.

Creating Ad Placements

Call window.nitroAds.createAd to create an ad placement.

First Party Data

You can optionally supply first party user data for improved ad match rates.

Call window.nitroAds.addUserToken before createAd to pass user data.

Script global settings

Global settings may be controlled via the <script> tag's data attributes.

Demo

The when the data-demo attribute is set to true, all placements will load placeholder graphics instead of ads. This setting should only be used for testing.

Log level

You can override the default log level of info to show more or less information in the console using the data-log-level attribute. This setting only affects the NitroPay ads script, and not any output from other scripts.

Log levels are:

  • silent
  • error
  • warn
  • info
  • debug

The debug level should not be used in production.

Events

Custom events are emitted on Document with detailed information related to ad serving.

nitroAds.loaded

Emits LoadedEvent when the ad script finishes loading.

nitroAds.createAd

Emits CreateAdEvent when createAd is called, after parsing options.

nitroAds.prepare

Emits PrepareEvent when an element is being prepared for ad targeting.

nitroAds.bidReceived

Emits BidReceivedEvent for each bid received.

nitroAds.rendered

Emits RenderedEvent when an ad is rendered.

nitroAds.anchorVisibility

Emits AnchorVisibilityEvent when an anchor ad is shown or hidden.

nitroAds.complete

Emits VideoCompleteEvent when a video ad finishes playing.

Generated using TypeDoc