May 19, 2014

Textual description of firstImageUrl

How To Make Google Adsense Codes In Asynchronous Versions

|
If you have been trying to improve your loading speed with the help of Google PageSpeed Insights and you come across this problem as shown below:

 When you click on "Show how to fix" it will show you where are the problems. If you are using Adsense on your site, you may see this problem as shown below:

To fix this problem you have to switch your Adsense code to asynchronous JavaScript tags.

This is how you do it:

Step One:

1. Go your WordPress Dashboard.

2. Click Appearance and select Editor.

3. Under Templates on the right side of the page, click on  Header (header.php).

4. Now paste the code below before </head> tag.

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

5. Click Updater File button.

Step Two:

1. Look for ad code in your template and take note of its ID.

The ad ID is the number next to "google_ad_slot".

2. Now go to your Adsense account.

3. At the Dashboard, click "My Ads" tab where you can see your list of ads.

4. Look for the specific ad unit (the one with the same ID) and click "Get Code".

5. A box will appear. At Code type, click on the the small reverse triangle sign to drop down a menu.

6. Select Asynchronous (BETA).

7. The asynchronous ad code will appear below.

8. Before you paste this new code onto your template, remember to remove the FIRST line of this code. <script async src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

We have already pasted it in the header in Step One.

9. Now paste the rest of the code over your old code. In other words, you need to delete your old Adsense code and paste this new code over it.

10. Do the same for the rest of Adsense ad units where you have placed them on your site.

*Beware: When you are replacing the rest of the ad units, remove the first line: <script async src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>