
Creating a virtual perimeter in geofence targeted advertising involves defining a specific geographic boundary within which user actions—like ad delivery—are triggered. The process of creating and managing these virtual perimeters (or geofences) is highly technical and involves multiple layers of technology, including mapping coordinates, utilizing various geolocation technologies (such as GPS, Wi-Fi, and Bluetooth), and integrating software for real-time decision-making. Below is a step-by-step, in-depth look at how a geofence is technically created and maintained.
1. Defining the Geofence: Geospatial Mapping and Geometry
At the core of geofencing is the creation of a virtual boundary, which is represented as a geometric shape overlaid on a map. This shape defines the geographic area where location-based triggers will activate. Typically, two main methods are used to define this boundary:
a) Circular Geofence:
- The simplest geofence is a circle defined by:
- A center point represented as a pair of geographic coordinates (latitude and longitude).
- A radius that specifies how far from the center the geofence extends (e.g., 500 meters or 2 kilometers).
- This type of geofence is defined mathematically by calculating the distance between a user’s current location and the center point. If the user’s location falls within the specified radius, they are considered “inside” the geofence.
Technical Example:
- Let’s say you want to create a geofence around a coffee shop. The latitude and longitude of the shop’s center are (40.7128, -74.0060), and you choose a radius of 500 meters. The geofence is mathematically defined by the haversine formula or similar distance-calculating algorithms that compute the user’s proximity to the center point.
b) Polygonal Geofence:
- For more complex geographic areas, geofences can be created using polygons, which consist of multiple latitude and longitude points (vertices) that form an irregular shape. This allows advertisers to target areas that don’t fit into a perfect circle, such as an airport terminal, a shopping mall, or a specific region of a city.
- A polygon geofence is defined by a series of vertex points connected by straight lines to form the boundary. The user’s location is compared against these vertex points, and algorithms are used to determine if they fall inside or outside the polygon.
Technical Example:
- If you want to create a geofence around a sports stadium, you would select multiple latitude and longitude points corresponding to the stadium’s perimeter. The system then computes whether a user’s coordinates fall inside or outside this polygon using algorithms such as ray-casting or winding numbers (both methods for determining whether a point is inside a polygon).
2. Location Tracking Technologies:
To determine whether a user is inside the geofence, multiple technologies are used to continuously track their location. The choice of technology affects the accuracy and performance of geofence targeting. The major technologies include:
a) GPS (Global Positioning System):
- GPS is one of the most accurate methods for determining a device’s location, typically with an accuracy of 5-10 meters outdoors.
- Smartphones equipped with GPS receivers obtain signals from a network of satellites orbiting the Earth. The device calculates its position by measuring the time it takes for GPS signals to travel from multiple satellites to the phone.
- The phone continuously updates its coordinates, which are sent to the geofencing system to check if the user is within the virtual boundary.
Technical Challenges:
- GPS accuracy decreases in indoor environments (e.g., buildings, malls) or in dense urban areas (urban canyons) due to signal obstructions by tall structures.
- Battery consumption can be an issue for devices using constant GPS tracking.
b) Wi-Fi Triangulation:
- When GPS is unavailable or less reliable (indoors), Wi-Fi triangulation is used as an alternative. This method leverages the known locations of nearby Wi-Fi routers or access points.
- The device scans for Wi-Fi signals and measures the signal strength from multiple routers. Based on the signal strength and the known locations of the routers (often stored in databases like Google’s Wi-Fi network map), the device’s location is estimated through triangulation.
Technical Advantages:
- Works well indoors where GPS signals are weak or unavailable.
- Consumes less power than GPS, making it more battery-efficient.
c) Cellular Triangulation:
- When neither GPS nor Wi-Fi is available, cellular networks provide an alternative for geofencing. The device measures the signal strength from nearby cell towers, and the system triangulates the device’s position based on the locations of those towers.
- Cellular triangulation is less precise than GPS and Wi-Fi, with accuracies typically ranging from 100 meters to several kilometers depending on the density of the cell towers.
d) Bluetooth Beacons (BLE):
- For micro-geofencing within very small areas (e.g., inside a store or a specific aisle), Bluetooth Low Energy (BLE) beacons can be used.
- BLE beacons are small devices placed in physical locations that transmit low-energy Bluetooth signals. A smartphone can detect these signals if it is within a range of typically 1-30 meters.
- Beacons are ideal for indoor geofencing with high precision, such as tracking movement within a retail store.
Technical Example:
- A supermarket installs BLE beacons near the entrance and in various aisles. When a user’s smartphone (with Bluetooth enabled) detects the signal from a beacon, the geofencing system identifies the user’s location as inside the store and triggers location-based ads or notifications.
3. Geofence Creation and Management in Software:
The geofence itself is created and managed through software platforms and APIs (Application Programming Interfaces) that interact with the location services on a user’s device. These platforms include:
a) Geofencing APIs (e.g., Google Maps API, Apple Core Location Framework):
- Most mobile platforms (Android and iOS) provide native geofencing APIs that developers can use to set up geofences in their apps.
- These APIs allow the app to define the geographic coordinates and the radius or polygon vertices that make up the geofence. They also handle real-time monitoring of users’ locations, notifying the app when users enter or exit the geofence.
b) Geofencing Platforms (SaaS):
- SaaS platforms like Reveal Mobile, GroundTruth, Shared Audiences, or Foursquare’s Pinpoint offer geofencing as a service. These platforms typically provide a user interface (UI) for creating and managing geofences, as well as detailed analytics for tracking campaign performance.
- Advertisers can use these platforms to draw geofences on a map (similar to using a digital mapping tool) by specifying the coordinates or using a polygon-drawing tool.
- These platforms typically provide integration with ad exchanges, allowing advertisers to set up real-time bidding (RTB) for ad placements triggered by geofence events.
4. Triggering Geofence Events:
Once the geofence is defined and the user’s location is tracked in real-time, events are triggered when the user enters or exits the geofence.
a) On-Device Monitoring:
- Modern smartphones handle a large part of geofencing processing on-device, which reduces the need for continuous data transmission to the cloud and preserves battery life.
- The device’s operating system continuously monitors the user’s location against the predefined geofences. When the user crosses a boundary (either entering or exiting the geofence), the device generates a geofence event.
- In Android, this is handled by the LocationManager or FusedLocationProvider, which continuously checks location updates and triggers the app when a boundary is crossed.
- In iOS, the Core Location framework performs similar functions, waking up the app or sending push notifications when geofence events occur.
b) Cloud-Based Geofence Monitoring:
- In some advanced cases, cloud-based geofencing is employed. Here, the user’s location is sent to the cloud periodically, and geofence processing occurs on a server rather than the device itself.
- This method is useful for apps with complex or large numbers of geofences, as offloading processing to the cloud reduces the computational burden on the device.
5. Integration with Advertising Networks:
Once a geofence event (entry or exit) is triggered, the system communicates with ad servers or programmatic advertising platforms to deliver the targeted ads. The process includes:
a) Real-Time Bidding (RTB):
- In programmatic advertising, the geofence event triggers an ad request. This request is sent to ad exchanges, where advertisers bid in real-time for the opportunity to display their ads to the user.
- Bid requests include metadata about the user’s location, device, and potentially other contextual information (e.g., time of day, nearby landmarks), which allows advertisers to tailor their bids accordingly.