Site logo

[Support request] how to add auto ads from adsense in theme

Home Forums Support [Support request] how to add auto ads from adsense in theme

Home Forums Support how to add auto ads from adsense in theme

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #506952
    jaya swaroop

    i like to add auto ads from adsense to our theme
    please help me to resolve

    #507119
    Leo
    Staff
    Customer Support
    #507482
    jaya swaroop

    nothing was changed in my website
    resolve my problem

    #507502
    Leo
    Staff
    Customer Support

    Where and what was the code you’ve added?

    #507575
    jaya swaroop

    <script async src=”//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script>
    <script>
    (adsbygoogle = window.adsbygoogle || []).push({
    google_ad_client: “ca-pub-xxxxxxxxxxxx”,
    enable_page_level_ads: true
    });
    </script>

    i added the code in wp_head

    #507846
    jaya swaroop

    Hello leo
    generatepress theme will support autoads or not

    #508054
    Leo
    Staff
    Customer Support

    I believe Google asks that part of the code to be in the <head> section correct?

    If so wp_head hook is what you are looking for:
    https://docs.generatepress.com/article/wp-head/
    https://docs.generatepress.com/article/hooks-overview/

    #508548
    jaya swaroop

    hello leo i added in the same part wp_head no improvements

    #508693
    Lyle

    jaya –

    Where are you wanting the ads to appear?

    For example, if you want them to appear in a sidebar, then add an HTML widget to the sidebar location and paste the AdSense code into it and Save.

    Or, if you want to have the ad appear at the top of the page, add the code to the Before Header GP Hook location.

    You can also get fancy and use PHP to conditionally display the ads in the various GP Hooks locations. On one of my sites, I have it set to display the ad only on single posts and below the content.

    This is what I do on all of my sites that have Google AdSense ads 🙂

    Cheers!
    Lyle

    #598342
    Karine

    Lyle, thanks a lot for the tips! I have already ads running on my blog, by this moment there are maximum 2 appearing per page https://www.karikfood.com
    and I tried your first suggestion in order to add extra ads (this time Auto Ads), adding HTML widget on sidebar area, but it seems it doesnt work. Did I make something wrong? Maybe it is not compatible with already existing ads or plugin (WP QUADS – Quick AdSense).

    #598505
    Leo
    Staff
    Customer Support

    You got a few console errors coming from the ads which I believe is causing them not showing:
    http://www.screencast.com/t/8W7MnOni3

    Might be worth checking with the source of wherever you got the code/ads.

    #598556
    Karine

    Leo, thanks for your swift reply. Don´t understand well what exactly I have to do. Will I quit that HTML widget area with the code within put in the sidebar?

    #598612
    Leo
    Staff
    Customer Support
    #649663
    Darren

    Have these methods changed, in the age of Elements if you will?
    That is, having installed Elements, how might I add adsense auto ads?
    The Code Snippets plugin seemed to crash my site.
    Thanks

    #649966
    Leo
    Staff
    Customer Support

    You can use the wp_head hook in Hooks Element:
    https://docs.generatepress.com/article/hooks-element-overview/

    If you need more help on this, please open a new topic 🙂

    Thanks!

Viewing 15 posts - 1 through 15 (of 15 total)
  • The topic ‘how to add auto ads from adsense in theme’ is closed to new replies.