Hi,
Google allows to load its adsense script pagead2.googlesyndication.com/pagead/js/adsbygoogle.js only once in a page. All other adsense code uses this script to load.
In Newspaper theme, unless this script is added to every ad, the ads can not be configured.
I want to know how to enable newspaper theme to use this script only once in a page? Or how does newspaper theme detects google ads vs other ads and which file has that detection code so that I can edit it?
Note, technically it’s only loaded once, if at all, as most web browsers actually have that “cached” from visiting other sites with that .js — also the browser usually caches first instance and does not fetch the identical file multiple times unless URL is different.
If you do a page scan with something like pingdom etc. you should see from the waterfall it’s really only being fetched once, if at all depending on browser model (e.g., Chrome has it cached on Google cloud, it doesn’t reload it every time).
Not as big an issue as you might think, except perhaps in ancient browsers which should not be used by anybody like IE7/8/9 or ooooold FF stuff.
Hello,
The theme renders the ads exactly as you place them. If you place the ad 3 times on a page, then it will display 3 ads. They will not load the ad 3 times as Chris suggests, but you might want to ask google about this if you want to use the ad multiple times on the same page.
The file used to render the adsense code can be found here if you want to modify it: http://screencast.com/t/LDol5mgC7
I hope his helps.
Thank you!
@Chris S, thank you for your response, and as I understood from your reply that the adsense script is loaded only once and other instance is taken from cache, then there is no need to worry about that. I thought the script will load multiple times to slow down the website.
@Bogdan B, Thank you for your response. My query was not about how many ads I will place on website. My query was, google allows the adsense script to be placed only once in a page, so there is no need to add the script on every ad in newspaper ad management setting. But when I do not add that script, the newspaper is unable to make it responsive as per settings. Thats all.