Is it good idea to load adsbygoogle.js (Google AdSense Code) in Header?


#1

When placing ads on our Blog, we have to place this code //pagead2.googlesyndication.com/pagead/js/adsbygoogle.js multiple times. so it is good to place this code in header once? so that we don’t have to use that code multiple time. Will it help in our Page Speed Goal?


#2

Well, there is no need to include that script everytime.

Just use it once in the header.


#3

Just remove it from the ad code.


#4

Add that code in your Footer only one time for all ads.


#5

Add it into the header is okay?


#6

You are delaying your page load.


#7

But it’s worth for the AdSense revenue. Because if you include in the footer, you will see less revenue to slow loading of AdSense. Visitor can wait few ms, advt can load async way. So, there is no slow load time.


#8

But I have never faced this brother.


#9

May be… but loading before </head> seems ideal way.


#10

@GulshanKumar , Sir you’re 100 % Right
If the code can used in footer, then Google obviously tell us to do that or it can a option in adsense home page.
Buy Google says to paste the code in between <head> here </head>
So as Google’s guidelines you should follow it.
:slight_smile:


#11

Loading in head direct browser to give top most priority compared to having in the footer. Script are executed early, thanks to asynchronous method it’s non-render blocking. So, we shouldn’t hesitate keeping in the header. While in footer it may cause delay in showing Advt.


#12

Thank You Guys. I have been using the code in header.