How to get leads from HubSpot Forms?
HubSpot Forms are an easy way to build forms and get leads from your landing pages. You can use your existing HubSpot Forms with Kiflo to track leads coming from partners.
Here is how it works:
- Install the Kiflo JS snippet on your website: to track visitors coming from referral links shared by partners. This will manage the tracking cookie automatically.
- Configure your HubSpot Form to get and save the Tracking code: this code is stored in the tracking cookie and must be sent along with the rest of the form
- Customize the JS code used to embed the form: in order to read the Tracking code from the existing cookie put by the Kiflo JS snippet and sent it to HubSpot
- Use the Tracking code to create a new lead in Kiflo
In this article
Step 1: Install Kiflo tracking code
- Tracking cookies for visitors and leads
- Communication between your website and your Kiflo account
Step 2: Configure your HubSpot Form
Create or edit an existing form in HubSpot, the way you are used to it, then:
- Add a new field called: "Kiflo Tracking Code"
- Make this field hidden
At this point, you can save the Kiflo Tracking Code in HubSpot along with the other fields.
Step 3: Customize the embed code
Copy the embed code from the HubSpot Form editor and add a new callback: "onFormSubmit" that will be executed just before the form is submitted to HubSpot.
This callback is in charge of reading the Tracking code from the tracking cookie (if there is one), and populate the hidden field created at step 2 with this value.
The code should look like
If you chose another name at step 2, please replace "kiflo_tracking_code" with the contact property name provided by HubSpot.
Find more information in the official HubSpot documentation: https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options
Step 4: Send leads to Kiflo
Now you are ready to send leads to Kiflo! You have different options:
- Using Zapier
- Using API call
Create a new Zap, that can be triggered from different triggers from HubSpot, and add the Create Lead action from Kiflo PRM:
Map all fields coming from HubSpot, then at the very bottom of the setup action step, insert the Tracking code:
Using API call
If you prefer to call the Rest API the create leads, please refer to this method: https://docs-api.kiflo.com/#b285fe6c-af58-4d9e-a99c-7e87065da2b