Skip to main content

Use Cases for the LoyJoy Product Database

LoyJoy's product database is a powerful tool that can be used in various ways that go beyond just managing products. Here are some general use cases:

  • Product Recommendation: This is the most basic use case. Use the product database to provide personalized product recommendations based on user input or preferences.
  • Location Search: Upload your store locations to the product database and use it to help users find the nearest store based on e.g. zip code, location, or other parameter.
  • Contact Search: Use the product database to store and search for contact information, such as customer service numbers or email addresses. You can let users search for contacts based on their needs or criteria such as department, product, or service.

In general, the LoyJoy product database can be used to store and manage any type of data that you want to make searchable and accessible to users. This can include product information, contact details, location data, or any other type of structured data that you want to provide to your users in a user-friendly way. The product database is flexible and can store any data fields you need, making it a versatile tool for many different use cases.

To use the product database for location search, you can follow these steps:

1. Upload your store locations

You can upload your store locations to the product database using the LoyJoy backend. Each store location should have a unique identifier, such as a store ID, and relevant information such as address, phone number, and opening hours.

2. Search for Locations

There are various ways to search for locations in the product database, for example:

  • Ask the user to enter a city or zip code
  • Set a variable in the chat agent to determine which location should be displayed
  • Extract the location from the user's input using a GPT module

All these methods function similarly: A variable is set to narrow down the search criteria, and the product database is queried using this variable.

3. Display the Results

Once the search is performed, you can display the results using the Product Feed module. To do this, you need to add a Product database connector to the module and add an SQL query that uses the variable set in the previous step to filter the results. For example, if you set a variable location to the user's input, you can use the following SQL query:

SELECT * FROM products WHERE city LIKE '%${location}%' OR zip_code LIKE '%${location}%';

Example: Show a Different Store Location on Each Landing Page

To show a different store location on each landing page, you can pass a landing page parameter to the chat agent, which is then used to set the location variable. This way, you can display the store location that is relevant to the landing page.

To transfer the landing page parameter to the chat agent, you can use a query parameter in the integration script, such as ?location=10123. In the chat agent, you can then use a Add variable module to set the location variable based on the query parameter:

Set Variable

When the location variable is set, you can use the Product Feed module to display the store location based on the location variable. The SQL query in the Product Feed module can then be adjusted to filter the results based on the location variable, as shown in the previous example.

SELECT * FROM products WHERE location_id = '${location}';