NitroAds

Nitro Ads

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

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

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

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

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

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.

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.

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

Emits LoadedEvent when the ad script finishes loading.

Emits CreateAdEvent when createAd is called, after parsing options.

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

Emits BidReceivedEvent for each bid received.

Emits RenderedEvent when an ad is rendered.

Emits AnchorVisibilityEvent when an anchor ad is shown or hidden.

Emits VideoCompleteEvent when a video ad finishes playing.