Personal form
ViewController
In order for a personal form to work, you need to register a ViewController with the name personal_form
CreateWidget
To create a personal form widget, use the method CallGear.UI.createWidget()
with the following parameters:
widgetName
= 'personal_form'- the
config
object must contain the fieldid
Example:
CallGear.UI.registerViewController('personal_form', function (settings, tpls) {
var personalForm = CallGear.UI.createWidget('personal_form', {
settings: settings,
template: tpls['personal_form'],
id: settings['id']
});
personalForm.render();
});
Methods
submit()
The method captures a successful display of a form and saves the data received from the application. In the lead generation report, such impression will be considered as a lead.
Important: the method does not initiate clicking the link, specified in the settings.
A visitor’s transition to a new page must be done independently. If the transition is done without opening a new tab, it is advisable to make a transition in the leadsubmit
event processor so that leaving the current page does not interfere with thesubmit
method. Otherwise, the display of the form will not be recorded as successful and will not be displayed in statistics.
cancel()
The method captures a display of a form as unsuccessful. In the lead generation report, such an impression is considered a failure.
Events
leadhide
The event occurs when you need to hide the previously shown form. This is necessary if a visitor interacts with several pages of the website at once.
leadsubmit
The event occurs in response to the submit ()
method and confirms that the lead has been processed.
leadcancel
The event occurs in response to the cancel()
method and confirms that the visitor’s rejection has been captured.