♻️Update signal

XCE allows Partners to load the widget in a state other than the default with custom attributes or trigger events programmatically using the update signal.

This type of features work on an as needed basis for each element, which is explained below.

Using update signal

The update signal allows you to programmatically trigger our element events.

This is useful for specific customer actions or contexts during their journey that kept them away from any direct element interaction and still being able to trigger the desired event.

To programmatically select an input option call signalLayer.push() with update as the value for the signal property and add the input value in the option property as in the following example:

The following example is just to showcase an element selection update state scenario and is not necessarily available on your element.

The option property value should match any of the available inputs values.

Please refer to your CSE regarding the available states and input values to update for your element.

<!-- remove protection button -->
<button onclick="removeProtection()">Remove Protection</button>

<!-- protection-offer example -->
<script>
  function removeProtection() {
    window.signalLayer.push({
      signal: "update",
      element: "xce-protection-offer",
      option: "event_ticket_protection", // this value can vary
    });
  }
</script>

This is similar to dispatchEvent() difference being we are using XCE Signals instead.

Last updated