Good Practice with restricting Variation Triggers

Since SiteSpect is often configured to route more than just HTML pages (such as AJAX type JSON), you might have unintended Triggers match or Variations apply

Most clients are configured to include routing Content-Type: application/json (other types of application/* are typically not routed). This can be very useful for Triggering Metrics and making changes with Variations.

In order to restrict matches to HTML pages, use an additional Trigger for Header > Content-Type: text/html.

There are a few cases where this is important:

  • You have no Triggers at all and you want to only match on HTML pages
  • There are routed JSON requests that can contain HTML such as </body>
  • You are using a regex anchor to specify your insertion point like \A or \z instead of a string
  • You are using other characters for your insertion point that are common in JSON

Here is what that Trigger looks like in the Build Flow user interface.