admob free interstitial ad only shows me test and not real ads, by integrating the script in apppresser

214 Views Asked by At

(function() {
  ready("#showAdDiaria", function(element) {

    var el = document.getElementById("showAdDiaria");
    var adunit;
    var userAgent = navigator.userAgent;

    if (/(android)/i.test(userAgent)) {
        // put android ad unit ID here
        adunit = 'ca-app-pub-xxx/xxxx'
    }

    if (/(iPad|iPhone|iPod)/.test(userAgent) ) {
        // put iOS ad unit id here
        adunit = 'ca-app-pub-xx/xx'
    }
    if (AdMob) {
      AdMob.prepareInterstitial({
        adId: adunit,
        isTesting: false,
        autoShow: false
      });
    }

    el.addEventListener("click", function() {
        console.log('clicked show ad', AdMob);
      // show the interstitial later, e.g. at end of game level
      if (AdMob) AdMob.showInterstitial();
    });

  });

})();

when I enter the script I get the error that the Admob variable is not defined

0

There are 0 best solutions below