Most web forms should be captured automatically with the addition of the JavaScript snippet on your website. The below form builder integrations have been tested to ensure form submissions are properly captured:
- WP Forms
- Elementor
- Forminator
- HappyForms
- Ninja Forms
- GravityForms
- Fluent Forms
- Caldera Forms
- Cognito Forms
- Contact Form 7
- Formidable Forms
However, automatic form submission capture is not possible in cases where your form is contained inside of an <iframe>. This is due to browser limitations, as web browsers do not grant access to content loaded within these elements programmatically.
In cases where your form is not able to be captured automatically, you may send form submissions manually using the JavaScript snippet SDK which will be present in the window.$prism property. This property is accessible after the document has loaded or is considered interactive.
To send form submissions to Patient Prism, you may use the window.$prism.submission.send() function:
window.$prism.submission.send(
object: data,
string: id,
object: options = {}
);
- data (required) - An object where each key is the fields name, and the corresponding value is an object containing the following properties:
- type - The input type of the field (text, email, tel, etc.).
- value - The actual value of the field.
- label - The display name of the field.
- id (required) - An identifier you wish you associate to the form.
- options (optional) - An optional object containing additional options to send with the form. Below are all available options:
- location - The UUID of Patient Prism location you wish to associate to the form. If this is not present, a location will attempt to be associated automatically using the Patient Prism location's websites.
Example:
const data = {
name: {
type: 'text',
value: 'John',
label: 'Name',
},
email: {
type: 'email',
value: 'john@email.com',
label: 'Email',
},
phone: {
type: 'tel',
value: '8138675309',
label: 'Phone Number',
},
};
const id = 'contact-form-health';
// Optional:
const options = {
// location: '{location_uuid}'
};
window.$prism.submission.send(data, id, options);