• How it works
  • Partners
  • Blog
  • Docs
  • Sign up
  • Client Area

Ad Publishers

  • Getting started with Ads – Common Issues & FAQs
  • Payment & Fee FAQs
  • Setting up your ads.txt file
  • Installing the ad script on your page
  • Creating an ad placement
  • US Privacy law compliance steps
  • Ad script lifecycle events
  • Detecting ad-blocking users
  • Special ad format: Sticky Stack
  • Placement Configuration API

CMP

  • Adding custom consents or disclosures
  • Creating a link for the user to manage their consents

Sponsor

  • Getting started with Sponsor

Users

  • Getting started with Users
  • Adding the Users SDK to your site
  • Initializing the Users SDK
  • Launching the login/registration screen
  • Managing user sessions
  • Users SDK API Reference
  • NitroPay
  • Docs
  • Ad Publishers
  • Ad script lifecycle events

Ad script lifecycle events

When the ad script finishes loading, window.nitroAds.loaded will be set to true. If the script is loaded asynchronous, this variable may not be available immediately.

A custom event, nitroAds.loaded, is also fired on the document when loading is completed.

if (window.nitroAds && window.nitroAds.loaded) {
  // nitroAds was already loaded
} else {
  // wait for loaded event
  document.addEventListener("nitroAds.loaded", event => {
    // nitroAds just loaded
  });
}
Share this document:
  • Facebook
  • Twitter
  • LinkedIn
Updated on January 25, 2023
US Privacy law compliance stepsDetecting ad-blocking users
© GG Software, LP
Privacy Policy | Terms of Use | Contact us