Go, Go Google Gadgets

If you’ve ever seen a personalized Google home page, you’ve seen Google
Gadgets in action. Google Gadgets are basically little programs that you (or
someone else) put together and upload to the Google Gadgets collection.
Users can then download those gadgets and add them to their iGoogle home
page or even to their Google desktop application.
Some serious confusion exists about how Google Gadgets works with AdSense,
though, and I clear that up for you. First, a little more about Google Gadgets,
what they do, and how they’re created.
What’s a gadget?
Google Gadgets are mini-applications that are created with XML, HTML,
or JavaScript. When you create a Google Gadget, it can do anything from
display the weather forecast to show you the Bible verse of the day or connect
you to a useful service on a company’s Web page. One example is the
Wikipedia Gadget, which sits on your iGoogle page and shows a search box
for Wikipedia. To perform a search, type your search string into the search
box, click Search, and you’re taken to the correct Wikipedia page. Cool, huh?
Gadgets are an excellent way to turn users onto your products and services
by giving them a sneak peak at what you have to offer. Gadgets can be in
the form of calculators, search boxes, useful tools, or whatever it is that you
have to offer. The thing to remember as you plan to create a Google Gadget is
that the more useful or entertaining it is, the more people will download and
install the gadget, which is the key to monetizing your gadgets.
When you create gadgets, think creatively about the audience that you want
to serve. What does that audience want that doesn’t already exist? When you
hit that sweet spot, you’ll know you’ve come up with the right idea by the
number of downloads of your gadgets.
Creating a gadget
If you have an idea for a gadget that you think will be wildly popular, create
it. You can create gadgets in XML, HTML, or JavaScript. Creating gadgets is
all about how you format the code that makes the gadget work.
Don’t be discouraged if you don’t know XML or JavaScript, though. If you
know some basic HTML, Google provides all the additional information that
you need to create a gadget with the Google Gadgets Editor (GGE). You use
this program to write the code for the gadget. Alternatively, you can use any
text editor that you’re comfortable with, but GGE is specifically designed for
you to work with gadgets.
To access GGE, log in to http://code.google.com/apis/gadgets/
docs/gs.html#GGE and scroll to the bottom of the page. That’s where the
editor,, makes its home — until you offer it a new
home on your computer.
One of the most basic gadgets that you can create is the same program that
everyone starts with when they’re figuring out how to program an HTML site
of any kind — Hello, world!
Hello, world! is a very simple program to write and requires only a few
lines of code, such as:
?xml version=”1.0” encoding=”UTF-8”?>
Module>
ModulePrefs title=”hello world example” />
Content type=”html”>
![CDATA[Hello, world!]]>/Content>
/Module>
I explain this line by line as follows:
?xml version=”1.0” encoding=”UTF-8”?>
The first line is a standard opening line of code that tells any processor
reading it that a program’s coming, and it’s written in this language
with that protocol. In this case, the language is XML version 1.0, and the
encoding protocol is UTF-8.
Module>
The module> tag indicates that a program — the gadget — is within the
program.
ModulePrefs title=”hello world example” />
The third line is the module preferences tag, which indicates information
about the module, such as the title, the author, and other optional features
that might need to be taken into consideration.
Content type=”html”>
Just as it reads, this line tells you what the type of content for the gadget
is. In this case, the content type is HTML (which is why you can get away
with not knowing XML or JavaScript). If you can use the tags here to get
started and you know HTML, then you can use HTML as your content
type and write your gadget using HTML code.
![CDATA[Hello, world!]]>/Content>
The ![CDATA> tag is used to enclose HTML when a gadget’s content
type is HTML. This tag tells the browser that reads the code that the
text within the CDATA section shouldn’t be treated as XML. The CDATA
section typically contains HTML and JavaScript. /Content>, or the
closing tag, is another part to this line. The closing tag — in this case, the
/Content> closing tag — indicates where the content for the module
ends and is a signal that the program information is complete.
/Module>
If you play with it some more, you can tweak it considerably.
Here’s another closing tag. This one indicates that the module is
complete.
With that, you’re finished. This is a very simple gadget, but when done properly,
Obviously, you’ll want to do something a little more sophisticated than a
simple Hello, world! message, but I want to give you a feel for how easy it
is to work with Google Gadgets.
I’m sure you’re wondering where AdSense comes into this mix, though, right?
It’s simple. AdSense doesn’t have a module specifically for Google Gadgets.
However, you can program your AdSense ads directly into Google Gadgets.
Programming your AdSense ads into Google Gadgets is just like creating a
Google AdSense for Content ad. Generate the ad by using the same steps that
you would if you were putting the ad directly into the content on your Web
site, and then insert the AdSense code into your gadget code. (If you skipped
straight to this chapter and you don’t know how to create a content ad, you
can jump to Chapter 5 where I address that.) You may have to play with it a
little to get the styles and placement just right, but the end result is a gadget
that includes an AdSense ad for everyone to see.
Except for one small problem . . .
Creating gadgets sounds simple enough, and if doing so with AdSense ads
piques your interest, you’ll probably want to do a little more studying on the
topic because it’s more involved than I make it sound here. You can read
more about it by going to the Google Gadgets Web site at http://code.
google.com/apis/gadgets.
There’s one small issue of which you might want to be aware upfront. When
you’re creating a Google Gadget with the intent of embedding Google AdSense
code into it, you first need permission from AdSense. AdSense doesn’t usually
have a problem with granting that permission, but without it, your ad probably
won’t show up properly in the gadget.
To get permission, you have to e-mail Google AdSense with their support form
found at www.google.com/adsense/support/bin/request.py. Enter
your contact information in the form, and then, in the text box provided for
questions or statements, write a brief request to use AdSense in your gadget.
If you already have an active gadget that is popular, be sure to include information
about it. If you’re creating a new gadget, include that information too. And
don’t forget a description of your gadget. Google will make the determination
to allow you to use AdSense in your gadget on a case-by-case basis.
You may have to wait a few days to get a response from AdSense, so think a
little ahead of the game if you’re trying to meet a specific deadline.
Another issue to keep in mind when you’re creating your gadgets with
AdSense embedded in them is that the combination of the two isn’t something
that Google came up with, so there are times when gadgets and
AdSense don’t play well together.
This can result in either the gadget that you’ve created not being shown or
the AdSense ad not being shown. There’s no known fix for this issue right
now. Google’s working on it, so you’ll see that your ads and gadgets display
well for a time and then they’ll crash. This is the nature of the beast, so be
prepared with alternative plans (maybe for a gadget without ads) in the event
that one program ticks off the other.
Ultimately, even without AdSense, Google Gadgets are a great investment
of your time because they’re a quick and easy way to draw a lot of users to
your site — especially if you can nail down your audience and provide a truly
useful gadget. If you can combine AdSense with your gadgets, you’ve really
created a winning combination.

0 comments:

Post a Comment