What is a geofence?
A geofence is a virtual fence or a perimeter around a physical location. Geofencing is a tool to connect the virtual experience with the offline world’s physical location. When an object enters this area, something happens. Easy way to think about it a fence around your home. When someone enters your yard, the burglar alarm is activated. What should happen in such circumstance? You probably want to send an alarm to the security company? Send an SMS to you? Start the burglar alarm?
Typically the geofencing use cases are not that brutal. Geofencing is a term that can be used in many different contexts, but the most popular one is the ability to detect a phone entering the area, and triggering something either in the device itself – or somewhere externally. For example, when you walk past your favourite grocery store, you get a discount coupon. This mobile-based geofencing is also the use case this blog post is focusing on. Geofencing does not require you to build anything physical in the real world – it all happens digitally. In essence you draw an area on top of map and define in your code what you want to happen, when someone walks into that area. That being said, in some cases you might want to add some hardware in the real world to improve the positioning accuracy, but more of that later on in the post.
How does geofencing work?
Typically geofencing is thought as something that only works outdoors, utilizing GPS technology. But actually, you can use it with any technology. Depending on your use case and the accuracy you need for it, you could utilize a range of positioning technologies, such as: Wi-fi, GPS, cellular data, geomagnetic and Bluetooth beacons. What technology or technologies to use, depends a lot on where the geofencing will happen. In outdoors for larger geofences you could get good results with cellular and WiFi data, which gives better battery efficiency than GPS. Indoors you would need WiFi, Bluetooth or geomagnetic information to bring the fine-detailed accuracy required for entrance events to small geofences.
The great thing about geofences is that you can define them anywhere you want. Around your store, around your city, around your partners’ locations – and even around your competitors’ locations. GPS, cellular and WiFi data are available aplenty from Google and Apple databases (so-called native positioning), which means that you don’t have to do any mapping work yourself.
Geofencing works the same way anywhere you are, is it indoors or outdoors. The basic principal is that you define the areas that you are interested in, start listening to the phone’s position updates and compare those to the geofences. The great thing is that you do not need to hard-code this into your application, but there are some great platforms that handle all of this for you. Advertising warning: Proximi.io platform is one of them – a geofencing platform built with API-first principles for heavy users.
What does it require?
An app – very important to note that geofences for 99,9% of the use cases cannot be used without an app. There are some minor exceptions, but most likely, if you are reading this blog post, you will need an application – whether your own or through a partner – that can be utilized for this purpose. This application needs to be installed by all of those people, whom you want to detect entering or exiting your store.
Location permission – In order to receive position updates, the application needs to have a permission for utilizing the user’s location. This is a user-selectable option, which makes it important to provide a good explanation for the user of the benefits they will get of enabling their location.
On Android you can select between coarse location (approximate location) that only utilizes cell tower and WiFi access point data for determining position; and fine location (precise location) that uses a combination of the above and GPS data to determine the position. More on the Android development documentation.
On iOS you can select between when-in-use or always access permission. If you want your geofencing to function in the background, the second option is required. More information can be found in the iOS developer documentation. As you will probably also be interested in triggering geofences, when the app is not currently in use, remember to plan a workaround for that for both platforms.
What are the limitations?
Indoor setup – In case you are interested in detecting small geofences indoors, you will need a bit of preparatory work in the venue. You will need to either have those areas mapped for WiFi or geomagnetic coverage, or Bluetooth beacons installed. If you use Bluetooth beacons, remember to also ask for permissions for Bluetooth.
Background functionality – Geofencing in the background is crucial to many projects, people generally don’t walk with their phone or apps open all the time. Background functionality differs with Android and iOS, but both have options to achieve the desired geofencing capabilities – you can see our blog post on “Will my geofencing function in the background” for more details.
Size – The size of a geofence typically raises some questions, how small can I go – or what is the maximum size of the geofence. There is no limit to how big a geofence is. You could even geofence the entire Earth, but then you could just send the same notification to all the app users in bulk, regardless of their position. Geofencing entire countries, cities or neighborhoods is a perfectly valid use case.
The minimum size depends on the technologies utilized, and also a bit on the physical location and the accuracy of GPS/WiFi data there. If you are just using native positioning, a good way to test the minimum size possible for your geofence by walking around in the area and look at the positioning accuracy in Google or Apple Maps. That is the same native positioning data as your application will be utilizing. In some locations the minimum recommended radius could be 20-50 metres, sometimes you could go over lower. In no circumstance you should go under 5 metres radius with native positioning, as the ability to trigger it comes unstable. When beacons or other indoor positioning setup are added in the picture, you could go as low as 2 meters. This size would ensure there is no unnecessary bouncing in and out of the geofence. A common use case like geofencing different rooms, is quite nicely achievable.
Shape – A standard geofence is circular in shape, but polygon shape geofences are also possible to create. There are some limitations to what shape is recommended – for example when you want to add a geofence around a single beacon, circle is the optimal shape. It is also worth noting that the calculating that is required for detecting polygonal geofences is much heavier, so it will not be as fast or reliable as with circular shapes.
Amount – Both Android and iOS native SDK’s offer a method for hard-coding geofences into an app. The limitation for iOS SDK is maximum 20 different geofences or regions that the application can detect. The same applies for Android, but the limit for geofence amount is 100 geofences. Using an external geofencing platform is one easy way to go over this limit. The Proximi.io platform has built-in automation for rolling the geofences the app is listening to at any one point, making it possible to listen to an endless amount of geofences.
Battery consumption – When building your application, you will need to plan for a careful balance between the accuracy, background functionality and battery consumption. Unavoidably, the battery consumption in your app will increase a bit when you activate location services, but with well-designed positioning stack the increase will not be disturbing to your app users.
How to use geofences?
How are geofences then used? In summary, there are five main things that you can do, when a geofence enter event is detected:
- Send a push notification
- Display visual content and media in the app
- Gather analytics (in the background)
- Verify entry/exit
- Trigger something in a 3rd party API
Here are some potential use cases in real life:
- Send a lunch offer, when you walk by a restaurant around midday
- Display information about museum items, when you walk in the exhibition
- Calculating how many students are in a classroom
- Collect points by visiting different stores
- Check if the meeting room is empty
- Turn on lights, when you enter a room
Check out our case studies for more inspiration!
Get started with geofencing!
Imagination is the limit of how what you can do with geofences. A fast, scalable and flexible way to get started is the Proximi.io platform.
What’s the benefit of using our platform:
- Unlimited amount of geofences, size and shape
- ability to edit the geofences on-the-fly and getting over the native amount limitations
- analytics – visiting amounts, visiting frequency, dwell times and heat maps
- Ability to choose one or multiple technologies all in combination
If you want to share some ideas and toss them around, we are always up for a brainstorming session: https://proximi.io/contact-us/
Hi there, i need to show push notification when ever user enter particular shop or location. how is possible with you demo (proximi.io) is there any demo is also for that please help
Hi! We do have a demo app on App Store and Play Store that you can use for testing (search for “Proximi.io Management App”). However, that application is only meant for testing your setup, and it is not really practical for any real-life use cases. We always recommend developing your own application on top of our framework. We have also some great partners that do affordable mobile application development. If you send us an email at firstname.lastname@example.org and describe your idea a bit more, I can give you some more hints on how to move forward.
So how can I use polygon geofencing with Google AdWords or Facebook?
Hi Dave, our platform is not linked to Google or Facebook in any way. In order to use geofences, you need to have your own mobile application that is downloaded by your target audience.
Have you figured out how to use geofencing with facebook and google adwords? i am interested in that too.
can you send me a link to the geo fence app
We don’t have a general geofencing app, but the idea is that our library will be integrated into your own app. If you don’t have a mobile app already, we can connect you with some of our partners, who can help you create one.
is there a fee each month
Yes, our product is licensed as Software as a Service, so you pay a small monthly fee for the technology and our support for using it.
Tell me please how much is that fee? Thanks
The price depends on the number of end users your app has. The prices start from 350€/month. More details here: https://proximi.io/pricing/
Please I need more Infor I work in a mining company .
I emailed you directly!
Can geo be used without an app ? Can I setup a fence and it alert me of the number of who enter into the fence? Can it be integrated into an existing app? Also, who provides geo fencing setup services?
Hi Maurice, Geofencing always needs to be connected to an app. It can be an existing application, but it must be one you own, as you need to integrate geofencing library into its source code. From privacy and security perspective, it is not possible to collect phone numbers of random people, who enter into a geofence. If you have your own application that requires registration and collects phone numbers of users, you could technically get this kind of data. But you need to be very careful in order to respect privacy regulations in this kind of use cases.
Can we add different geo fencing location at the same time in same application?
Yes, you can have as many geofences as needed all around the world in your project.