Geo Tag Code Examples
Using GeoSelect to
GeoSelect offers much more than simple page redirects, but dynamic redirects
are probably the fastest way to start using GeoSelect on an existing web site
where you already have a separate page for each geographic location.
Here is an example of using GeoSelect to perform localized page re-directions
based on the viewer's country. In this simple example Canadian visitors
are directed to one page while non-Canadian visitors are directed to another.
- <html>
- <head>
- <geoselect>
- <geoif location="CA">
- <META HTTP-EQUIV="Refresh" CONTENT="1;
-
URL=http://www.yoururl.com/ca.html">
- </geoif>
<geoif default>
- <META HTTP-EQUIV="Refresh" CONTENT="1;
-
URL=http://www.yoururl.com/notca.html">
- </geoif>
</geoselect>
</head>
<body> ...
</body>
</html>
In the above example, users from within Canada would be redirected to ca.html
while everyone else would be redirected to notca.html.
Direct insertion of dynamic localized content is preferable to, and has a number of advantages over the above redirection method.
These advantages include:
- Performance - the page loads faster,
- Search engine indexing of content - many search engine spiders do not follow redirects.
- Page maintenance - It is often easier to maintain the content when it is all on the same page as there is one page instead of three, and there is only one instance of common content.
The code to do this would look something like this:
<html>
<head...
</head>
<body>
... content common to both pages if any ...
<geoselect>
|
|
<geoif location="CA"> |
|
<p>Canadian content - may run for several
pages - can be many thousands of
characters and contain any types of
html tags etc</p>
|
|
</geoif>
<geoif default>
|
|
<p>Non-Canadian default content for the
rest of the world - may also run for
several pages etc.</p>
|
</geoif>
</geoselect>
... content common to both pages if any ...
</body>
</html>
|

|