Search code examples
phphtmladsenseadsense-api

Include google pub on the website


I have a question, I tried to include a pub in my website. I look in console and I have no errors but the pub is not displayed. My code :

 <div class="right-bloc-pub-1">
                <script type="text/javascript" async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
                <ins class="adsbygoogle"
                     style="display:block;"
                     data-ad-client="ca-pub-1234567890234567"
                     data-ad-slot="73467345"
                     data-ad-format="auto"></ins>
                <script>
                    (adsbygoogle = window.adsbygoogle || []).push({});
                </script>
            </div>

Can you help me please? Thx in advance


Solution

  • Try putting js code to window load function

    window.onload = function () {
        (adsbygoogle = window.adsbygoogle || []).push({});
    }
    

    Also make sure:
    - You have disabled your AdBlocker, if any (disable everywhere, not only for disable on ...
    - You have set width and height for your Ad. Inspect iFrame <body> if it's empty or not.
    - If your account previous was rejected, there must pass around 24h for Google to pass content to your requests after account verification. You must receive email with title Your Google AdSense account has been fully activated.
    - Make sure your account is not banned.

    I had same issue (waited around 1 day for ads to appear on website). You can check implementation in my site http://www.justinas.tk (one white block above footer). If you view source, will see that code is identical you yours.