Configuring invitation triggers using rules

This technique will add complexity to your environment, especially if there are many surveys with invitation targeting configurations. Removing survey conflicts can be a time-consuming process and requires a full understanding of all targeting that is active on your property.

Because this technique increments pageviews for a session, some of the survey-specific analytics, reporting, and targeting can become skewed.

Using this technique, a survey should appear when a chat sessions ends by an agent or a customer action.

The following are technical requirements for this technique:

  • A survey configured for Invitation Trigger.

  • At least one custom parameter that contains a flag indicating the end of a chat. For example, a JavaScript variable "endChat" that can be defined as 'true' or 'false'.

  • A rule to evaluate the custom parameter that will trigger the invitation. The rule will be attached to the chosen survey.

  • The Form Targeting Configuration has a target by rule setting enabled with the rule in the previous bullet selected.

  • The live chat client must be able to either:

    • Set an event that can be used in an event listener function to set targeting custom parameters and call the KAMPYLE_ONSITE_SDK.updatePageView() API to re-evaluate all targeting logic.

      OR

    • Execute JavaScript on the end chat event and set JavaScript variables so that the targeting rule will trigger.

  • If executing JavaScript directly from the end-chat button, then call the KAMPYLE_ONSITE_SDK.updatePageView() API to re-evaluate all targeting logic.

  • If using the event listener, then the end-chat event will automatically call the function assigned to the event. The function will contain the code to set targeting custom parameters and the KAMPYLE_ONSITE_SDK.updatePageView() API to re-evaluate all targeting logic, which will then trigger the survey. 

The configure an invitation trigger using a rule, set up the chat client to execute the following steps at the end of a chat session:

  1. Store 'true' in the endChat variable.

  2. Call KAMPYLE_ONSITE_SDK.updatePageView()

The relevant targeting rules will be evaluated and the survey will be displayed.