Creating Customer Promotions Based on Customer Location

You can determine a customer IP address and lookup the geographical location of the customer based on the IP address. If you create a dynamic customer group based on location, you can customize the promotions and storefront experience for the customer based on their general geographical location.

Salesforce B2C Commerce provides an IP geolocation database from MaxMind that is shared by all of your instances. The database is updated as needed with the global releases.
Note: Information from the database can't be exported. Use the geolocation import/export schema only for the store geolocation database, which isn't based on IP address information.

Testing Rule Data

If you are using customer groups that depend on city or region, Salesforce recommends that you test sample IP addresses against the database before creating rules. This is because if the database is less precise in location than you expect, it is possible to create customer group rules that don't trigger correctly. Make sure that you have permissions to the IP Address Geolocation Data module before starting this topic.

  1. Select Administration > Operations > IP Address Geolocation Data.
  2. On the IP Address Geolocation Data page, enter an IP address and click Find.

    The City, Region, Country, Postal Code, Metro Code, Latitude, and Longitude for the IP address in the database display. Note any discrepancies with the results you expect and use this when creating the customer group membership rules.

Creating Geographical Customer Groups

You can use rules to define customer groups by the geolocation data of the IP addresses of customers when they log in.

  1. Select site > Customers > Customer Groups.
  2. On the Manage Customer Groups page, click New to create a new customer group.
  3. On the New Customer Groups page, enter the (mandatory) ID (for example, USA_NY_Customers).
  4. For Type, select Dynamic. Geolocation information for a customer exists in the session, but is not stored in B2C Commerce, so geographical customer groups are never static.
  5. Enter a description (for example, New York Customers) and click Apply. The Membership Rule field appears.
  6. Click Edit.
  7. In the Customer Group Include/Exclude window, click in the Attributes field. See Dynamic Customer Group Attributes for details on the available rules.
  8. Create a rule that uses the geolocation attributes. If you want to test the customer group, be sure to include a group with your current location, so you can log in and test the feature.

Creating a Promotion Based on a Customer Group

You can create a promotion that uses a customer group as a qualifier. See Creating a Campaign and Creating a Promotion to learn how to assign a customer group to a campaign or promotion.

Note: For information on customizing the storefront experience, Using Dynamic Customer Groups for Active Merchandising. Customers do not have to be logged in to determine their IP address and use it to determine a geographical location.

Testing Customer Groups

If you want to test the customer group in your website, make sure to include a group with your current location, so you can log in to the storefront and test the feature. You can use the storefront toolkit Site Preview Tool to test the customer groups you create.