Please note that we provide the code snippets and content on this page are without any guarantee. In most cases, these pages are created on requests or based on individual solutions sent to us by other users. After it was published, we are only reviewing the code and content when we are made aware of an issue. Please let us know if you find one.

Please only use the codes if you understand them and know how to add custom code to your WordPress site.

The following JavaScript code allows you to do something as soon as Advanced Ads Pro finished loading ads.

if ( typeof advanced_ads_pro === 'object' ) {
  advanced_ads_pro.observers.add(function(event) {
      // Note: These events may be triggered multiple times
      // because not all ads are injected at the same time.   
      // The injection may be delayed by the lazy load feature or the group refresh feature.
      if (event.event === 'inject_passive_ads') {
        console.log(event);
      }
      if (event.event === 'inject_ajax_ads') {
        console.log(event);
      }
      if (event.event === 'inject_placement') {
        console.log(event);
      }
    } );
}