Skip to main content
Use geotargeting

The Geotargeting module’s features can be used across a range of other Fresh Relevance platform areas.

Updated over 5 months ago

Before you start

Things you need to know:

  • By default, a person's location is defined by their IP address, however, we strongly recommend the use of CRM data if available. We also advise that you configure your account to use an imported customer location, as this is more accurate.


Set a preferred location data source

To define the preferred location data source:

  1. Expand the User menu and go to Settings > System Configuration.

  2. Select Location Preference.

  3. Expand the Preferred Source drop-down menu and select from:

    • Imported Person Location

    • Last Web Session Location

    • Current Location


Create a location set

To make the best use of geotargeting features, we advise that you create a location set that corresponds with key locations for your business, for example, your store locations, your operational regions, and so on.

To create and mange your location sets:

  1. Expand the User menu and go to Settings > Imports.

  2. Select Locations.

Create a new location set

  1. Select NEW LOCATION SET in the top left of the Locations page.

  2. Select either:

    • Create Empty Set
      or

    • Copy Current Set
      This creates a new location set with a unique ID and copies over all locations, exactly as they are, from the location set currently displayed.

  3. Select the Edit icon at the top of the left side panel to enter a name for your new location set.
    The name is used in Trigger rules, Slot rules, Segment rules, and SmartBlocks to allow you to select which location set you want to use in each.


Add locations to a location set

Locations can only be added to custom location set, not to the predefined location sets.

Locations can be added to a location set in two ways:

  • Individually

    1. Select NEW LOCATION.

    2. Add the details of your new location.

    3. Select the correct area of the map to place the location pin.

  • In bulk through a JSON or CSV import

Bulk imports from JSON or CSV

To bulk import locations to a location set

  1. Select IMPORT LOCATIONS (JSON/CSV).

  2. JSON and CSV templates are provided below the input area. Select the JSON or CSV link to download the template you want to use.

    Each of the templates includes an example location that demonstrates what type of values should go into each field. You can replace the example location and add additional locations as required.

  3. Once your JSON or CSV data set is ready, paste the plain text of those data sets into the input box.

  4. Select either:

    1. REPLACE ALL LOCATIONS to delete all locations in the current location set, then import from the provided JSON or CSV formatted plain text.

    2. ADD TO LOCATIONS to append the import to the locations in the current location set.
      If the the import contains a location ID that’s already in use, the import fails, and an error message is displayed.

GeoJSON

When importing JSON, you’re able to add GeoJSON shapes and points to your location. You can specify the following GeoJSON objects to the corresponding field:

Key

Object Type

location

GeoJSON Point Object

shape

GeoJSON Polygon Object

Example template with shape and location fields populated by GeoJSON:

You can also download this template from below the location input field on the Locations page.

              [
{
"id":"example",
"name":"Example Location",
"type":"store",
"latitude":51.5017152,
"longitude":-0.1420019,
"country_code":"GB",
"postcode":"SW1 1AA",
"images":{
"example1":"https://upload.wikimedia.org/wikipedia/commons/1/13/Buckingham_Palace_from_gardens%2C_London%2C_UK_-_Diliff_%28cropped%29.jpg", "example2":"https://upload.wikimedia.org/wikipedia/commons/c/c7/Victoria_Memorial_from_within_Buckingham_Palace.jpg"
},
"shape":{
"type":"Polygon",
"coordinates":[
[
[
-0.130548,
51.486904
],
[
-0.124712,
51.492677
],
[
-0.122395,
51.507642
],
[
-0.150976,
51.504276
],
[
-0.15398,
51.485032
],
[
-0.139217,
51.484658
],
[
-0.130548,
51.486904
]
]
]
},
"location":{
"type":"Point",
"coordinates":[
-0.1420019,
51.5017152
]
}
}
]

Edit a location

  1. Hover over the location in the list in the left side panel, then select the Edit icon.

  2. Edit the details you want to change. You can amend location name, ID, icon, point and region, and add extra fields and images.

You must take care when changing location IDs, as this could break any existing rule or product recommendation configurations using that location. These need to be updated manually to account for the change.

Images against a location

Location image URLs can dynamically include other parts of their configuration, including the location ID and extra fields, using Jinja2 template tags.

For example, a location with ID london and image URL https://example.test/{{ id }}.jpg requests an image at https://example.test/london.jpg when used in a SmartBlock.

Extra fields can be accessed with extra. followed by the desired key, for example:

https://example.test/{{ extra.store_id }}.jpg.

Extra field keys that contain a space can be accessed like this: https://example.test/{{ extra['store id'] }}.jpg.

Accessible location data

Key

Description

{{ name }}

Location Name

{{ id }}

Location ID

{{ type }}

Location Type/Icon

{{ extra.map_id }}

{{ extra['map_id'] }}

Location Extra Field

Delete location sets and locations

  1. In the left side panel, hover over the location or location set you want to delete.

  2. Select the Delete icon.

  3. A confirmation message is displayed. Select YES.

Export a location set

Custom location sets can be exported as JSON.

Predefined location sets can’t be exported.

To do this:

  1. Expand the drop-down menu in the top left and select the location set you want to export.

  2. Select Export set.


Use location sets in Trigger, Slot, and Segment rules

You can configure Trigger, Slot, and Segment rules to make decisions based on the person's location against a single location set.

When editing the rules for your Trigger, Slot, or Segment, expand the Location section and drag the Location Set Targeting rule on to your decision tree.

Learn more about using rules in Use marketing rules.

The rule can be configured to send emails or display content only to people within a certain distance from a location point or within a specific location region.

For example, you might want to:

  • Display an offer to people within a region or certain distance of a store.

  • Send an email to people located within a region or certain distance of a store.

  • Display nearest store details to those that are within a certain distance of a store, and other content to everyone outside of this distance, or who doesn’t have a local store.

Configure the rule

  1. Once you’ve added the rule to your decision tree, select the rule to configure it.

  2. Select the Location Set you want to use.

  3. If your location set contains location points, you can specify a distance within which the person should match. You can specify distance in either miles or kilometres.
    This option is not available for location sets containing location regions.

  4. Choose either:

    • Any location - matches if the person is within the specified distance or region of any of the locations defined within the location set.

    • Specifically - allows you to select which locations within your location set you want to match against. Matches if the person is within the specified distance or region of any of the selected locations.

Once you have this configured, the rule operates the same way as other marketing rules; if the person matches the criteria, they’re shown the content in the Yes branch, otherwise, the No branch.


Use location sets in Recommendations SmartBlocks

If you have uploaded location data with your products, then when using a Product Recommendation SmartBlock you can add a filter that enables you to display products:

  • That are at the nearest location to the person

  • That are at selected locations

For example, you could:

  • Only display products that are located at the nearest store to a person

  • Only display products that are available in the person’s area

The Location filter can be combined with any of the existing filters in the Product Recommendation SmartBlock.

Configure the filter

  1. While editing your SmartBlock, select the Location tab.
    You might need to expand the three dots menu in the right corner of the left hand panel.

  2. Set the Geocode by IP switch to on.

  3. Expand the Location Set drop-down menu and select the location set you want to use.

  4. Enter the maximum radius the system should look within to find the closest matching location to the person.

  5. Select the Filtering tab. Under Product, drag the Location block on to your decision tree.

  6. Expand the Option drop-down menu and select if you want to display products at the closest location to the person or at specific locations only.
    You can use the Fine-grained control of filters in fallbacks option if you need to remove the filter from fallback configurations.


Use the Nearest Store SmartBlock

You can create a Banner SmartBlock that displays details of a person's nearest store.

You could combine the Nearest Store SmartBlock with the Location Set Targeting Slot rule to display the nearest store details to those within a certain distance of a store, and different content to those that are outside of the distance.

Configure the Nearest Store SmartBlock

  1. For Tactic, select Geotargeting.

  2. For Layout, select Nearest Store.

  3. Give you SmartBlock a name, and, optionally, select a folder to store it in.

  4. Edit the design, links and properties of your SmartBlock as you want them.

  5. Select the Location tab.

  6. Set the Geocode by IP switch to on.

  7. Expand the Location Set drop-down menu and select the location set you want to use.

  8. Enter the maximum radius the system should look within to find the closest matching location to the person.

  9. Select SAVE.

Did this answer your question?