Notification

Please make sure to visit Your AdSense Page where you can find personalized information about your account to help you succeed with AdSense.

Improving ad performance with the new AdSense code

July 19, 2021

We recently launched a new version of the AdSense code. The new AdSense code allows AdSense to trigger optimization features earlier which can improve the performance of the ads on your site. The new ad code works for both Auto ads and ad units.

Do I need to do anything?

You don't need to take any action. You'll have access to the new ad code the next time you sign in to AdSense and get code from your account.

Do I have to replace my old ad code with the new ad code?

There's no requirement to replace the existing ad code on your site. However, you're welcome to update your ad code if you want to take advantage of the new optimization features.

Tips: If you do choose to update your ad code, make sure that:

  • You update all the ad code on your site. For the most optimal results, we recommend you avoid having a mix of old and new ad code on the same page.
  • Your publisher ID is correct in all new ad code.

What does the new ad code look like?

Auto ads code example:

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

Ad unit code example:

<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ignored1234567890123456" crossorigin="anonymous"></script>
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ignored1234567890123456"
     data-ad-slot="5678"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>

Was this helpful?

How can we improve it?
true
Unlock Growth Potential

Don't miss out on valuable AdSense insights. Opt in to receive performance reports, personalized tips, and webinar invites that can help boost your earnings

Opt in

Search
Clear search
Close search
Google apps
Main menu
5918772012643699275
true
Search Help Center
true
true
true
true
true
157
false
false