[Support request] Paste HTML code

Home Forums Support [Support request] Paste HTML code

Home Forums Support Paste HTML code

  • This topic has 13 replies, 3 voices, and was last updated 2 years ago by Fernando.
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #2187389
    Luke

    Hi

    Today I received a notification from Google Adsense to “Copy and paste this code in the HTML of your site, between the <head> and </head> tags.”

    Can you tell me how I can quickly do it? Where do I find these tags?

    #2187394
    David
    Staff
    Customer Support

    Hi there,

    1. in Appearance > GeneratePress enable the Elements module.

    2. Now create a new Hook element in Appearance > Elements -> Add New >> Hook

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

    2.1 in the Hook Element text area add your Google Adsense script.

    2.2 Select the Hook: wp_head

    2.3 Set the Display Rules > Locations to Entire Site or just the places you want the code to fire.

    #2187422
    Luke

    Thanks for the answer. I’ve already done it. I’d like to send a screenshot but I don’t know how to do it.

    #2187434
    David
    Staff
    Customer Support

    Save your screenshot on a share drive and send us the link to it. Or upload it to your WP Media Library and share the URL.

    #2187437
    Luke

    Screenshot below.

    #2187481
    David
    Staff
    Customer Support

    Thats correct, and if thats the site you added it to – i checked its source code and i can see the script.

    #2187492
    Luke

    OK, great. Thank you! I understand that when I set Locations to Entire Site it means that the code will be active on each page of the site?

    #2187498
    David
    Staff
    Customer Support

    Thats correct.

    If you don’t want the entire site then you can add individual locations or you can use exclusions for example:

    Location: Entire Site
    Exclude: Page > A Page
    Exclude: Page > Another page
    #2189325
    Luke

    I resubmitted my site to Google Adsense and today they sent me the same reply which says:
    We couldn’t find the code on your site. This is because the code is either missing or incomplete, or because the URL of your site is incorrect. Learn more.

    Copy and paste this code in the HTML of your site, between the <head> and </head> tags.
    Your AdSense code:

    Can you check once again if I did it correctly because it looks like something is still wrong according to Google Adsense.

    #2189348
    Fernando
    Customer Support

    Hi Luke,

    I can see this script added inside the <head> of your site: https://share.getcloudapp.com/04uE6dXk

    You could try double checking if the script really is being added through the hook element be adding another element below the script.

    For instance, try adding <style class=“check-if-script-is-added”></style> and/or a comment tag like <!-- my google script --> before your script.

    Kindly let us know once you’ve added this and we’ll take a look once more.

    #2189351
    Luke

    OK, I added the extra lines of code from your message. You may check now if it’s there.

    #2189360
    Fernando
    Customer Support

    Thank you for adding it. I can’t see it.

    To confirm, is this the correct site to look at?: https://meditationbrainwaves.com/

    Can you try clearing all caching mechanisms set in your website?

    Hope to hear from you soon. 🙂

    #2189365
    Luke

    I cleared cache. Check screenshot showing the line of code which I added.

    #2189374
    Fernando
    Customer Support

    Thank you for clearing your cache.

    Upon checking, I can confirm that it has indeed been added, and the Hook Element is indeed hooking its content to the <head>: https://share.getcloudapp.com/xQuqRQgO

    You can further test this by setting a different priority in your hook. The two should still be found together.

    With that said, perhaps you could reach out to Google Adsense support and see why the script isn’t working?

    Moreover, I also found this which might also be helpful: https://support.google.com/adsense/thread/76254958/we-couldn%E2%80%99t-find-the-code-on-your-site?hl=en

    Hope this clarifies. 🙂

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