[Support request] How do I add Google Adsense code?

Home Forums Support How do I add Google Adsense code?

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1410781
    Theodore

    Please, I want to add the google adsense code between the <head> and </head> tags of my site, but i can’t figure out how to do that.

    I was supposed to use the “Insert Headers & Footers” plugin, but I’ve already used that to add the Google Analytics code.

    Please, how else can I add adsense code?

    Thanks.

    #1410897
    David
    Staff
    Customer Support

    Hi there,

    you can use the Hook Element:

    https://docs.generatepress.com/article/hooks-element-overview/

    Common Hooks for adding code

    Inside <head>: wp_header
    After opening body tag: wp_body_open
    In the site footer: wp_footer

    #1632248
    Raul

    And do we have to check “execute PHP”?

    #1632255
    Elvin
    Staff
    Customer Support

    Hi Raul,

    And do we have to check “execute PHP”?

    No, you don’t have to as Google Adsense scripts are JavaScript.

    A wise man once said:
    "Have you cleared your cache?"

    #1632316
    Raul

    Thank you.

    #1633534
    Elvin
    Staff
    Customer Support

    No problem. 🙂

    A wise man once said:
    "Have you cleared your cache?"

    #1677169
    Danny

    Created a hook for Adsense as shown in the video: wp_head, priority:1

    Google Adsense can’t find it (although I can find it in the source code). Is there any common error / recommended troubleshooting?

    Thanks for your help!

    #1677219
    David
    Staff
    Customer Support

    Hi there,

    can you raise a new topic where you can share a link to your site so we can see if there are any obvious issues.

    #1677247
    Danny

    Sure. Done. Thanks.

    Title: “Google can’t find Adsense code”

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.