Why am I missing my GeoIP data?
Tags: analytics, configuration, sitecore
Published: 2018-09-07 14:55:15

---
title: Why am I missing my GeoIP data?
published: true
tags: Analytics,Configuration,Sitecore
canonical_url: https://blog.jermdavis.dev/posts/2018/why-am-i-missing-my-geoip-data
---

**Updated:** There is [a follow-up to this post, which points out some extra issues with the way GeoIP configuration is currently documented for v8-era Sitecore setups that change the “`Analytics.PerformLookup`” setting below](https://dev.to/jermdavis/why-am-i-still-missing-some-geoip-data-mg5). If this setting is of interested to you, please read that too!

* * *

I spent some time this week looking at a client site whose analytics data was missing GeoIP information. Since they had a valid license for Sitecore’s GeoIP lookup service, this was a bit confusing. So, continuing my battle to write up all the unexpected scenarios…

## The issue

The client site I was asked to look at was running Sitecore 8.2, and they had [used the App Center to set themselves up with a license for GeoIP lookups](https://doc.sitecore.net/sitecore_experience_platform/82/setting_up_and_maintaining/ip_geolocation/setting_up_sitecore_ip_geolocation). Writing code that called the lookup manager directly seemed to be working – and returned valid data about the current user.

But when you looked at the analytics data visible in the Sitecore UI, none of the users had any location data associated with them.

[![](https://jermdavis.files.wordpress.com/2018/04/nolocations.png?w=800&h=325)](https://jermdavis.files.wordpress.com/2018/04/nolocations.png)

After seeing this issue, I had a dig around looking for any clues about what was going on. What I noticed was that the raw data in MongoDB was missing for anything relating to GeoIP. The “GeoIPs” collection wasn’t present, and none of the records in the “Interactions” collection included the “GeoData” element.

[![](https://jermdavis.files.wordpress.com/2018/04/nogeoip.png?w=800&h=548)](https://jermdavis.files.wordpress.com/2018/04/nogeoip.png)

## The fix

It took some head-scratching, googling and config file diffing, but eventually I worked out what was up.

The client’s site was running one CM server and two CD servers, which shared the same core config files. Those config files included a change which set the “`Analytics.PerformLookup`” setting to false.

Documentation (Can’t find it specifically for V8 – but [it is covered for older versions](https://sdn.sitecore.net/upload/sitecore6/61/analytics_configuration_reference_sc61_usletter.pdf)) says that this setting should be “true” for precisely one server in any deployment – in order to protect against deadlocks, and to avoid chewing up your lookup allocation excessively. (Note that [V9’s documentation says you can set it true on multiple servers](https://doc.sitecore.net/developers/server-role-configuration-reference/core-roles/content-delivery.html) – so that code has clearly changed a bit in more recent releases) Since this site had it set false everywhere, it looked like none of the machines in the cluster were actually performing the asynchronous lookup of IPs that xDB was recording.

I came across a blog post which [suggested it should be your least loaded server that does these lookups](https://horizontalintegration.blog/2016/08/28/sitecore-8-geo-ip-lookup-configuration-tips/) – which makes a lot of sense. So I deployed a simple patch to the CM server to make that setting true again:

```xml
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
  <sitecore>
    <settings>
      <setting name="Analytics.PerformLookup" set:value="true"/>
    </settings>
  </sitecore>
</configuration>
```

Once that was deployed, the missing MongoDB collection data appeared:

[![](https://jermdavis.files.wordpress.com/2018/04/validgeoipdata1.png?w=800&h=548)](https://jermdavis.files.wordpress.com/2018/04/validgeoipdata1.png)

And the experience explorer started to show locations for new visits:

[![](https://jermdavis.files.wordpress.com/2018/04/visitlocation.png?w=800)](https://jermdavis.files.wordpress.com/2018/04/visitlocation.png)

Success!