I am in the process of setting up google adsense and google asked me to copy and paste the code below right after the <head> tag on the main page.
Where do I paste this code on the newsmag theme?
<script async src=”//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({
enable_page_level_ads: true
});
</script>
Thanks,
Craig
You can simply use the Google adsense boxes under “ads” in the theme panel.
See the theme docs (link right side of page here), for using “ads” with theme.
Super simple 🙂
Or, if you’re trying to do that site wide, I think there is a header code box under “custom code” in theme panel.
Or, you could manually add to the header.php file, but will need to redo on any theme update.
Hello Aerocrewnews,
For more references in this regard, please check this screenshot here -> http://screencast.com/t/rYpk2JVJnVl
Thanks for the message!
Thanks,
I ended up getting the ‘Header and Footer’ plugin and placed it on the main page after <head>.
Chris -I pasted it there originally, but my site is still under review from Google… Hopefully the ‘Header and Footer’ plugin fixes that.
Catalin -I have my google analytics code in the section you referred to. Should I place it there along with that code or is the ‘Header and footer’ plugin sufficient?
Thanks,
ACN
PS… Can you erase the code in my original post? Thanks!
Hello Aerocrewnews,
Unfortunately, our theme has not been tested with Header and footer plugin and we have no idea about the theme behaviour with this type of plugin and also, we cannot say for sure if it will work or not with our theme, sorry! Regarding on Google Analytics, please keep it mind that it is sufficient to place the code in the correct area from Theme panel -> Analytics or you simply paste the code inside of the head file.
Thanks for your understanding!
None of what you are referring to makes any sense with what Google is asking me to do.
This is where google wants to see this code:
https://support.google.com/adsense/answer/7107718?visit_id=undefined&hl=en&rd=1
Under the Analytics screen shot you sent over the ? says this code will go in the <body>. The google instructions clearly want this code in the <head> section. The header and footer plugin does put it in the <head> area but it is in the middle. Not exactly where Google said. They did deny me after a week of “in review.” I’m guessing it’s because of where this code was.
I did try just putting it in an ADS box in the Theme area, but that didn’t seem to work either. From what I understand this is not an actual Google Ad it is just code so they can verify my site.
I have looked at the CUSTOM area under the THEME panel but I don’t think this is where this code goes either.
Thanks for your help.
ACN
-
This reply was modified 9 years by
Aerocrewnews. Reason: Updating
Hello,
Please try to add your Js code in header.php in the head section, like this -> http://screencast.com/t/fQ4A6qzWy
Thanks for the message!
