Editing Adsense Ads

Adsense ads are delivered via JavaScript code. Whilst you cannot edit the JavaScript code in any malicious ways you can edit the properties of the ad. What do we mean by properties? Well, just like any other thing a property is a defining characteristic such as a colour or size. If we take a look at the Adsense JavaScript we can see there are several properties which relate directly to how the ad is displayed.

Remember, that whilst you can change the property 'values' you should never add or remove any properties without the risk of the ads not displaying correctly. This tutorial is designed to help you work with Adsense code without the need to log into your account every time you want to make changes or experiment a little.

Lets take a very quick tour of JavaScript properties and how we can change them. First of all lets look at a dummy Adsense example:

In this example there is a property for the 'google_color_link' which has been set to 669900. We can determine the name of the property because it sits to the left of the = sign. The value of the property always rests to the right of the = sign. So what does this value represent. Well the 'google_color_link' is the colour of the main headline link that you see at the top of the displayed ad. The actual value for this colour is not a name, instead it's what programmers refer to as a HEX number. You might be wondering how you are ever going to find the HEX value for a colour, but don't worry because some nice people on the web have done the hard work for you. We recommend you take a look at this site which has a huge list of common web colours and their HEX values:

500 Named Colours

Remember when using the HEX values from this site you do not need the # sign before the number. Just copy the number.

As you can see its possible to alter colours quite easily, but when chaning sizes or formats remember to choose sizes and formats that actually exists. If you try to make up any size it won't work, it must be an accepted size or format that Google offer. If you want to see accepted sizes and formats, try this page (UK):

Google Ad Formats

Property map - Adsense for Content

Tips and Tricks

1. When changing values make sure you keep the quote marks around the value e.g. "798645". If you don't, then the ad will not display correctly if at all.

2. Once again, make sure you check the size of the ad you have changed is an accepted format by Google.

3. Never change the bottom script tag http://pagead2.googlesyndication.com/pagead/show_ads.js

4. Never change the 'google_ad_client' property, otherwise you won't get paid.

5. Play around with colours as much as possible to match the ad to your sites style and theme.

6. Do not confuse the code type="text/javascript" with the Adsense code. This is a JavaScript command and has no impact on the format of the ad. Changing it can render the ad useless.

7. Do not change the 'google_ad_channel' property without first creating the channel in your Adsense account.