- This topic has 13 replies, 3 voices, and was last updated 2 years ago by Fernando.
-
AuthorPosts
-
April 13, 2022 at 5:45 am #2187389Luke
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?
April 13, 2022 at 5:52 am #2187394DavidStaffCustomer SupportHi 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.April 13, 2022 at 6:20 am #2187422LukeThanks for the answer. I’ve already done it. I’d like to send a screenshot but I don’t know how to do it.
April 13, 2022 at 6:32 am #2187434DavidStaffCustomer SupportSave 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.
April 13, 2022 at 6:37 am #2187437LukeScreenshot below.
April 13, 2022 at 7:09 am #2187481DavidStaffCustomer SupportThats correct, and if thats the site you added it to – i checked its source code and i can see the script.
April 13, 2022 at 7:18 am #2187492LukeOK, 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?
April 13, 2022 at 7:20 am #2187498DavidStaffCustomer SupportThats 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
April 14, 2022 at 9:37 pm #2189325LukeI 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.
April 14, 2022 at 10:41 pm #2189348Fernando Customer SupportHi Luke,
I can see this script added inside the
<head>
of your site: https://share.getcloudapp.com/04uE6dXkYou 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.
April 14, 2022 at 10:49 pm #2189351LukeOK, I added the extra lines of code from your message. You may check now if it’s there.
April 14, 2022 at 10:57 pm #2189360Fernando Customer SupportThank 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. 🙂
April 14, 2022 at 11:10 pm #2189365LukeI cleared cache. Check screenshot showing the line of code which I added.
April 14, 2022 at 11:28 pm #2189374Fernando Customer SupportThank 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/xQuqRQgOYou 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. 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.