Home | Blog | ( 4 ) | Subscribe

Disclosure: This post may contain affiliate links which may earn us a commission when you click on them.

Posted by on Monday August 29, 2011 at 13:28:37:

As a Google adsense publisher, perhaps one of the things you might have always wanted is to increase the income you are currently making from the program and so I have found out that one way you can easily do that is to reduce the time it takes to load a Google ad. One way you can do this is by making use of an external javascript file containing your Google adsense code for the format. Note, you are not placing the entire code in the file but only the one that contains the size and format of the ad. So you will have to create two script tags with one pointing to the format javascript file in your web host and the second one pointing to Google adsense server as it should for proper serving and recording. So, assuming you were able to get this code from your adsense account for a 728by90

(script type="text/javascript")
google_ad_client = "pub-id";
/* 728x90, created 03/09/12 */
google_ad_slot = "33333";
google_ad_width = 728;
google_ad_height = 90;
//--> (/script)
(script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js") (/script)
You can then rewrite the script like this:
(script type="text/javascript" src="http://www.yoursite.com/728by90.js">
(/script)
(script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js")
(/script)
And also remember to create a javascript file called 728by90.js and paste a pure js code into it:
google_ad_client = "pub-id";
/* 728x90, created 03/09/12 */
google_ad_slot = "33333";
google_ad_width = 728;
google_ad_height = 90;
//-->
Although Google ads are relatively faster than other ad networks but this can make it much faster and ultimately increase the experience of your visitors even when there is a slower internet connection. When such visitors revisit your site, it will be much faster and lighter since most of the remote javascript files have been cached by their browser.
Comments:
Re: Google Adsense: How to make ads load faster on your site Posted by roberth on Thursday October 13, 2011 at 17:56:39:

Hi, nice and interesting article but are you sure that it is ok with Google adsense policies?



Re: Google Adsense: How to make ads load faster on your site Posted by Felix Okoli on Thursday October 13, 2011 at 17:56:39:

Of course it is accepted as long as you are not altering the code. It works in the same way as if the ads were just pasted on your site. You are only putting the format of the ad in a javascript file on your site. This will make it load faster especially for returning visitors who have already cached your site. As long as the second part of the code is still located on Google's server, I don't think you are breaking any rules. You can as well ask Google support or even google for "Adsense in external js file" and see what a lot of webmasters are saying about it





Post a Comment

Required fields are Name and Comment.


Name:

Email: (Optional)

Comment: