Importance of Web form Tracking
Web form tracking allows you to create personalized Email Campaigns and Journeys for the visitors who submit a Web Form on your site.
By tracking a Form, the information of the users who submit the Form will get captured and created as contacts in the defined Freshmarketer list. The list could be further used to create Email Campaigns and to trigger Workflow Journeys.
How to track your Web Form?
Go to your Freshmarketer dashboard. Click on Engage -> Webform Tracking. Click on “Track web form”.
Provide a name for your Form tracking.
There are two sections as part of the configuration.
Configure & Mapping
Settings
Configure & Mapping
Step 1: Here, you need to choose the contact list to which your Form submitted contacts need to be added. You can either choose from an existing list that you have created earlier or you can create a new list on the go. More than one list can also be chosen where the submitted form contacts would be created in the lists specified.
Click here to know how to create a list and push your contacts.
Step 2: Provide your website URL where the form exists. Click on “Load form”. The form fields will be fetched and listed below given your form has a unique name or ID. You will notice the form name, ID and the form fields being fetched.
When you’ve more than one Forms on the provided URL, all the Forms will be fetched and you can choose the Form which you’d like to track.
On the right-hand side, you have the option to map the form fields with the contact properties you have set on your configured list. Few default form fields like email, country etc. will be mapped automatically. The unmapped fields will have an option to map using the dropdown. The dropdown populates the contact properties set on your list. This also includes the custom contact properties you have created from the settings. Email is a mandatory field that needs to be mapped for a contact to get created.
You can include or exclude tracking the form fields using the checkbox beside each of the fields. Email field is mandatory to proceed. Once done, click Save & Next.
Settings
Form tracking requires Freshmarketer snippet added on your website. Ensure the Freshmarketer CDN snippet is added on the page where the Form exists.
You can verify the installation by providing the website URL on the below field. Click on verify to confirm your code installation.
To track the form fields, the below code snippet needs to be added on your website. You need to insert the data attribute of each Form field for passing the specified values to Freshmarketer.
Please refer to the below example. In this case we are tracking the Email, Country and City fields of the form.
Snippet from your Freshmarketer account:
var userValues = {country : "value_to_be_replaced",city : "value_to_be_replaced",email : "value_to_be_replaced",};
window.FMApi = window.FMApi || [];
window.FMApi.push("fm_form_tracking", "894F6BA6073CCAB32E5E6EDD864663760EA91487A12259D8CC6313B62", userValues);
Snippet to be inserted on your code:
The function webformSubmit() needs to be added on the success function of your Form submit button.
Once you have integrated the snippet, click on “Start Tracking”.
When each Form submission happens on your site, the values will be passed and created as contacts inside your list. You can use the contact list to create campaigns and journeys.
Ongoing tracking can be paused and restarted. You can check the status of your Form tracking from the dashboard as shown below.