Location Search In Sitecore List Manager

Use case

You have customers (and their addresses) stored in xDB. You want to email all customers that live within 100 miles of Atlanta, GA. How do you do that?

We were recently tasked with answering that question. Since we were heading into uncharted territory, the first thing we did was to look for out-of-the-box functionality we could borrow. To get our location segment lists built in List Manager we’ll need the latitude & longitude for each contact, and a rule that will search for those contacts within a location range.

The rule

where lat.png

Looking for out-of-the-box functionality first, we decided to search for latitude in the content editor. we found an XConnect rule that evaluates the Contact GeoCoordinate - Bingo!

It turns out, the lat/lon conditions are only available within Marketing Automation. But, the functionality we need is there. So, we just need to grab that and make a List Manager rule out of it.

The contact facets

The discovery of the rule above led us to something else we didn’t know - The address facet includes a GeoCoordinate class, which includes latitude & longitude as a pair - Bingo! Now we have almost everything we need, and most of it is out of the box.

Putting it all together

There is some development needed to make it all work.

We need to populate the GeoCoordinate properties with the latitude & longitude from the contact’s address. We can use the Google Maps Geocoding API to get that information.

create rule.png

We need to build a List Manager XConnect condition that lets us set the location boundaries for the new location segment. We can borrow the Marketing Automation condition logic and put the boundaries (north, south, east, west) into a single rule. That makes it a little easier to use.

latloncalculator.png

Now we need a little bit of end user how-to. We’re using out-of-the-box latitude/longitude functionality, but marketers are used to picking a mile radius around a pin (address, city, etc.). For our MVP, we don’t want to spend the time/$$ to build an interface that translates an address to a lat/lon.

orl lat.png

Further, we’re going to save our location defaults (e.g., 250 miles from ATL, 100 miles from ORL, etc.) as reusable segments. So, we only have to build them once. For our MVP we opted for a simple Excel lat/lon calculator and trusty Google search to give us our center pin latitude/longitude. Paste the lat/lon into Excel and get the boundaries for our location segment.

Location search.png

Now we can build out dynamic lists of customers in our key locations. As Elon Musk says, so cool, so cool.