JavaScript-Callback
Integration of own functions
The callback function can be used to react to various events in the assistant.
The result object (res
) contains the attributes event
with the name of the event and the transaction data data
.
<script type="text/javascript">
const licenceCode = "LL-XYZ123456789";
const options = {
selector: "#meister1"
}
Lokalleads.init(licenceCode, options, (res) => {
if(res.event === "flow_completed") {
console.log("A request was generated", res.data.leadId);
// TODO my implementation
}
});
</script>
Events
The following events can be implemented:
Name | Description |
---|---|
flow_completed | The results page of the wizard was reached by the user. |
Data
The following data is available:
Name | Description |
---|---|
id | ID of this transaction. |
leadId | ID under which this request can be found in the customer portal. |
inputs | Data entered by the user. |
caution
Other data in the data
object should not be used and may change at any time.