Enterprise featureGeofencing is available only for Enterprise clients. Contact your technical account manager or Voucherify support to enable it.
- Limit redemptions to customers in specific locations
- Discount or exclude products based on their location
- Exclude particular areas from applying discounts
What geofencing does and doesn’t do
Geofencing doesn’t track location automatically. Voucherify checks locations only when coordinates are sent in the API request (for example, during voucher redemption). You have to:- Create location boundaries in the dashboard
- Store coordinates in metadata (customer, product, or SKU)
- Send the current coordinates in the request
How geofencing works
Geofencing works by comparing coordinates you send with locations you define. It uses three elements:- Location objects: areas you draw on a map (circles or polygons)
- Geopoint metadata: latitude and longitude saved on customers, products, or SKUs
- Segments or collections: groups created by checking whether coordinates fall inside a location
Choose what you want to control
You can use geofencing in two independent ways:- Customer location: controls who can redeem.
- Product or SKU location: controls which items are discounted, required, or excluded.
Manage locations
Go to Campaign hub > Locations in the dashboard to create and manage location objects.Create a location
Create a new location as follows.Find your target area
Use the map or search bar to navigate to the area where you want to create a location.
Define boundaries
Draw the location boundaries using one of two options:
- Circle: Set a center point and radius.
- Polygon: Draw a custom shape by placing points on the map.
| Control | Description |
|---|---|
| Re-center | Brings the selected location back into focus on the map |
| Draw polygon | Draws a custom polygon boundary by placing points on the map |
| Draw circle | Draws a circular boundary using a center point and radius |
| Edit boundaries | Enables edit mode to adjust existing boundaries |
| Delete boundaries | Removes selected boundaries from the location |
| Zoom in / out | Zooms the map in or out |
Location manager options
When managing an already created location, you can use the tricolon ⁝ to display the following options:| Option | Description |
|---|---|
| Show usage | Shows which resources use the location (product collections, customer segments) |
| Edit | Modify the location name or boundaries |
| Duplicate | Create a copy of the location |
| Delete | Remove the location |
Geofencing with customer location
Customer geofencing limits who is allowed to redeem a campaign.Create customer geopoint metadata
Go to Project settings > Metadata schema > Customer and create a new metadata definition:
- Type: Geopoint
- Name: for example
customer_location
geo:latitude,longitude format.Create a location-based customer segment
Create a segment as follows:
- Go to Customers > Find and apply filters.
- Select Custom attributes (metadata).
- Choose the geopoint metadata property.
- Select a Location object as the filter value.
- Confirm and select Apply.
Add a validation rule
Add a validation rule as follows:
- Create or edit a campaign.
- In the validation rule builder, add a condition based on Customer segment.
- Select the location-based segment.
- Save the rule.
Geofencing with product or SKU location
Product and SKU geofencing controls which items are eligible for discounts or required in the cart. Product and SKU geofencing works the same way:- Use Product metadata if the location applies to the whole product.
- Use SKU metadata if different SKUs have different locations.
Create product or SKU geopoint metadata
Create metadata schema as follows:
- Go to Project settings > Metadata schema.
- Select Product or SKU.
- Create a metadata definition:
- Type: Geopoint
- Name: for example
product_location
Create a location-based product collection
Create a new collection as follows
- Go to Products > Find and apply filters.
- Select Custom attributes (metadata).
- Choose the geopoint metadata property.
- Select a Location object.
- Confirm and select Apply.
- Select Create dynamic collection and save it.
Use the collection in validation rules
You can use location-based collections to:
- Discount or exclude products from specific locations.
- Require products from a specific location to be in the cart.
- Any: at least one item must be from this location (most common)
- Every: all items must be from this location
- None: no items can be in this location
- Minimum quantity of matching items
- Minimum subtotal of matching items
Troubleshooting
If geofencing doesn’t work, check the following:- A geopoint metadata field exists (customer, product, or SKU)
- Coordinates are sent in the request using geo:latitude,longitude
- The coordinates are inside the location boundaries
- The correct segment or collection is used in validation rules
- Validation rules are enabled in the campaign
Related features
Geofencing connects customer data, product data, and campaign rules. Use the resources below to set up the required elements and integrate geofencing into your workflows.Customer segments
Customer segments
Apart from using customer segments to group customers by location, you can create even more complex scenarios. Create a segment based on geopoint metadata and a location object and other customer attributes, then use them together in validation rules to control who can redeem.Read the Customer segments guide to learn more.
Product collections
Product collections
Apart from using product collections to group products or SKUs by location, you can create even more complex scenarios. Create a dynamic collection based on geopoint metadata and a location object and other product or SKU attributes, then use them together in validation rules to control which items are eligible.Read the Product collections guide to learn more.
Validation rules
Validation rules
Apart from using validation rules to apply location-based segments and collections to your campaigns, you can create even more complex scenarios. You can require customers from a specific segment, check whether order items belong to a location-based collection, and limit to a specific cart structure and safeguard your campaign budget with other conditions.Read the Create validation rules guide to learn more.
Metadata
Metadata
Geofencing uses geopoint metadata to store and send coordinates. You need to define geopoint metadata fields on customers, products, or SKUs before using geofencing.Read the Metadata guide to learn more.
Developer setup: Geofencing API
Developer setup: Geofencing API
Developers need to send location coordinates in API requests for geofencing to work. The key integration points are:
- Validations: Check eligibility before redemption using the Validate Stacked Discounts endpoint with location metadata included.
- Redemptions: Send customer or product geopoint metadata in the Redeem Stacked Discounts request body to trigger location-based validation.
- Customers: Manage customer profiles and metadata using the Customers API.
- Metadata schemas: List metadata schemas for geopoint metadata fields using the Metadata Schemas API.
- Locations: View location objects using the Location Object reference.
- Segments: Manage location-based segments using the Segments API.
- Product collections: Manage location-based collections using the Product Collections API.

