Custom Events

If you want a customer journey to be executed after an action on your website, you can use the following method:

window.plugins.indigitall.customer.sendCustomEvent(
  "eventCode": "field1_value",
  "customData": {
		  "dataKey": "dataValue"
	}, (response) => {  
  		console.log("Event success response: "+response);  
  }, (error) => {  
      console.log("Event error: "+ JSON.stringify(error));  
  })

Inside the JSON, in the second parameter, you must send the necessary variables that the journey needs to send the campaigns.

For example:

window.plugins.indigitall.customer.sendCustomEvent(
  "eventCode": "my_event",
  "customData": {"name": "John","value": "123"}
, (response) => {
  	console.log("Event success response: "+response);
}, (error) => {
    console.log("Event error: "+ JSON.stringify(error));
})