Start the user on different nodes based on the embedding page
If you have a flow that helps users do multiple different things, you may want to start the user in different parts of it depending on what page of your website they are on when they open the assistant. For example, you might want to start them at the beginning of the flow if they open it from your home page, but start them in the part of the flow about finding spare parts if they open it from your parts directory page.
This can be done by using the special form data key $created-on-page-url
, which is automatically set to the URL of the page on which the assistant was opened.
Define your starting points.
For this example, we will imagine a flow that covers three use cases: troubleshooting, spare parts, and a contact form. The start of the flow might look something like this:
If the user starts from our website's support page, https://example.com/support/
, we'd like them to be taken straight to the "Troubleshooting" section of the flow. If they start from our spare parts directory, https://example.com/parts/
, we'd like them to be taken straight to the "Spare parts" section. And if they start from our contact page, https://example.com/contact/
, we'd like them to be taken straight to the "Contact form" section. Otherwise, we'd like them to start at the beginning of the flow as normal.
Add a Read Data node near the start of the flow.
Read Data nodes allow you to check the value of form data and route the user accordingly. We'll use one to check $created-on-page-url
.
Add one option per starting point.
The Read Data node starts with one editable option. We'll name it "Troubleshooting" and use it for our "Troubleshooting" starting point.
We'll add two other options and name them for our other starting points, "Spare parts" and "Contact".
The "Fallback" option is used if none of the other options apply, so we'll use that for starting at the beginning of the flow if none of the other starting points apply.
$created-on-page-url
.
Set the conditions for each option based on Since we want to direct the user based on the page on which they opened the assistant, for each option's condition, we'll set the Key to $created-on-page-url
.
The exact Condition and Value to use depends on the structure of your website. You'll want to set them to match all relevant pages and no other pages. In our example, we know that if the page URL includes "/support" the user is on our support site, so for the "Troubleshooting" option we'll set the condition to "contains" and the value to "/support". We'll do similarly for the other two options.
If the user comes from a page that doesn't match any of these, such as https://example.com/about-us/
, then the "Fallback" option will apply.
Add a jump for each option and starting point.
If the user is coming from a matching page, we want to take them straight to that part of the flow. So after each non-"Fallback" option, we'll add a jump and name it for that part of the flow.
Then we'll connect each jump's target to the starting node for that part of the flow.
Connect the "Fallback" exit to the flow's normal start point and the Start node to the Read Data node.
This will add the Read Data node in to the very beginning of the flow. Before anything else happens, Mavenoid will check $created-on-page-url
and send the user to the appropriate section of the flow is there is one. Otherwise, it will continue to the normal start of the flow.