What is Geo-Fencing? A No-BS Comprehensive Guide

What is Geo-Fencing? A No-BS Comprehensive Guide

Table of Contents:

1. Now, what is Geofencing?
2. How Geofencing actually works?
3. How to create Polygonal geofences
4. How does location tracking work?
5. Use-cases of Geofencing

In 2015, Whole Foods had partnered with the location-based marketing firm- Thinknear which helped them introduce geofencing in their mobile strategy.

Here is what they did- whenever a Whole Foods user ended up in the close proximity of a Whole Foods store, he received a message that prompted him to visit the store. He would get the message even if he ended up in the proximity of a Whole Foods’ competitor.

The whole campaign gave them a post click conversion rate of 4.69% which was “more than 3 times the industry average.” (Thinknear Case study)

For a company like Whole Foods, even a fractional jump in such metrics imply millions in their bottom line.

We may not be Whole Foods, but you get the point, right?

Now, what is Geofencing?

Geofencing is a method of defining a virtual barrier on a real geographical location.

It has plenty of use-cases across industries but our marketing minds mostly associate it with proximity marketing, and this post is oriented around it.

Proximity marketing is a type of location-based marketing in which you send personalized content to the user depending on how close he is to a particular location. This particularly helped offline retailers to have the same capability as their online counterparts in terms of providing contextual recommendations to users.

Remember this famous Starbucks message?

Users got it because they entered the geofence, built by Starbucks, around one of their physical stores.

Both Android and iOS allow you to create a geofence by specifying the radius and lat-long (short for latitude and longitude) of the centre of the real geographical region that you wish to monitor.

Being able to create such virtual boundaries have incredible use-cases for mobile publishers and consumer businesses.

Sending a real-time message when the user is in proximity is just one example. We shall learn about the underlying concept later that would enable you to think of such use-cases yourselves.

Now, to understand the nuance of how it works, let’s first get the technical aspects right.

iImage source: dribbble.com

All You Need To Know About Geo-Fencing

Here are 11 use-cases and advantages

How Geofencing actually works?

Geofence is built using Geofence.Builder class in Android. (For the sake of simplicity let’s only focus on Android for now.)

Take a look at the sample code below. No problem if you are not a code-lover, neither am I. Just throw a quick glance and the comments (text followed by //) would explain everything.

Geofence geofence = new Geofence.Builder()
    .setRequestId(GEOFENCE_REQ_ID) // Geofence ID
    .setCircularRegion( LATITUDE, LONGITUDE, RADIUS) // defining fence region
    .setExpirationDuration( DURATION ) // expiring date
    // Transition types that it should look for

Once a geofence is activated, the system can trigger any action, as defined by you, when the user enters or exits or spends a certain amount of time in it (dwell). We will cover that in detail later.

As it is apparent from the above code, the function defining the boundary of the geofence [.setCircularRegion] accepts three arguments- Latitude, Longitude, Radius.

So, this makes geofence inherently circular in nature.

Now, when you are targeting a circular area or when accuracy is not so much the point of concern then it’s okay creating a circular geofence. But what if you are like Uber- as in, you wish to monitor a strictly non-circular area like arrival area of the airport to quote a different price or initiate a different promotion.

For such use-cases, you need polygonal geofences.

How to create Polygonal geofences

To create a polygonal geofence the standard procedure remains the same.

It’s just that, later on you simply run a check whether the current lat/long from the polygonal boundary is enclosed in the geofence or not.

There is a beautiful thread on stackoverflow that addresses the same question.

Now, Geofencing heavily depends on the location accuracy of the user’s device. How?

Suppose you are targeting at a city level. With such broad targeting accuracy is not the major concern. You could easily accept the error of up to 1000 meters.

However, if you are targeting users present less than 50 meters away from your business, like what Whole Foods did, then you require high accuracy. Accuracy, in turn, is the function of how precise your device’s location tracking is.

This brings us to our next question:

How does location tracking work?

Location tracking is the precursor to geofencing and everything that has anything to do with geo-specific marketing.

To figure out the location, the apps use a location API to query the location coordinates both in Android and iOS environment. However, contrary to the popular perception, it’s not just GPS that could track user’s location. Location data can be/is fetched from different sources.

  • Wifi
  • Device Network
  • Beacons

A combination of GPS, wifi and cell-tower triangulation is used to provide the most accurate Lat/Lon. There are other sources as well like IP, Beacon etc but the above three are most common in use. To understand how triangulation works and how your Wifi router has anything to do with location tracking, refer to this article.

The app has to although rely on the OS to get the geolocation data both in Android and iOS environments. App consumes the data, OS gets the location.

Android allows us to set the desired precision level of the location and it mentions the sources it would leverage to identify the location. (check image below) It is a good practice on Android’s part because GPS consumes excessive battery, way more than other sources of location tracking (network, wifi etc). This is the reason why apps like Runkeeper are renowned battery drainers.

The OS’es currently require the apps to take explicit permission from the user to share his location (thankfully). Yet, Android has been accused of tracking users despite them having their location turned off. What if the user doesn’t give his permission?

Even if the user isn’t giving permission, the developer has the option to figure the location by using third-party services which rely on RIPE database to determine the location of the user. They basically track the IP address of the user to map it to the nearest cell tower. So they are not perfectly reliable but okay for city-level targeting.

Use-cases of Geofencing

For instance, you define a geofence as shown above. Once you do that you can use ‘enter’, ‘exit’ or ‘dwell’ condition on this geofence as the trigger for any action.

Let’s consider a simple example. Suppose you create a geofence around your retail store. Now there could be three use-cases:

  • Enter- Trigger a notification if user enters the geo-fence
  • Exit- A notification if he exits the geofence
  • Dwell- if he stays in the geofence for certain amount of time. This has an important benefit. Consider this- suppose the radius of your geofence is in few meters. Now, it might happen that a certain user just quickly drives past it. He stays in the geofence for a very brief period so sending them a notification is equivalent to spam. By putting a dwell condition you target only those users who stay for only certain amount of time thereby segmenting your audience further for good and improved targeting.

The above three conditions for trigger can make you think on vast use-cases for your business.


vouchercloud ran a campaign which triggered a push notification like the one below when the user is within 200m of a participating store. It got them a CTR of 45% which is remarkably higher than the industry average or their own best. (source)

What could be the other use-cases?

By creating a barrier on any geographical location you are basically recording the timestamp of entry and exit along with the location data.

So you might not be leveraging this data to push notifications to users in real time but the combination of entry, exit, and location data can help you in myriad ways to create value for users.

For instance, if we have data of the users who have visited Alaska more than thrice in a year then we would have some certainty that there are potential customers for Salmon fishing kit.

Likewise, there are infinite ways to engage users who have visited your area of interest. It can be beyond your competitor’s location, like a retail store, airport, Las Vegas etc.

Examples across industries

  • E-commerceSend city-specific promotions depending on the prominent local events
  • Offline retailTrigger a push notification when the user is the proximity for a considerable time.
  • Taxi serviceSend a nearby cab alert when the user prepares to exit the airport.
  • OTASend offers on the promising nearby hotels when user enters a prime location
  • Ed-techBlock pornography and related content within the campus area
  • Honorary mentionCompanies are using geofence technology to find new hires- NBC News

Mingling geofencing with behavioral targeting

If we limit ourselves to ‘enter’, ‘exit’ and ‘dwell’ conditions as the trigger, then use-case would be something as straightforward as the following:

Trigger a push notification if the user enters the geofence say your retail store.

Now, how about mapping the geo-specific data of the user with his profile data.

The same campaign could be revamped as:

Trigger a push notification if the user enters the geofence built around your store by nudging them with their last purchased category.

So essentially, along with the user’s profile and behavioral data on app and web properties you are also considering the geolocation data to define engagement with your users.

To do that you have to have a system which ingests the behavioral data of the users and simultaneously consumes the geolocation data of the user. Most mobile marketing platforms like WebEngage are capable to do that.


As per this report, geofencing market is pegged to reach $1.8 billion by 2022. Not surprisingly transportation and logistics forms the major part of it. (Uber, Uber, Uber)

A certain district administration in India is planning to use geofencing to curb illegal mining. As in, if the sand is mined beyond the permissible limit then the authorities will be informed.

Proximity marketing has solid opportunities for consumer businesses particularly offline retailers. The only desire is the need to create value for users…..

And a powerful solution that lets you use this technology, like WebEngage (Sign-up for a quick chat)

iImage source: dribbble.com

Boost Mobile Conversion Rates By As Much As 40%

Keep these 6 tips in mind

  • Created: 30 Jan 2018
  • Last Updated: 01 Aug 2019



Ajit Singh Content Marketer, Webengage

Ajit is a Marketing Manager at WebEngage. He is a power user who writes about marketing automation and everything about the customer engagement sphere. He previosuly worked as a Digital Marketing Executive at Zepo.in

Liked our article? Give us your feedback by rating it.
Total Rating : 7 , Average Rating : 4.7

Subscribe to our newsletter to stay updated on the latest in B2C marketing