Generating Search Box Code

Life doesn’t always demand stark choices. It’s not as if you can get only
chocolate or vanilla ice cream. In fact, throw in strawberry, and you have
Neapolitan, the ice cream for indecisive folks everywhere.
The same principle applies to AdSense for Search versus AdSense for
Content on your site — there’s no reason you can’t have both. AdSense for
Content works well in and around your articles and other printed content,
and an AdSense for Search box at the beginning of the page (or end of the
page or in a blank space on the page) works pretty well, too. The results from
the search box can add to your AdSense income; although if I were you, I
wouldn’t rely on the search box alone to generate income for your site.
My advice to you: Go with a combination of both content ads and the
search box.
With that out of the way, it’s time to do some code slinging. I start out with
the AdSense for Search code, just because today is Tuesday. (I cover the
AdSense for Content code later in this chapter.) Keep in mind, though, that all
the AdSense ad formats are created in about the same way. You work through
the wizard, copy the text, and paste it into the HTML on your Web site. Pretty
simple, in other words. You’ll probably spend more time debating where to put
your search box than you’ll spend actually dealing with the code.
You can install the search box wherever you have some blank real estate that
you don’t plan to put higher paying ads or other content on. Some designers
place their search box at the top of the page, others at the bottom. Very few
actually use a search box in the center of the page or off to either the right or
the left because the box looks awkward and out of place in those locations. Site
visitors usually look to the top or bottom of the page if they want to search.
To create a search box for your Web site:
1. Point your browser to www.adsense.com, log on to your AdSense
account, and click the AdSense Setup tab.
2. In the Setup tab, select the AdSense for Search option.
Doing so calls up the AdSense for Search Wizard.
3. On the top of the first wizard page, , select
either the Google WebSearch option or the Google WebSearch +
SiteSearch option.
WebSearch allows visitors to search the Web for additional information
whereas WebSearch + SiteSearch allows users to search up to three Web
sites that you specify in addition to the whole Web.
4. If you select WebSearch + SiteSearch, a new form appears in the
wizard, . Fill in the Web addresses of the sites
you wish to allow visitors to search in the appropriate text boxes.
If you select WebSearch, you can skip to Step 5.
In most cases, those sites will be your own sites, but you can select any
sites you like. You also don’t have to enter three sites — one or two are
fine if that’s your preference.
5. Scroll down to the middle of the page, , and
then choose your search box style.
Each of the options has a preview that appears when you select that
option. You can choose to move the Google logo above the search box,
or to remove it completely and place it on the search button. Another
available option is to move the search button down below the text field
of the search box.
Next to the search box style you’ll find options to change the background
color, text color, and allowable text length of the box. Feel free
to select the options that work best with your Web site.
6. From the drop-down menus at the bottom of the wizard page, select
the default language for search results.
There are 30 — count ’em, 30 — options besides English.
7. Choose the type of page encoding that your Web site uses from the
options in the drop-down menu provided. The type of encoding that your site uses depends on how it’s designed.
If you don’t know what type of encoding your site uses, check with your
Web site designer. The most common encoding used for Web sites
is UTF-8, but Western (Windows 1252) is another common encoding
format.
8. In the final drop-down menu on the wizard page, select the country
you’re in so Google knows which domain to search from. After you
make your selection, click the Continue button.
The second page of the wizard appears where you have a chance to customize
your search results page.
9. Use the Palettes drop-down menu to select a different
palette for your various color needs, or click the small, colored box
next to each element of the search box — Text, Background, Border,
and so on — to create a custom palette.
If that’s still not good enough for you, you can always enter the sixdigit,
hexadecimal number in the text box provided for each element.
By the way, don’t let the term hexadecimal scare you; it’s just a number
that represents the color you want to use. A nifty sidebar in Chapter 7
explains colors and hexadecimal numbers in more depth.
10. If desired, use the logo customization tools to
upload a personalized logo to your search results page.
It’s easy to do, enter the URL showing where your logo is located on
your Web site. If you’re not certain of that URL, right-click the logo in
your browser and select Copy Link Location. Then, paste that link location
into the Logo Image URL box, and AdSense pulls your URL whenever
a search results page is shown. After you enter the location of the
logo, the preview display changes to reflect the logo you want to use.
The second text box, Logo Destination URL, is there so that you can
make the logo on your search results page a link back to your Web site if
you like. To do that, enter the URL of your Web site — or whatever page
you would like to send visitors to — in the provided text box.
11. In the More Options section, , select whether
you want the search results page to open in a different page or
window, or to open in the same page by selecting the desired option.
Opening the search results page in another window or page is best. That
leaves your Web site open for visitors to return when they’re finished
looking through search results. After all, the idea here is to give them
additional tools to help them make better decisions about using your
site, not to direct them away from your site (potentially) for good.
12. Decide whether you want to customize the type of search results with
the help of the Site-Flavored Search option.
Site-flavored search customizes search results over time to your topic
and to your Web site visitors. It takes some time for the search results to
become highly targeted because Google tracks which results are most
clicked by site visitors that use the search box. Site-flavored search can
add an additional element of functionality to your search capabilities,
however, because it discovers how to provide the best possible results
to your visitors. If this is an option that you want to use, select the
Customize the Type of Search Results I Get to My Site Content check box.
If you do choose this option, the site-flavored search options expand, , so that you can select a profile to use to track the
search results.
13. Use the drop-down menu provided to select the desired profile.
There may be no profiles available to choose from if this is the first
time you’ve selected this option. To create a profile, select the Add New
Profile link. A text box appears where you can enter the name of the
desired profile. When you’re finished, click OK and the profile is created.
14. If you want to protect visitors from being exposed to adult-themed search
results, select the Use SafeSearch check box.
The SafeSearch option blocks adult content.
15. For the last option on this page, decide whether you want to use a
custom channel to track your results.
Custom channels are like Web counters. Each time a visitor uses a search
box that you’ve assigned to a custom channel, the count for that visit is
credited to that specific channel. Custom channels provide a way for
you to keep track of which ads are successful and which ads get low
amounts of traffic.
You can choose to add a custom channel that separates this traffic from
other AdSense traffic. To create a custom channel, click the Add New
Channel link. This opens a dialog box where you type the name of the
channel you want to use and then click OK. The channel is then automatically
set for you. If you already have an existing channel you want to
add, select it from the drop-down menu.
16. When you finish customizing your search box and search attributes,
click the Continue button.
The final page of the wizard appears, containing the code for your
search box in all its glory.
17. Copy and paste this code into the HTML of your Web site and you’re
done.
If you’re not sure where to paste it, keep reading. You can read more
about code placement a little further along in this chapter in the section,
“Code Placement for Optimum Traffic.
Now you have a search box for your Web site. Go ahead and try it, just to see
if it works. Ain’t technology grand?
If you’re not generating any income from the search box, you can always
remove the code after a few weeks of testing. With AdSense, testing is the key
to finding what works for your Web site. Keep in mind that what works for you
might not be the same thing that works for others. That doesn’t mean you
should ignore what others have figured out; only that you shouldn’t be limited
by others’ experiences.

0 comments:

Post a Comment