Switch To Adsense Asynchronous Ad Code For Faster Page Loading

Google recently introduced an asynchronous version of their Adsense ad Javascript code. If you serve Adsense ads on your blog and wish to improve your blog loading speed, then it is a good idea to switch to the asynchronous JavaScript tags.

Asynchronous Javascripts improve web latency and offer better users experience because they load in parallel and do not block other parts of your web page from loading. This means that users will be able to load the content of your pages, even if they are having trouble loading the ads.

Google Adsense

Here's how to implement the asynchronous ad code in Blogger:

Part 1: Add the new Adsense script

First you need to add the asynchronous script near the top of your template.

Go to Template > Edit HTML and add this script before </head> tag:

<script async='async' src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

You only need to add this once, even if you have multiple ads.

Part 2: Replace your old ad codes 

Now replace your existing individual ad codes with the their asynchronous counterparts.

  1. Locate your ad code in your template and note its ID. The ad ID is the number next to "google_ad_slot".
  2. On your Google AdSense dashboard, click "My Ads" tab to view your ads list.
  3. Locate the corresponding ad unit (based on the ID) and click "Get Code". adsense ad list
  4. Then click the Code type dropdown menu and select "Asynchronous (BETA)". adsense switch to asynchronous

    Your asynchronous code will look like this:

    <script async src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <ins class="adsbygoogle" 
      (adsbygoogle = window.adsbygoogle || []).push({});
  5. Copy the asynchronous code and paste it over your existing ad code.
  6. Remove the first line as it is already added in Part 1.
  7. Repeat steps above for each ad unit.


23 comments to "Switch To Adsense Asynchronous Ad Code For Faster Page Loading"

Arham Sukardi July 19, 2013 at 4:31 AM    

Wow this make our blog fast when loading adsense, thanks

Greenlava July 19, 2013 at 2:36 PM    

@kelvin mitnick
yyyyyyyyyy is the ad ID number.

Muhammad Irfan July 19, 2013 at 3:00 PM    

Yes this is a great feature of Google adsense. Thanks for sharing brother with us.
dear one more question
I applied for Google adsense and approve in first review. but after four day my application disapprove in 2nd review Because of does not comply with Google webmaster policy.
dear i receive 2000 visitor/ day 90 % from Google Search engine. and on friday receive 5000 – 6000 visitor. dear please help me i am so worry please check my site and suggest me so that my application could approve. thanks in advance.
I applied for adsense on 12 july. please also suggest me now when i apply for adsense?
my site: w3mix.com

Unknown July 19, 2013 at 3:19 PM    

Google constantly trying to improve user experiences. And this is another step of that journey. Thanks google. And thanks to writer of this post for letting us know this news.

Muhammad Irshad July 21, 2013 at 6:24 PM    

This is a great feature added by adsense coz everyone wants their website to load faster.

Anonymous,  July 21, 2013 at 6:27 PM    

thanks for this wonderful post. Every blogger wants that their website load faster

andrea July 21, 2013 at 8:17 PM    

Google also now giving us 2500 rs worth adwords coupon for free to all it is a nice chance to promote our website in google .

corduroy blazer for men July 22, 2013 at 12:36 PM    

Thanks for the notification. i am glad to know that Google introduced such great thing to load website content faster.

Rahul July 23, 2013 at 7:06 PM    

Great article. Now i can make my blog load faster. Thanks for the worthy post.

Anonymous,  July 24, 2013 at 12:34 AM    

check out this awseom tech blog www.mytechguides.wordpress.com

john July 24, 2013 at 2:20 AM    

I will try the tips from you on my website .. if there is trouble I will ask you. thank you for sharing knowledge

xinhua fang July 24, 2013 at 12:49 PM    

Cool Ideas to generate few more posts on my own blog.
Thanks to help me get up and write some great content.

gachema July 25, 2013 at 1:47 PM    

According to google, the advantage of the asynchronous code is that it's guaranteed never to get in the way of other parts of your web page loading. This means that users will be able to load the content of your pages, even if they’re having trouble loading the ads. - See more at: http://techbloggs.blogspot.com/2013/07/AsynchronousAdSenseCode.html

Unknown July 25, 2013 at 3:47 PM    

Nothing's ever easy when it comes to Google Blogs!

Friendship day 2013 July 26, 2013 at 3:06 AM    

ok, let me try it..

Unknown July 29, 2013 at 11:33 PM    

It's really a nice feature of Google adsense. Thanks for this tutorial about how to use. Thanks again.

Kevin Peter July 30, 2013 at 2:27 AM    

Thanks for telling about this feature

health blog July 31, 2013 at 8:21 PM    

great.. hope it could help us to earn more

Make Money Online August 2, 2013 at 4:08 PM    

Great Post! Thanks

Blogging tips August 6, 2013 at 11:11 AM    

it all makes sense, blogs that are already suffering from slow page load times will have a breathe of sigh now..

Mas Dillah August 7, 2013 at 10:53 PM    

I dont have google adsense account yet..

how to get an adsense account?
Im dont really understand...

Knowledge Is Power December 4, 2013 at 9:38 PM    

Will this work on a regular website as well?

Greenlava December 5, 2013 at 12:13 AM    

@Knowledge Is Power
Yes it will work on regular website.

Post a Comment

We love to hear from you! Leave us a comment.

To ensure proper display, HTML/XML/Javascript need to be escaped first using this escape tool.