Call generator
ViewController
In order for a generator form to work, you need to register a ViewController with the call_generator
CreateWidget
To create a call generator widget, use the method CallGear.UI.createWidget()
with the following parameters:
widgetName
= 'call_generator'- the
config
object must contain the fieldid
Example:
CallGear.UI.registerViewController('call_generator', function (settings, tpls) {
var callGenerator = CallGear.UI.createWidget('call_generator', {
settings: settings,
template: tpls['call_generator'],
id: settings['id']
});
callGenerator.render();
});
Method
submit(data)
The method captures a successful display of a form and initiates a call request. In the lead generation report, such impression will be considered as a lead.
The data
object should contain the following fields
phone
- a line containing 11 digits of the phone number which will receive a call.group_id
- ID of an operator group to which this call will be transferred. The field must be filled in if the call generator is configured to select a group of operators.- delayed_call_time - parameter to make a delayed call. Set in the format n ms, UTC.
cancel()
Method captures unsuccessful displays of a form. In the lead generation report, such impression will be 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 a call to the submit ()
method and confirms that the lead has been processed.
leadcancel
The event occurs in response to a call to the cancel()
method and confirms that a failure from a visitor has been captured.