Configuring code triggers

Configuring code triggers does not require setting up custom parameters or adding Digital targeting re-evaluation functions to the chat client process. Although this technique does not use a targeting engine, it facilitates ease of management and ensures the correct surveys are targeted.

With this technique, a users sees a specific survey when an agent ends the chat session. The chat client is configured so that buttons/controls to end the chat execute JavaScript functions or set events. A survey is configured with a code trigger.

To configure a code trigger to display a survey, complete the following steps:

  1. At the beginning of a chat process, use the KAMPYLE_ONSITE_SDK.loadForm(FormID) API to preload the survey and ensure it is in a published state, where FormID is the ID of the survey. The KAMPYLE_ONSITE_SDK.loadForm(FormID) returns 'true' to indicate that the survey is available for display. The FormID can be inserted as a variable parameter by the customer so that it does not have to be hard-coded. The variable parameter could be updated using a Tag Manager.

  2. Configure the chat client so that the button or control to end the chat does the following:
    • Checks the loadForm return code.

    • Executes the KAMPYLE_ONSITE_SDK.showForm(FormID)function to display the survey.