An Update on Explaining Sitecore Geographic (GeoIP) Personalization Rules
December 17, 2018
A number of years ago I wrote a blog post about Sitecore’s GeoIP personalization rules that included explanations of what each rule did and how to use it. I’ve heard that many people have found this post to be useful, but in referencing it in my Personalization for the Masses presentation I’ve discovered that some of the data and links are out of date. To that end I wanted to share an update on some of these rules.
One of the big changes is that nobody refers to Sitecore’s marketing tools as “DMS” anymore. Frequently it’s just called “personalization” or “Experience Management”. Sometimes the data store behind it, “xDB” is used.
As I mentioned previously, geographic targeting is one of the more valuable and accessible routes to taking advantage of Sitecore’s personalization capabilities. This is all still true and even more important now as more of the world has shifted over to consuming the web on mobile devices. Geographic targeting lets you tailor a web experience to the location in which a site visitor originates, providing more relevant content and better user experience. Examples include showing events near a person, showing relevant local news, or highlighting content for users browsing from a store’s wifi.
Sitecore’s experience management tools allow content editors to easily configure the targeting of content based on a user’s location but there are some details of the rules that had been difficult to turn up before my post.
One of the big changes between the time I wrote the initial post and today is how the GeoIP lookup service is provided. It used to be a service provided directly from MaxMind but is now provided through Sitecore themselves. There’s an exciting development here, though: the service is now free for Sitecore licensees. The setup steps from Sitecore still need to be followed to get it working, however.
Sitecore still uses its rules engine to make personalization decisions, evaluating the rules a content editor configures to decide what content or presentation components to show a user. The rules that Sitecore provides include a number using GeoIP. These rules cover most of the cases that you may be personalizing for, but sadly the syntax of the values that they need to compare against still isn’t obvious and still requires some explanation.
One thing to keep in mind on a Sitecore site is that because of some quirks in the way GeoIP data is referenced, GeoIP data for a visitor may not be available for that visitors first request. This makes sense, because it could force users to wait a long time while the lookup is performed if pages weren’t served for them until the data was available. IP lookups are cached, so the underlying information will be available for their second request and for subsequent requests coming from that same IP. Sitecore provides a Knowledgebase article on troubleshooting the Geolocation service that also contains helpful information about this caching.
I’ll explain how each of the rules is used:
Where the Area Code Compares to Specific Value
This rule allows compares the visitor’s area code to a specified value. MaxMind exposes area codes as digits only, so compare against “410” not “(410)”. There is not much that has changed from this rule.
Where the Business Name Compares to Specific Value
In some cases, a business or institution may be available for an IP address. This rule compares against the name of that organization. This rule is not very useful, however, because these values are also made available through the rule that exposes a user’s ISP.
Where the City Compares to Specific City
This rule compares the visitor’s city to the specified value. The list of cities that can be checked against is provided to the Sitecore service by their partner MaxMind. Details of this data can be viewed in a spreadsheet (actually, a CSV) here. This spreadsheet contains the raw data for over 350,000 global locations and can be used to determine the specific city names that Sitecore compares against.
Where the Country Compares to Specific Country
This rule compares the visitor’s country to the content editor specified value. The list of countries that can be checked against is provided to the Sitecore service by their partner MaxMind. Details of this data can be viewed in a spreadsheet (actually, a CSV) here. This spreadsheet contains the raw data for over 350,000 global locations and can be used to determine the specific country names that Sitecore compares against.
Where the DNS Address Compares to Specific Value
This rule is similar to the information provided with Business Name, but is more specific. For example, the company may be “TA Digital”, but the DNS address could read something more like toronto.techaspect.com. This rule can be useful if you’ve got a very specific use case, especially if you’ve got a site with an internal audience (to target different target to different offices on an intranet, for example).
Where the IP Address Compares to Specific Value
The internet relies on IP addresses to route traffic. They are one of the fundamental building blocks of online communication, so it makes sense that Sitecore lets you target content at users coming from a specific address. This is the rule you use to do just that. IPs should be supplied to the rule in the standard format: 0.0.0.0.
Where the ISP Name Compares to Specific Value
This rule exposes the ISP that provides the IP address from which the visitor is accessing a website. In my case, this would be “Verizon”, but it could also likely be “Comcast”. Additionally, for traffic coming from a corporate network, the ISP may be the owner of that network. Getting accurate data to supply for these values can be tricky so I recommend using your existing Sitecore analytics data to find the values you may need.
Where the Latitude Compares to Specific Value and Where the Longitude Compares to Specific Value
These rules allow you to target content based on a user’s latitude and longitude. Remember that these rules are based on an IP address and not GPS or location information that a browser or mobile device may be able to provide.
Where the Metro Code Compares to Specific Value
This rule was one of the more confusing at first, but actually turns out to be incredibly useful. Metro codes are another term used for a “Designated Market Area” (DMA). DMAs are areas defined for use by TV and Radio stations but are also useful for all sorts of marketers. The Wikipedia article for Media Markets contains lots of great information about them. The metro code values that correspond to locations can be viewed in the ever helpful MaxMind spreadsheet here.
Where the Postal Code Compares to Specific Value
This rule personalizes based on zip or other postal codes used for mail or package delivery. These codes are available for some IP addresses in Australia, Canada, France, Germany, Italy, Spain, Switzerland, United Kingdom, and the US. In Canada, the first 3 characters are returned, and the first 2-4 characters (outward code) for postal codes in the United Kingdom are provided.
Where the Region Compares to Specific Value
This rule provides personalization choices based on a state, province, or similar geographic unit. The rule should compare against a two-character ISO-3166-2 or FIPS 10-4 code for the state/region associated with US and Canadian IP addresses. The following are also options that may come back for military IPs:
- AA – Armed Forces America
- AE – Armed Forces Europe
- AP – Armed Forces Pacific
For all other countries, FIPS codes are also exposed.
The helpful MaxMind CSV file also provides region code data.
There have been a few changes to this information over time, and the one constant in technology is change, but these updates should be helpful for marketers for a little while at least.
Explore Additional Resources
Learn how you can select the best Digital Experience platform for your business.
Our Certified Sitecore Experience Platform and Sitecore MVP’s specialize in helping you deliver seamless contextually personalized customer experiences.
Join Sitecore MVP Ed Kapuscinski for his popular webinar Sitecore: Personalization for the Masses, on January 17th. Learn the hurdles and best practices for personal Sitecore implementation.
Get Help from Our Experts
Over the past 19 years, we have completed thousands of digital projects globally. We have one of the largest and deepest multi-solutions digital consulting teams in the world. Our proprietary processes and years of Digital Experience expertise have earned us a 97% customer satisfaction rating with our clients ranging from Global Fortune 1000 to Mid-Market Enterprises, leading educational institutions, and Non-Profits.
We are recognized as a top Sitecore Company on DesignRush.
About TA Digital
TA Digital is an innovative digital transformation agency, specializing in delivering digital experience, commerce, and marketing solutions. For nearly two decades, we have been helping traditional businesses transform and create dynamic digital cultures through disruptive strategies and agile deployment of innovative solutions. We are known as a global leader in the digital technology industry for helping marketing leaders achieve their revenue targets, create profitable, omni-channel customer and commerce experiences. TA Digital has high-level strategic partnerships with digital technology companies Adobe, Microsoft, Sitecore, Acquia, Marketo, SAP Hybris, Elastic Path, IBM Watson Marketing, Coveo and Episerver. The company was named on 2013, 2014, 2015 Inc. 5000 list as one of the fastest-growing technology companies in the United States.