What does Sitecore’s GeoIP return for “Region”?

One of my colleagues was looking into GeoIP in Sitecore 8. This is where a user’s IP address is resolved to (roughly) a location. He was looking at the records in Mongo and wondering…

What is the Region code in these records?

regions

That’s a reasonable question…

Obviously, a letter and a number isn’t going to be that useful, globally – there are more than 260 regions world-wide. It seems likely that this is used in concert with the country code.

A search around didn’t show up much that was that useful about it. I did, however, turn up this article by Martin English, which shows that the Sitecore assembly is using a value “subDivisionIsoCode” for the ‘Region’ value.

A bit more searching turned up ISO 3166. That looked promising – but when I browsed through the ISO Platform – well, it seems GB 3166-2 codes should be 2 then 3 letters, not a letter and number. Hmm.

Enter Wikipedia, which has a list of the ISO 3166-2 codes for the UK. At the bottom of this, in the ‘see also’ section, there’s a link to FIPS region codes of the United Kingdom. FIPS, it seems, is an obsolete (withdrawn 2008) US Government standard. It does seem unlikely that Sitecore would be returning an 8 year out of date region code, but here’s the thing – the codes match. K2 is the County of OxfordshireZ3 is the Vale of Glamorgan.

I am genuinely bewildered why, but it seems that Sitecore’s GeoIP service returns values from an obsolete standard, rather than ISO 3166. It doesn’t make sense – but the values are right!

Has anybody else looked into this?

Advertisement
What does Sitecore’s GeoIP return for “Region”?

One thought on “What does Sitecore’s GeoIP return for “Region”?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.