Skip to main content

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:

NameDescription
flow_completedThe results page of the wizard was reached by the user.

Data

The following data is available:

NameDescription
idID of this transaction.
leadIdID under which this request can be found in the customer portal.
inputsData entered by the user.
caution

Other data in the data object should not be used and may change at any time.