Google AdSense Legacy Old Generation Code Reference (Generate and Get)

Google AdSense has implemented new Google AdSense ad code with the new AdSense As Management feature. With the new style of ad code and Manage Ads tab, the configuration settings for an AdSense ad unit such as ad size, colors, and channel settings are stored on Google servers, so that in future, any changes to Google AdSense units can be made from within the account instead of having to modify the ad code.

With the new Google AdSense Ad Management system, the new generation ad code is considerably shorten and simplified. Gone are the google_ad_format, google_ad_type, google_ad_channel, google_color_border and etc, and been replaced with google_ad_slot, which points to corresponding ad unit as saved in publisher’s account.

However, the new Google AdSense ad code is not necessary suit all. It’s very hard to implement for blogs or websites that adopt the revenue sharing business model, where Google AdSense ad code of different writers and authors are used in rotation. It’s even harder if custom channel ID number is used to track the performance of the ad unit in AdSense revenue sharing program.

The legacy old classic Google AdSense ad code no longer able to be generated from Google AdSense Setup page. However, the legacy code is still been supported, and continue to can be used in web pages. For webmasters who still want to use the legacy AdSense ad unit code, use the following guide to generate the ad code manually.

Format of Legacy Old Google AdSense Ad Code

Both text ads, image ads, video ads, and link units use the similar ad code format as below:

<script type=”text/javascript”><!–
google_ad_client = “pub-XXXXXXXXXXXXXXXX”;
google_ad_width = 300;
google_ad_height = 250;
google_ad_format = “300×250_as”;
google_ad_type = “text_image”;
google_alternate_ad_url = “http://www.mydigitallife.info/”
//2007-07-25: My Digital Life
google_ad_channel = “XXXXXXXXXX”;
google_color_border = “FFFFFF”;
google_color_bg = “FFFFFF”;
google_color_link = “0000FF”;
google_color_text = “000000″;
google_color_url = “005577″;
//–>
</script>
<script type=”text/javascript”
src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”>
</script>

Available Customization Options Using JavaScript Variables

The ad code above should be customized and changed by using different value for JavaScript variables to reflect the AdSense ad unit prefer, here’s the brief description of each variables in the ad code.

google_ad_client – The publisher ID that is required and must be correct to get paid and earn revenue from Google AdSense program when eligible clicks or page views occurred.. The publisher ID can be retrieved from Google AdSense account.

google_ad_width, google_ad_height, google_ad_format – Define the size and format of AdSense ad unit to display. All there values should be matching each other, i.e. the first number before ‘x’in google_ad_format is also google_ad_wide, and the second number after ‘x’ before ‘_’ is the google_ad_height. google_ad_height and google_ad_width have no effect on the actual ad size as they only control the object box within which the ad unit is contained. The parameters are used normally to maintain a consistent layout presentation when the page layout provides an area that is wider than the ad unit itself. Google provides 24 different ad formats (12 ad units and 12 link units) for web page placement.

Normal Ad Unit:
728×90_as (Leaderboard)
468×60_as (Banner)
234×60_as (Half Banner)
125×125_as (Button)
120×600_as (Skyscraper)
160×600_as (Wide Skyscraper)
180×150_as (Small Rectangle)
120×240_as (Vertical Banner)
200×200_as (Small Square)
250×250_as (Square)
300×250_as (Rectangle)
336×280_as (Large Rectangle)

Link Unit:
120×90_0ads_al (4 links)
120×90_0ads_al_s (5 links)
160×90_0ads_al (4 links)
160×90_0ads_al_s (5 links)
180×90_0ads_al (4 links)
180×90_0ads_al_s (5 links)
200×90_0ads_al (4 links)
200×90_0ads_al_s (5 links)
468×15_0ads_al (4 links)
468×15_0ads_al_s (5 links)
728×15_0ads_al (4 links)
728×15_0ads_al_s (5 links)

google_ad_type – Definite if only text ads, images ads or both type of ads is allowed. Note that for Flash based ads and video ads to appear, image ads must be enabled. Available options are:

text – for AdSense text ads only
image – for image ads only, including video ads and Flash ads.
text_image – for text and image ads

google_alternate_ad_url – Display another ads or web pages when Google AdSense program does not have a relevant advertisement for the ad slot. By default, a public service ad is display. Specifying the alternate ad URL will display the content specified in the URL. Note that the alternative ad code should be specified in HTML file, and should not has size that bigger than the Google ad unit, or else the alternative ad will be cut off or trimmed off. It’s also possible to put in an alternate URL which will collapse the ad space (no space been used for the ad).

google_ad_channel – To specify a custom channel (a 10 digits number) to track ad performance and statistics. Channel ID must be created at AdSense account before they can be used.

google_color_border, google_color_bg, google_color_link, google_color_text, google_color_url – Determines the color of the ad border, ad background, ad title of each ad, ad text inside the ad block, and URL at bottom of each ad. Up to 4 separate values (differentiated by commas) can be supplied for automatic color rotation when the ad is served by the Google server. The image ads does not affect by these values. Note that the color value should be converted in hexadecimal format.


2 Responses to “Google AdSense Legacy Old Generation Code Reference (Generate and Get)”

  1. JamesVG
    July 22nd, 2009 22:00
    2

    Thanks. Very helpful to a script I was writing to dynamically generate adsense script.

  2. How to Hide and Collapse Google AdSense Ad Unit Instead of Showing Public Service Ad (PSA) » My Digital Life
    January 19th, 2009 01:50
    1

    [...] publisher using classic legacy Google AdSense ad code, add a new JavaScript variable named google_alternate_ad_url to the Google AdSense ad unit ad code [...]

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. To receive notification of latest comments posted, subscribe to My Digital Life Comments RSS feed or register to receive new comments in daily email digest.
Custom Search

New Articles

Incoming Search Terms for the Article

adsense link unit code - old google adsense code - adsense link units code - old google adsense - google text ads code - adsense ad variables - adsense text link code - hide and collapse banner ads - google adsense variables - how are ads in adsense generated - how to get google adsense - how to format ad code - Wide Skyscraper google code - collapsing ad units, google ad manager - how google generates ad script - old generation in life - adsense title color code - get the script for my images adds - google ad slot only show image - google_ad_format reference - google adsense size reference - google ads half banner gets cut off - how to get adsense image ads in adsense format - rotating google adsense colors in old adsense code - adsense legacy code - adsense old code - legacy adsense - script generate adsense url - google adsense reference - legacy protexislicensing - adsense old script - five link units google adsense script - google adsense script - google admanager scripts at bottom - google adsense automatic color - old google ad formats - add alternate url to old google code - adsense ad diplay cut off - control unit in adsense - legacy adsense code - code to generate reference id using jsp - genarete 25 digital code - old adsense code link unit - google adsense reference programe - matching text image adsense formats - customize google link unit ad code colors - google_ad_type flash - google_alternate_ad_url varibles adsense - old google title images - google legacy ad codes -