Forum Moderators: martinibuster

Message Too Old, No Replies

New Adsense code(?)

         

JorgeV

11:44 am on Apr 28, 2021 (gmt 0)

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



Hello,

May be this is something old, but I just noticed that, the code provided by Adsense is slightly different, from what it used to be:

Instead of :
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

it's now
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-xxx" crossorigin="anonymous"></script>


The crossorigin parameter is to deal with Cross-Origin Resource Sharing mechanism.

Also, now, the publisher id is directly added as a parameter to the "adsbygoogle.js". I wonder which kind of impact this has, since the "old" code continues to works. I wonder if it's safer, faster (may be one less round-trip, etc...)

SweetPotato

7:54 am on Apr 29, 2021 (gmt 0)

5+ Year Member Top Contributors Of The Month



Interesting.
I wonder what difference does it make in practice.

Swanny007

12:19 am on May 1, 2021 (gmt 0)

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



I hadn't noticed this. I wonder if I should update my existing ad code? Hmm...

JorgeV

10:37 am on May 1, 2021 (gmt 0)

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



Hello,

I've implemented the change, I see no negative impact (hopefully!), my coverage and active view viewable increased by 10% , but it might be pure coincidence.

JorgeV

3:20 pm on May 2, 2021 (gmt 0)

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



Addendum : I am sure this is a placebo effect, but I have the impression that Ads are "less slow".

ronron

9:22 pm on May 2, 2021 (gmt 0)

5+ Year Member Top Contributors Of The Month



@JorgeV "view viewable increased by 10%" - good enough reason for me to try at least. TY

CommandDork

12:37 pm on May 3, 2021 (gmt 0)

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



I've implemented the new code on one site - so far nothing positive/negative to report after 36 hours. It's probably the new generation of ad code you'll see on all new ad blocks created - something, something to help Google do something.

NickMNS

1:04 pm on May 3, 2021 (gmt 0)

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



The one obvious change is the addition of a "crossorigin" attribute, this is no doubt related to CORS headers. I'm not sure how it is used or even if it is used at this point but it is important in terms of security. Here as article explaining CORS.
[developer.mozilla.org...]

my coverage and active view viewable increased by 10%

I doubt that the AVV would be impacted, but the code could change coverage, as some browser may block the Adsense script due to CORS restrictions (I'm just speculating)

Swanny007

1:27 am on May 4, 2021 (gmt 0)

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



I emailed AdSense about whether I should update my existing ad code and this was their reply:

Thank you for reaching out. Your existing ad code will continue to work. If there is ever required that you update your AdSense code blocks, you will be given a proactive heads up. That said, you are welcome to copy and paste the latest ad code from your account at any time. I hope this helps. Please let me know if you have any questions.

NickMNS

1:40 am on May 4, 2021 (gmt 0)

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



I just checked my Adsense account to see what code was returned for my existing ad-units and it shows this new code. So it looks like you can update it without impact you the data of existing ad-units. I will probably up to date mine when I have some free time, but I wont be stressing over this.

No5needinput

5:13 pm on May 4, 2021 (gmt 0)

10+ Year Member Top Contributors Of The Month



My new code doesn't have the crossorigin addition:

<script data-ad-client="ca-pub-XXXXXXXXXXXXXXXX" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

Niresh12495

3:51 pm on May 5, 2021 (gmt 0)

10+ Year Member Top Contributors Of The Month



Google reverted the new adcode, Something wrong with it.
I reverted back to old code.

dolcevita

4:11 pm on May 5, 2021 (gmt 0)

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



It is not reverted. At least i see still code below

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=xxxxxxxxxxx"
crossorigin="anonymous">

ronron

4:39 pm on May 5, 2021 (gmt 0)

5+ Year Member Top Contributors Of The Month



I'm seeing the same as Niresh and have my code reverted as well. (<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>)

I've decided to revert back to the old code. On long pages where I had an ad tag repeating many times, I was getting almost double the impressions with lower viewability numbers. I'm guessing the new code wasn't lazy loading as it was with the original tags (did not find out for sure using dev tools).

londrum

6:15 pm on May 5, 2021 (gmt 0)

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



mine has reverted back to the old code as well, but I think I'm going to leave the new one on for a while.
the impressions are up but that's probably just because of bank holiday weekend. active viewable is the same, but page rpm is up so earnings are up

dolcevita

3:59 pm on May 6, 2021 (gmt 0)

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



Today is mine also reverted to the old code.

engine

10:55 am on Jul 21, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



For completeness, Google announced the new code [support.google.com...]

scottb

12:03 pm on Jul 22, 2021 (gmt 0)

10+ Year Member Top Contributors Of The Month



The js loads quite a bit faster, according to multiple waterfall tests of sites with and without the new code. That's the only difference I have seen so far. No apparent impact on revenue.

Maybe that's what Google means when it says the code will "improve the performance" of ads.

SweetPotato

11:20 pm on Jul 22, 2021 (gmt 0)

5+ Year Member Top Contributors Of The Month



It's really weird that it would load faster and not reflect on impressions, clicks and earnings.

scottb

2:12 pm on Jul 23, 2021 (gmt 0)

10+ Year Member Top Contributors Of The Month



"It's really weird that it would load faster and not reflect on impressions, clicks and earnings."

Adsbygoogle.js is a single file among many that make up the display of ads. The client ad files are numerous and usually much bigger. They aren't impacted. So the total display may be only be a few percentage points faster, which makes it difficult to prove any impact on earnings. Just a guess.