Location Detection in the Algorithm | Yext Hitchhikers Platform

What You’ll Learn

In this section, you will learn:

  • Why a user’s location is important in Search
  • How we detect user location

Why is location important?

A user’s location is very important if we are searching for any entity that has a location attribute. Even if a user doesn’t input something like “near me” or a specific location, we can usually guess that they’ll want to see entities with locations nearest to them first, all other things being equal.

Because of this, we use location in our ranking decisions. We’ll first apply any of the relevant filtering to return results returned, and then we’ll sort the entities based on proximity to the user.

How do we determine location?

There are three ways we determine a user’s location:

IP Address: We can use a user’s network IP address. This is the least accurate, but will usually be available as a starting point. Common issues with IP-derived location are if you’re on a shared network or on a VPN.

HTML5 Geolocation (Browser Opt-In): This is the most accurate, but has to be explicitly allowed by a user. A user will be prompted to share their location only if we identify they have ‘near me’ intent within their query. Here are some examples of ‘near me’ intent.

  • Close By
  • Closeby
  • Close to me
  • Near Me
  • In the area
  • Nearest
  • Closest

User Query Intent: Of course, if a user specifies a location in the query, that will be the most accurate indicator of the location they’re trying to search for. In order to determine this from a natural language query, we first use Named Entity Recognition and a machine learning model called BERT to understand whether a term has location intent. We then consider the locations in the Knowledge Graph in order to determine the best match against the Address Line 1, City, Region, and Countries of your entities in Search.

Note: Address Line 1 is currently only supported for US-only experiences.

For example, with a query like “Locations in Springfield”, we first will need to determine that “Springfield” is a location entity.

We might have several candidates for “Springfield” however - see below. How can we choose between these?

  • Springfield, MO
  • Springfield, MA
  • Springfield, IL
  • Springfield, VA

If we know the only city that has locations in the Knowledge Graph is Springfield, VA, we’ll filter on the location that will return results, as that is what the user is most likely searching for.

unit Quiz
+20 points
Daily Quiz Streak Daily Quiz Streak: 0
Quiz Accuracy Streak Quiz Accuracy Streak: 0
    Error Success Question 1 of 3

    What are the ways we can determine location from a query? (Select all that apply)

    Error Success Question 2 of 3

    When is user location used? (Select all that apply)

    Error Success Question 3 of 3

    Why can’t we always use HTML5 Geolocation if it’s more precise?

    Way to go, you passed! 🏁

    You've already completed this quiz, so you can't earn more points.You completed this quiz in 1 attempt and earned 0 points! Feel free to review your answers and move on when you're ready.
1st attempt
0 incorrect