SEO, Design and Marketing Blog

Subscribe To This BlogWelcome to SEO, Design and Marketing, a weekly blog by 10 year web veteran Erik Cunningham. Please feel free to comment and share your thoughts and experiences regarding search engine optimization, graphic design and internet marketing.

Geo Sitemap Tutorial with KML Sample Code

August 15, 2008 by Erik Cunningham

I recently submitted my first Geo Sitemap to Google and thought I would put together a short tutorial to help others do the same.

Special thanks to Martijn Beijk’s The definitive guide on using KML and sitemaps for SEO and Mike Blumenthal’s Google Maps: KML for authority and ranking? for getting me started.

The process requires the creation of two documents. The first document is a “KML” file. A KML (Keyhole Markup Language) file is used to display geographic data in mapping utilities like Google Maps and Google Earth.

KML Sample Code

Here is some optimized KML sample code that you can copy and paste into a text editor like NotePad to get you started:

<?xml version=”1.0″ encoding=”UTF-8″?>
<kml xmlns=”http://www.opengis.net/kml/2.2″
xmlns:atom=”http://www.w3.org/2005/Atom”>
<Document>
<name>Office Location</name>
<atom:author>
<atom:name>Your Name or Company Name Here</atom:name>
</atom:author>
<atom:link href=”http://www.yourdomainhere.com/” />
<Placemark>
<name>Your Company Name - Your County, Your State Here</name>
<description>
<![CDATA[
<h1><a href="http://www.yourdomainhere.com/">Your Company Name Here</a></h1>
<p>Your Full Address Here</p>
<p>Your company description here.</p>
<p>Your phone number and email address here.</p>
]]>
</description>
<Point>
<coordinates>YourCoordinate1Here,YourCoordinate2Here,0</coordinates>
</Point>
</Placemark>
</Document>
</kml>

As you can see, I’ve included the words “Your” and “Here” in the areas of the KML sample code you’ll want to customize to match the unique details of your business.

Finding values for “YourCoordinate1Here” and “YourCoordinate2Here” is a little bit tricky but don’t fret. Here are the steps required to obtain these values.

Step 1

Enter your full address into Google Maps and click the “Search Maps” button.

Step 2

Locate your address marker on the map, position your mouse pointer near (but not directly on) the marker, right-click your mouse and select “Directions from here”.

Step 3

You’ll see two numbered coordinates appear under “Get Directions” in the left-hand frame of your screen. Copy these coordinates and paste them into your KML document, replacing “YourCoordinate1Here,YourCoordinate2Here”.

Step 4

Here’s the “tricky” part. Unfortunately, the two coordinates you just pasted into your KML code are in the wrong order, but don’t panic. Simply swap the positions of the two coordinates in your code and you’ll be all set.

Once you’re satisfied with the content of your KML code, save your document as .kml (eg. “office-location.kml”) and upload it to your web server.

But wait, you’re not done! You still have one more document to create.

Geo Sitemap Sample Code

Now that you’ve successfully created your KML file, you need to create a Geo Sitemap file that tells Google where your KML file is located on your web server.

Here is some Geo Sitemap sample code. Again, cut and paste the sample code below into a text editor like NotePad.

<?xml version=”1.0″ encoding=”UTF-8″ ?>
<urlset xmlns=”http://www.sitemaps.org/schemas/sitemap/0.9″
xmlns:geo=”http://www.google.com/geo/schemas/sitemap/1.0″>
<url>
<loc>http://www.yourdomainhere.com/office-location.kml</loc>
<geo:geo>
<geo:format>kml</geo:format>
</geo:geo>
</url>
</urlset>

Customize the Geo Sitemap sample code above to reflect your domain name and KML file name. When you’re done, save the document as .xml (eg. “geo-sitemap.xml”) and upload it to your web server.

Submit Your Geo Sitemap to Google

Now that you’ve created your KML file and Geo Sitemap file, it’s time to submit them to Google. Log in to Google Webmaster Tools and add your domain name to the list of sites in your Dashboard. Once you’ve verified your site, return to your Dashboard and select the “Sitemaps” link from the left-column navigation.

Next, locate and click the “Add a Sitemap” link from within the page content. On the following page, open the “Choose type…” drop-down and select “Add Geo Sitemap” from the list of options. Enter the URL of your Geo Sitemap file (.xml) and click the “Add Geo Sitemap” button.

Congratulations, you’re done!

Geo Sitemaps and SEO

The SEO effects of Geo Sitemaps on local search remains to be seen. I’ll keep you posted on my studies and observations. If you have any information regarding the SEO value of Geo Sitemaps, please leave a comment below.

Comments (0)SEO — Tags: , ,