1. Knowledge Base
  2. Build
  3. Create a Client-Side Campaign

Custom Client-Side Triggers

The Custom Trigger is available for client-side Campaigns, Global Changes, Factors, and Metrics. Selecting this trigger type allows you to provide JavaScript code to run on page change for metrics and on mutation of your selector for campaigns, global changes, and factors. If the function returns true, the trigger is satisfied, and SiteSpect will apply changes or increment the metric. If the function returns false, SiteSpect does not apply changes or increment the metric.

Note: Custom Triggers do not allow the OR operator between triggers.
To use this trigger type in metrics, please contact your account team as this option is currently available under a site lab.

To define a Custom Trigger in a campaign:

  1. Select New, then A/B Campaign.
  2. In the Variations section of the page, select Client Side from the Type drop-down.
  3. When in the Variations section of the page select Find & Replace.
  4. Select Custom from the Triggers drop-down.

Custom Client-Side Triggers

When you do, the fields in the Triggers area changes as in the following image.

Custom Client-Side Triggers II

  1. Enter the JavaScript code that you want to run on the current page. In the course of a Campaign, if this resolves to true, SiteSpect applies the changes specified in the What to Change area of the page.
  2. Continue creating your Campaign.