Welcome to WebmasterWorld Guest from 35.172.195.49

Forum Moderators: martinibuster

Message Too Old, No Replies

This adsense code modification allowed or not?

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

Senior Member

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

joined:Dec 19, 2004
posts:993
votes: 14


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!
12:04 am on July 13, 2018 (gmt 0)

Senior Member

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

joined:Dec 19, 2004
posts:993
votes: 14


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

[gist.github.com...]
1:17 am on July 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member Top Contributors Of The Month

joined:Apr 1, 2016
posts:2738
votes: 837


It is allowed.
3:00 am on July 13, 2018 (gmt 0)

Senior Member

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

joined:Dec 19, 2004
posts:993
votes: 14


Wow surprising because I thought google requires entire ad code to be added in one piece and that the code canít be split
7:42 am on July 13, 2018 (gmt 0)

Senior Member

WebmasterWorld Senior Member Top Contributors Of The Month

joined:Nov 13, 2016
posts:1194
votes: 288


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]

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

Senior Member

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

joined:Dec 12, 2004
posts:662
votes: 15


[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."
9:15 am on July 13, 2018 (gmt 0)

Junior Member

Top Contributors Of The Month

joined:June 14, 2018
posts: 42
votes: 18


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