About
Walnut makes it easy to capture leads by embedding a third-party lead form. Once you've embedded the lead form into the demo, all new leads will show in your marketing platform.
You don’t have to integrate Walnut with another tool in order to embed forms. However, with Walnut's HubSpot, Marketo, and Pardot integrations, users can access additional demo insights.
Before you start
- You can attach lead forms on one screen or on multiple guides and edit how they access the form whenever you want.
- Once a viewer has completed a lead form, they won’t get directed to it again!
- Currently you can only add one lead form in a demo.
- Check out lead form demos for Marketo and Hubspot. When you integrate Walnut with either of these apps, Walnut syncs the data and provides additional insights and analytics.
- Form submissions should be tested in live demos only
Embed lead forms in demos
Here's the generic workflow.
To embed a lead form in a demo:
- Decide if you want to make completing a lead form optional or mandatory.
- Grab the embed code from the form created in your marketing platform.
- Select your template and open in edit mode.
- From the right hand toolbar click the Formsicon. This opens the Forms pane.
- Complete the details.
- Enter a form name (#1).
- Paste the embed code from your marketing platform (#2).
- Enter a trigger (#3): on a screen, with a guide or Demo Floating Button. For a Demo Floating Button, enter the button text and set the button’s position.
- Set the Is the form mandatory toggle to ON if that’s what you want.
- Select a guide (#4): Go to the guide you’d like to link it to, click the Link button, and select the form.
- After submission (#5): Select the option: Done (stay in screen) or select the relevant guide.
- When the details are complete, click Save. The lead form shows in the right hand pane.
You’ll now find enriched demo data in Hubspot or Marketo, depending on your integrated platform.
NOTE: For each identified demo session your potential prospects view, we examine if there is a related lead already in our system. If such a lead exists, we update the demo information by:
- modifying lead attributes
- logging a new 'Demo View' activity
Edit lead forms
Here's the workflow.
To edit a lead form in a demo:
- Select the template in Edit mode.
- From the right hand toolbar click the Formsicon. This opens the Forms pane.
- Select the screen, guide or Demo Floating Button to connect to the lead form.
- If it’s connected to a screen, select the screen.
- If it’s connected to a guide, then edit the Call to Action button and select the lead form. A confirmation message appears letting you know that the action will replace the original trigger.
- If it’s a Demo Floating button, add the lead form to it.
- Then, click Yes.
- Check out the results by going to the new location.
Marketo lead forms
When a lead is generated from the embedded form, the associated demo data is automatically linked to that lead. Why not check out our demo?
Embed a Marketo lead form
Here's the workflow.
To embed a Marketo lead form and link demo data to the contact
- Review the steps to create a Marketo lead form - see the article Forms API Reference (https://experienceleague.adobe.com/en/docs/marketo-developer/marketo/javascriptapi/forms-api-reference).
- Follow the steps in the section Embed lead forms in demos (generic).
- When a lead is generated, a Walnut activity is added to the contact and the contact attributes are updated with relevant demo data.
NOTES:
- The enriched demo data appears in your Marketo account approximately two hours after the viewer completes the embedded lead form.
- If you have linked your Marketo form to different tools like ChillyPiper or Clearbit, you can also connect these tools to the form in the demo. To do this, include the necessary scripts along with the embed code in Walnut.
- Be sure you read the integration guide for each tool you add. Some tools might need you to load the script before or after Marketo, or set them up with the right Marketo ID.
Add a URL parameter to a Marketo lead form
Support URL parameters To support the URL parameters, add the following code snippet to the embed code.
URL code snippet for Marketo
MktoForms2.whenReady(function(form){
const [_, search] = parent.parent.document.referrer.split('?');
const params = new URLSearchParams(search);
params.forEach((value, key) => {
document.querySelector(`input[name="${key}"]`).value = value;
});
Learn more about embedding lead forms in Marketo
Pardot lead forms
When a lead is generated from the embedded form, the associated demo data is automatically linked to that lead.
Here's the workflow.
To embed a Pardot lead form and link demo data to the contact
- Follow the steps in the section Embed lead forms in demos (generic).
- When a lead is generated, a Walnut activity is added to the contact and the contact attributes are updated with relevant demo data.
- To customize the lead form add global CSS to the lead form code. For example:
<div style="background-color: blue; padding: 20px; border-radius: 5px;">
NOTE: The enriched demo data appears in your Pardot account approximately two hours after the viewer completes the embedded lead form.
Add additional Javascript to Pardot lead forms
Walnut does not currently support auto-dismissal (closure) of Pardot forms when a viewer submits the form. This section includes two scripts. The first captures the email address from the form submission and the second one sends a success message to a parent window upon completion.
WARNING: It’s essential that you include this additional Javascript.
Here's the workflow.
To add additional Javascript to Pardot lead forms:
- You must have experience of Pardot’s form settings and the relevant permissions.
- Access your form. Log into your Pardot account and navigate to the form you want to edit.
- Go to the form’s Settings and in step 3 change the look and feel. Click the Source icon to switch to the code view.
- Copy this code and paste into the editor. This captures the email address.
<script type="text/javascript">
var form = document.querySelector("#pardot-form");
if (form) {
form.addEventListener('submit', function (event) {
var email = '';
for (var i = 0, len = event.target.elements.length; i < len; i++) {
var element = event.target.elements[i];
if (element.value.includes("@")) {
email = element.value;
break; // Break the loop once the email is found
}
}
window.parent.postMessage({ message: "PARDOT_DATA_READY", email: email }, "*");
});
}
</script>
- Go to step 4: Completion Actions and open the Thank You Code tab.
- Click the Source button and paste in this code to send a success message when a form is completed.
<script> window.parent.postMessage({ message: "PARDOT_FORM_SUCCESS" }, "*");
</script> - Exit Source mode, then click Confirm & Save to save the changes to the form.
Great job! You’ve configured Pardot forms to enhance data handling and communication.
Learn more about embedding lead forms in Pardot
Hubspot lead forms
When a lead is generated from the embedded form, the associated demo data is automatically linked to that lead.
Here's the workflow.
To embed a Hubspot lead form and link demo data to the contact
- Follow the steps in the section Embed lead forms in demos (generic).
- When a lead is generated, a Walnut activity is added to the contact and the contact attributes are updated with relevant demo data.
- To customize the lead form add global CSS to the lead form code. For example:
<div style="background-color: blue; padding: 20px; border-radius: 5px;">
NOTES:
- The enriched demo data appears in your Hubspot account approximately two hours after the viewer completes the embedded lead form.
- If you have linked your Hubspot form to different tools like ChillyPiper or Clearbit, you can also connect these tools to the form in the demo. To do this, include the necessary scripts along with the embed code in Walnut.
- Be sure you read the integration guide for each tool you add. Some tools might need you to load the script before or after Hubspot, or set them up with the right Hubspot ID.
Add a URL parameter to a Hubspot lead form
If you want to add an email URL parameter, here’s what to do. The URL parameter is optional - you can embed a Hubspot lead form without it.
URL code snippet for Hubspot
Add this code snippet to the embed code.
<script> (function () { window.addEventListener('message', event => { if(event.data.type === 'hsFormCallback' && event.data.eventName === 'onFormReady') { const [_,search] = parent.parent.document.referrer.split('?') const searchParams = new URLSearchParams(search); searchParams.forEach((value, key) => document.querySelector(`input[name=${key}]`).value = value); } }); })() </script>
Learn more about embedding lead forms in HubSpot