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?
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 Oxfordshire. Z3 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?
I just came across your article. I’m sure you’ve figured it out by now, but I wrote an article with info I got from Sitecore about just this subject four years ago. Take a look:
https://www.berndtgroup.net/thinking/blog/sitecore/explaining-sitecore-dms-geographic-personalization-rules