Geofencing
Enterprise feature
In this tutorial, you'll learn how to introduce geofencing to your campaigns and reward your customers for being in the right place at the right time. Voucherify makes it easy to keep up with customers on the move thanks to the auto-update segments dynamically reacting to location changes.
You can create location-specific campaigns with redemption limits based on customers, products, and SKUs geolocations:
- Decide which products or SKUs will be discounted or excluded based on their current location
- Limit redemptions to customers who share specific locations
- Exclude particular areas from applying the discount
Contents
- How does it work?
- Campaigns with customer location
- Campaigns with product and SKU location
- How to use the map and draw Locations? (video)
Limited access
The geofencing feature is available only in the Enterprise subscription (on demand).
How does the Locations manager work?
The Locations manager offers a few options to manager your locations.
Navigate to Locations in the Dashboard.
- At the top right corner, the plus sign let's you add a new location
- At the top, you can narrow down your list of locations using filters
- To the right of every location, you can use the tricolon ⁝ to display the following options:
Option Description Show usage Shows which resources are using the location, i.e. which product collections or customer segments use the location. Edit Let's you edit the location name and boundaries. Duplicate Creates a copy of the location and let's you modify the duplicated location's name and boundaries. Delete Deletes the location.
When you are working on a location, you have a few options available:
Icon | Description |
---|---|
Brings back the selected area on the map back into focus. | |
Allows you to add a polygon or circular boundary. | |
Allows you to edit the boundaries. (Edit mode) | |
Let's you delete the boundaries. | |
Zoom in and out of the map. |
Geofence campaign with customer's location
- Create a new Location object to define an area for customers eligible for a discount.
- Add metadata definition with a geopoint type to pass customer's geo-coordinates (latitude and longitude in geo URI format).
- Create a customer segment that gathers customers from the area specified by the Location object.
- When creating a promo campaign, add a segment-based validation rule that limits redemptions to customers from a particular location (customers that entered the customer segment).
Step 1: Define a new Location object
First, you need to define a Location object that defines the boundaries for the allowed customers' locations. Go to the Locations tab in your dashboard.
Step 2: Add metadata representing the customer's location
Expand the standard schemas and choose Customer. Click Add new definition and define a property representing the customer's location. Remember to choose Geopoint as a metadata type. Read more about customer metadata here.
Step 3: Create area-specific customer segment
- Click Find and apply filtering.
- Go to Custom attributes (metadata).
- Choose the metadata property representing customer location.
- Define segment criteria using one of your Locations.
- Confirm with the plus and Apply.
When segment filters are ready, click Apply and save the segment.
The segment will gather all customers who meet its rules and share the matching location. Moreover, with every update of the customer's location, Voucherify will check if he/she still meets segment rules and update the segment accordingly.
Step 4: Create a geofence promo campaign
You can add validation rules when creating a new campaign or prepare them beforehand in a dedicated dashboard section. Read more here.
Redemption
Geofence campaigns with product/SKU location
Similar to customer objects, you can add product metadata of the geopoint type and pass products' locations in API requests. As a result, products from customer's orders can be validated against product-specific rules specifying locations that qualify products for discounts.
- Log in to your dashboard and create a new metadata definition in the Product metadata schema.
- Create a products collection based on the added metadata property (geopoint type).
- When creating validation rules for your campaigns, you can use location-based collections to introduce the following limits:
- Only products from geolocations defined by the collection criteria can be discounted.
- Only if a customer has products from particular geolocations, a discount can be redeemed. You can also specify how many items from a given location the customer needs to buy to make a redemption.
- Exclude products from particular locations from getting a discount.
- Exclude carts with products from particular locations from making a successful redemption.
Step 1: Define a new Location object
First, you need to define a Location object that determines allowed product/SKU locations. Go to the Locations tab in your dashboard.
Click the plus to add a new Location. You can now use the map or the search bar to browse and save the required location/area. After adding a location name and saving your Location, you can re-use it in future campaigns.
Each Location object can be a single location defined by specific coordinates or a multi-coordinate area. You can highlight areas on the map using a radius or polygon tools.
Each polygon is a set of points forming a closed region.
Step 2: Add a metadata property for product/SKU location
Step 3: Create a location-based product collection
Collections group products and their SKUs under predefined criteria. When it comes to geofence campaigns, you need to build a collection that gathers items from a particular Location. Go to the Products menu and choose Find and apply filters.
Go to the Custom attributes (metadata) and choose the geopoint metadata property added previously to the schema.
Now, build collection criteria using the geopoint metadata property and Location object created in the first step.
Click the magnifying glass to display the list of available locations.
You can use filters to narrow down the list of your pre-defined locations.
Once you decide on the location you would like to use for the product, click on the check box next to the location and Select locations.
Confirm with the plus and Apply.
Note that you can add more filters to define the collection criteria. When they are ready, click Apply and Create dynamic collection.
Name the collection and save it. Now, you can use the collection to create location-specific validation rules for your products and SKUs.
Step 4: Create a geofenced promo campaign
You can add validation rules when creating a new campaign or prepare them beforehand in a dedicated dashboard section.
When building campaign rules, you can use location-based collection twofold:
- You can use it to define products that will be discounted or excluded when redeeming a code or promotion. As a result, only products that share a predefined location and match collection rules will be discounted (or excluded from getting the discount). Go here for the detailed instructions.
-
You can also define the required cart structure. It means that products or SKUs located in a particular area need to be in the cart to make a successful redemption. On top of that, you can set additional criteria for matching items, like items count and subtotal.
To create order structure validation rules with product collections, expand Products structure validation rules.
Decide if every, any, or none of the order line items needs to match the collection criteria (be in a particular location). Mark the respective checkbox.
Click Add and choose the area-specific product collection.
If you chose Every or any order item matches, you can also define the quantity and subtotal of matching items.
Validation rules
Go here to learn more about Rules Builder and product-specific validation rules.
Redemption
"metadata": { "product_location": "geo:37.786971,-122.399677" }
Redemption Endpoints
Read more about redemption endpoints in our API Reference Guide.
How to use the map and draw Locations?
Watch this short video to learn how to use the map in the Locations menu and define new geofences for your campaigns.