Skip to main content

Static HTML Forms

Our automatic form tracking supports tracking static HTML forms on your website. It triggers when a valid email is submitted as part of a form.

To enable static HTML form tracking, set the html option to true in your script as done below.

dreamdata.load('<DREAMDATA_API_KEY>', {
formTracking: {
html: true,
},
})

Additional options

We also support the following options to customize your static HTML form tracking:

  • trackName. Custom event name for tracking, overriding default "form-submit".
  • useFormIdAsTrackName. Use the form's id attribute as the event name in tracking.
  • useFormNameAsTrackName. Use the form's name attribute as the event name in tracking.
  • useCustomAttributeNameAsEventName - Get the event name from any custom attribute that you might have on your form.

Custom options should be added in the manner as shown below:

dreamdata.load('<DREAMDATA_API_KEY>', {
formTracking: {
html: {
useFormNameAsTrackName: true,
},
},
})