8.4. AdSense Ad Settings
Once your AdSense account has been approved, you probably want to get started by adding the code that will place Google's ads on your site. To get started with AdSense for Content , log into Google AdSense, and click the Ad Settings tab. The Ad layout code page will open.
8.4.1. Getting Ad Layout Code
The Ad layout code page is used to generate code for content ads that you will place in your web pages. There are a number of sections of the Ad layout page used for choosing options, including:
220.127.116.11. Ad type
Ads are supplied by Google in units. An ad unit contains from one to six ads. A link unit, shown in Figure 8-4, contains four or five links to pages listing ads.
Your first choice is to decide which kind of unitad or linkyou want to display (Figure 8-5).
Figure 8-4. A link unit displays links to Google ad pages
Figure 8-5. You can choose between ad units and link units
If you select an ad unit, the drop-down list to the right of the ad unit radio button (shown in Figure 8-5) is used to determine whether only text ads will be displayed in the unit, only image ads will be displayed in the unit, or both.
When you choose to generate code for a link unit, the drop-down list to the right of the link unit radio button is used to decide whether the link unit will provide four or five links.
Ad units display ads directly on your pages, where they are probably more likely to be clicked than link units. Link units, a relatively new kind of Google unit, are in some ways one step removed; a link unit presents links to ads rather than the ads themselves. But the advantage of the link unit is that it takes up almost no space. This effective use of real estate makes sense if your site visitors are affirmatively looking for additional resources related to a topic rather than "impulse clicking." Once again, experimentation and trial and error is the best way to find what works on your site.
18.104.22.168. Ad layout
The Ad Layout section of the ad layout code page is used to specify a size for your ad or link unit. Figure 8-6 shows the drop-down list of choices for ad units, which are also shown in Table 8-1.
Figure 8-6. If you are specifying an ad unit, you select its size from this drop-down list
If you are specifying a link unit (in pixels, width first), your size choices, shown in below are different:
22.214.171.124. Color palettes
Color palettes are schemes for the text and graphs of ad units that Google provides so that your ad units will work well with your site. These color schemes, as you can see in Figure 8-7, have fanciful names, like Wicked Witch and Black Night.
Figure 8-7. You can choose from a number of existing color schemes, called a color palette, for your ad unit
The best way to see which (if any) of these color palettes is right for a given web page or site is to run through the list of possibilities in the drop-down list shown in Figure 8-7. When you select a color palette, an example showing the appearance of the ad elements using that scheme will display.
You can also create your own color palettes from scratch, if nothing that is available out of the box meets the needs of your site (see "Custom Ad Colors" later in this chapter for details).
126.96.36.199. Alternate URL or color
If Google doesn't have an ad to display on your web pagebecause it hasn't figured out what would be contextually relevant, or because there's nothing in the Google ad inventory that matches your contentGoogle will display a public service ad of its choice. There's nothing wrong, in my opinion, with public service ads, and personally I always elect to display them. However, some webmasters do not like to give away their "real estate" without getting something in return.
You can change the behavior of a Google ad unit when it doesn't have an ad to serve by choosing either an alternate URL or a color code (Figure 8-8). The obvious use for an alternate URL is to use it to link to a standby ad of your own, so that the real estate occupied on your site by the Google ad unit can be productive even when Google doesn't have any ads to serve. The Color code box is used to enter a color specification in hexadecimal RGB notation . To get the hexadecimal for a color, you can click the Choose a color link. Select the color you'd like from a palette and Google will supply the hexadecimal code. This color will be displayed in the Google unit when there is no ad to serve.
Figure 8-8. If you choose an alternate URL, or a color code, Google will not display public service ads
188.8.131.52. Selecting a channel
Channels are a mechanism for keeping track of which part of a siteor which site if you are managing multiple sites in one AdSense accountis generating clicks. Custom channels are channels that you define in advance of ad deployment. A Google unit can be assigned to a custom channel you've created, as shown in Figure 8-9.
Figure 8-9. Custom channels are user-defined and can help you keep track of pages and groups of pages and their click throughs
In addition to custom channels , URL channels , which tracks ad-unit clicks by URL, can help you keep track of how your Google ad and link units are doing. See "Using Channels" later in this chapter for more information about channels.
184.108.40.206. Putting the ad on a frame
HTML frames allow publishers to present documents in multiple views, which may be independent windows or subwindows. One view may be kept visible while other views are scrolled or replaced. An HTML page made up of frames (views), called a frameset, is defined using the <frameset> tag. The location of each view is specified in a <frame> tag.
If you intend to put your Google ad unit on a page that is part of an HTML frameset, it is important that you ensure the ad will be placed on a framed page box.
8.4.2. Grabbing the Code
With your Google unit selections made, it's time to grab the code for your unit and place it in your web page.
220.127.116.11. Ad unit example
Suppose you decided to create a Leaderboard (728 x 90) ad unit using the Steely Gaze palette (otherwise accepting the default options from Google). The next step is to click the code box shown in Figure 8-10 to select and then copy the code for the unit you have specified.
Figure 8-10. The next step is to copy and paste the code from the box into your web page
Here's the complete code for the ad unit:
Figure 8-11 shows the Leaderboard ad unit displayed with ads on a web page.
Figure 8-11. The Leaderboard ad unit is displayed on this web page
18.104.22.168. Link unit example
Suppose you decided to display a link unit with five links, 200 x 90, in the Black and Blue palette (otherwise accepting the default options). Here's the code AdSense would generate for you to copy and paste:
Paste the link unit code into an include file, copy the include file to your server, and modify your content pages so they include the link unit file. The link unit will then appear on your site, hardly taking up any space at all, and just look like more links, as shown in Figure 8-12. If you click on one of the links in the link unit, a Google page consisting of contextual ads will open (Figure 8-13).
8.4.3. Custom Ad Colors
The Ad Colors page can be opened by clicking the Ad Colors link on the Ad Settings tab or from the Manage color palettes link on the Ad code layout page.
Figure 8-12. This ad unit, shown on the lower right, consists simply of links
Figure 8-13. The links in each link unit open a page of contextual ads
Using the AdColors page, you start with one of the built-in Google palettes. Next, you can modify each of the colored elements of the palette, either by specifying an RGB hexadecimal color value or by choosing colors from a color picker (see Figure 8-14).
Once you have the color scheme you want, you can save your custom palette (using any name you'd like). Your custom palette will be added to the list on the Ad layout page (Figure 8-15), which opens if you click Save and get code.
Figure 8-14. Creating your own custom palettes makes it easy to match the design of your site
Figure 8-15. Custom palettes are available on the Ad layout code page
8.4.4. Using Channels
The Channels page, opened by clicking the Channels link on the Ad Settings tab, lets you define URL and custom channels .
URL channels are tracked by web address, and you can add these at any point. You can use URL channels to track a single page, a directory in a domain, or an entire domain. For example, the URL channel www.digitalfieldguide.com will track ads served and clicked on this URL and ads on any page below that address (for example, ads on pages in www.digitalfieldguide.com/blog/). In contrast, the URL channel www.digitalfieldguide.com/index.php tracks activity only on the page index.php. Figure 8-16 shows the interface for creating and managing URL channels.
Custom channels are not limited by the domain and directory structure of your web server and track activity from an ad unitwherever it is locatedthat is linked to the custom channel. The catch is that for this to work, you need to have created the custom channel and associated the ad unit with that channel before deploying the ad unit. In contrast, you can always add a URL channel (but URL channels are not flexible in terms of the information they report).
Figure 8-16. URL channels track activity by web address, so you can use them to monitor impressions and clicks on specific pages, directories, and domains
Figure 8-17 shows the interface used to create custom channels.
Figure 8-17. Custom channels must be defined before they can be deployed but can be used for granular ad unit tracking
8.4.5. Applying Competitive Filters
Some times it's a good idea to filter ads so that they don't appear on your site. The most common reason for doing this is to make sure that competitors' ads don't appear on your site, but you might also simply want to make sure that ads from organizations you find offensive don't appear beside your web content.
To block ads, based on their destination URL, from appearing on your site, click the Competitive Ad Filter link found on the Ad Settings tab. Enter the addresses you want to ban in the box shown in Figure 8-18.
Figure 8-18. You can easily filter out ads from your competitors or that you find offensive