Content:
- Overview and Things to Note
- Configuring Your Form
- Adding Your Hidden Field
- Configuring Your Form Page
- Creating Your Router Graph
- Setting Your Trigger Node Name
- Adding Your Field Mappings
- Configuring Your Router Graph
Overview and Things to Note
- This tutorial will configure the calendar to display as a modal on the same page as your form.
- This tutorial will work if your form exhibits behavior where on submit, the page refreshes and appends an “aliId” parameter to your URL. If your form redirects to a different URL within the same domain upon submission, please refer to the guide to display a calendar on a thank you page. If neither of these are the case, please reach out to professional services for additional support.
Configuring Your Form
Adding Your Hidden Field
To start, please follow the instructions in Adding a Hidden Field in Marketo to add a hidden field to your form to capture the log id to send over to your created leads/contacts.
Configuring Your Form Page
Add the following code to the page containing your form:
<script>
var _ld_scriptEl = document.createElement('script');
_ld_scriptEl.src = 'https://cdn.leandata.com/js-snippet/ld-book-v2.js';
_ld_scriptEl.addEventListener('load', function () {
const urlParams = new URLSearchParams(window.location.search);
if (urlParams.has("aliId")) {
LDBookItV2.initialize('<Org Id>', '<Trigger Node Name>', '<Hidden Field Name>');
LDBookItV2.submit();
}
else {
LDBookItV2.initialize('<Org Id>', '<Trigger Node Name>', '<Hidden Field Name>');
LDBookItV2.setFormProvider('marketo');
}
});
document.body.appendChild(_ld_scriptEl);
</script>
You’ll need to configure this snippet by changing the parts of this code to the following (remember to remove the ‘<>’ brackets):
- <Org Id> - Your 18 digit Salesforce Org ID. This will be for the Salesforce Org that has your live BookIt router graph or the one you would like to test on.
- <Trigger Node Name> - The name of the trigger node on your live BookIt router graph that you would like to enter the graph through. There will be instructions for the configuration of this in a later step, so for now just enter a name that describes the purpose of your form, like “Demo Request”.
- <Hidden Field Label> - The value you specified for the “API Name” of the hidden field you created in an earlier step (”ldbookitlogid” in the example).
Creating Your Router Graph
Setting Your Trigger Node Name
In your LeanData BookIt For Forms routing graph, double click on your trigger node.
Update the “Node Name” to the <Trigger Node Name> you defined in an earlier step.
Adding Your Field Mappings
Next, please follow the instructions in Setting Up Form Field Mappings in Marketo to map values from entries in your form to variables that can be used in logic in your graph.
Configuring Your Router Graph
From here you can configure your routing graph and the rest of your LeanData BookIt instance with the help of LeanData's professional services team!