Forum Moderators: martinibuster

Message Too Old, No Replies

This adsense code modification allowed or not?

         

born2run

10:25 pm on Jul 12, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi so my developer has implemented adsense code a couple of days ago.

The file pagead2.googlesyndication.com/pagead/js/adsbygoogle.js is being loaded separately via jquery to reduce number of requests by multiple ad code instances in the main page.

I myself think this is not allowed by Google, but wanted to ask folks here to confirm. Is such mod to the code allowed? Thanks!

born2run

12:04 am on Jul 13, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The developer is using this github page code as a template:

[gist.github.com...]

NickMNS

1:17 am on Jul 13, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It is allowed.

born2run

3:00 am on Jul 13, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Wow surprising because I thought google requires entire ad code to be added in one piece and that the code can’t be split

Dimitri

7:42 am on Jul 13, 2018 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



The file pagead2.googlesyndication.com/pagead/js/adsbygoogle.js is being loaded separately via jquery to reduce number of requests by multiple ad code instances in the main page.

No matter how many times the file adsbygoogle.js is added to a page, the web browser will load it only once. And if this file is already in the browser 's cache (because of a visit to your site, or someone else site), it will not be loaded either.

[edited by: Dimitri at 8:26 am (utc) on Jul 13, 2018]

levo

8:12 am on Jul 13, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



[support.google.com...]

"If I have multiple ad units on a page, do I have to include <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> for each ad unit?

No, this is not necessary, adsbygoogle.js can be loaded once."

bugthinker

9:15 am on Jul 13, 2018 (gmt 0)

5+ Year Member Top Contributors Of The Month



I understand that for the ad units, but how would it work if ad units + auto ads?