: Is there a way I can redirect search engine traffic by U.S. State or Zip Code? I work for an e-commerce company that operates solely within the United States. However, the price of goods and
I work for an e-commerce company that operates solely within the United States. However, the price of goods and availability of our products depends on what State or even Zip Code you reside in (we sell alcohol).
I know that there are techniques for localized SEO on a national scale, but I was wondering if there is anyway we can do it on a Provence/State scale. I have been searching for an answer but everything seems to be on the international scale.
For example, we would prefer it if Google/Bing/Yahoo knew the location of their visitors and could point them to:
oursite.com/?state=CA
Or
oursite.com/?state=TX
Or
oursite.com/store/product1?state=MA
Is there anyway to convey this information to the search engines with either canonical tags or another approach?
More posts by @Speyer207
2 Comments
Sorted by latest first Latest Oldest Best
Unfortunately, the only options to Geotarget your website in search engines are by country/region.
However, you can accomplish the same thing using MaxMind, which offers a GeoIP City database that breaks down visitors by:
Postal/Zip Code
City Name
Metro Code
Latitude & Longitude
When visitors arrive at your website, their IP address can be compared against this database using the above criteria, for example zip code, and redirected to the appropriate URL of your e-commerce site.
You can integrate this with your website using a number of different server-side language API's:
PHP
Python
Perl
Ruby
Java
C#
C
...
Many of these have easy to use open source modules. For example, I use this PHP extension: Geo IP Location, as well as this Perl module: GEO-IP
There's a free version of the database, GeoLite, which is updated once a month, and a more accurate paid version, GeoIP City. You can try an an online demo here.
There's also a JavaScript Client API, available in a paid and free version (the free version only requires an attribution statement on your website). This combines both W3C Geolocation and their GeoIP2 Web Service, which first attempts to get the visitor's location from their browser, and if not available or inaccurate, it then uses a GeoIP lookup.
It's interesting to note that the Sample Code displays your current location live on their site, so you can see what values are returned for your browser right now. For States, look under subdivisions -> iso_code
In addition to the sample code, there's a tutorial on how to use the API here: GeoIP2 JavaScript Tutorial
Even if the search engine does know the state of the visitor they aren't going to provide this information to you, so you're going to need to try and work this out on your side.
I'm not from the US but I believe over there you can detect the city (and thus state) of a user's IP address with reasonable accuracy, so I'd suggest doing this when someone lands on your site, but also have a dropdown in the top right corner (or similar) so they can change it if you get it wrong. Also don't forget that even if your site operates solely within the US, your site will get international traffic, so have a sensible default for non-US users.
Store this value in the user's session, rather than the URL to avoid issues with indexing.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.