Configuration
Last updated:
How to use existing data from your website in your flow
When you already have data available on your website that you want to use in your flow, you can send this data to Qonfi by setting them in window.qonfiVariables in JavaScript.
Once you've set your data inwindow.qonfiVariables, you can use this data as variables in your flow. For example, if we already know a user has certain allergies, we don't want to match any products that contain ingredients the user is allergic to.
Example 1: Use known customer from your website data in your flow
1. Add an if/else node to collect variables.

Edit the answer of the if/else node and set the variables to the variables provided in window.qonfiVariables.

2. Add if/else nodes with conditions based on the allergy variable.
In this example, we want to check for both nuts and soja allergies.

For each if/else node, add the correct conditions to the answers. For example, for the "Nuts allergy: Yes" answer, we want to add a condition where we check if "Variable allergies -> contains -> nuts".

3. Add the matching rules to the if/else node answers.
In the "Matching" section, add the correct matching rules to the if/else node answers so we filter out any products that contain ingredients with the users' allergies.

Tip:The above example shows how we can use website data to match products. However, you can also use these variables to skip questions, do calculations etc.
Example 2: Starting your flow at a specific step based on an URL path
You can start your Qonfi flow at a specific step based on the URL path of the page where the flow is embedded.
This is useful when you have different entry points to the same flow. For example, you could send users directly to a specific step when they visit /car-parts/headlights/halogen, /car-parts/headlights/led, or another URL path.
You can use the URL path to set a variable in window.qonfiVariables, and then use that variable in your flow to determine where the user should start.
1. Set the URL path in window.qonfiVariables
On your website, read the current URL path and pass it to Qonfi using window.qonfiVariables. For example:
If the user visits: https://example.com/car-parts/headlights/led the start_path variable will contain: /car-parts/headlights/led.
2. Add an if/else node to check the starting path
Add an if/else node at the beginning of your flow to collect the website variables.

Click the answer and switch to the variables tab and define the variables you want to collect.

Next, add another if/else node to see if we already know the headlight type. Create an answer for each URL path that should start the flow at a different step.
For example:
Headlights/LED → Start the headlights-LED-related questions
Headlights/Halogen → Start the headlights-halogen-related questions
Unknown → Start the flow from the beginning

Edit the answers of the if/else node and add conditions based on the start_path variable.

This allows the flow to determine which path the user should take based on the URL they entered from.
Summary
As you can see in the screenshot below, we collect the variables, determine the entry point for a user in the "Headlights type from website" step and if this is still unknown (for example the user just entered the flow from the /car-parts/headlights path), the user will simply start with the "Headlights type" question.

Was this article helpful?
Yes
No

