Types of Factors

SiteSpect provides several different types of Factors for use in your Campaigns. You select the Factor while creating the Variation Template that is part of the Factor. When you select the Factor Type, the fields displayed in the Variation Template section of the page change to reflect the options available for the type.

Note: Regular Factors and Redirect Factors are available to all users; other Factor Types must be enabled.

Regular Factors

Regular Factors use search and replace fields to modify the content of the page. When you select Regular Factor, the default Factor type, the fields available to you are Default Search Text and Default Replacement Text. When you define the Factor and its Variation Template, you specify precisely what you want SiteSpect to look for on the page and replace with the specified content.

Types of Factors - Regular Factors

The Variation Template for Regular Factors allows you to specify the following:

  • Default Search Text – The text you want to search for on the page.
  • Default Replacement Text – The text you want SiteSpect to use as replacement.

Redirect Factors

Redirect Factors change the URL requested by the user to a different URL. Rather than performing the search and replace within a page, as with Regular Factors, Redirect Factors deliver alternate existing pages to the end user. This is helpful in situations where you have completely different pages (perhaps with different business logic or complex graphic components) and it is easier than trying to modify the page using regex.

Redirects happen behind the scenes and do not reveal the alternate URL to the visitor. They can also make use of a 301 or 302 redirect.

Types of Factors - Redirect Factors

The Variation Template for Redirect Factors allows you to specify the following:

  • Redirect Type – The default redirect method for Variations of the Factor:
    • Internal – An internal redirect allows you to redirect to a new URL without changing the URL the user sees in the browser's address bar.
    • 301 – A 301 redirect tells the browser to redirect to a new URL (most common and search engine friendly).
    • 302 – A 302 redirect is similar to a 301, but it tells the browser that the files have moved temporarily.
  • Default Requested URL Search Text – Defines the search text for the original URL and any parameters from the original URL that you want to persist in the redirect URL.
  • Default Redirect URL Replacement Text – Defines the new URL this Variation redirects to. The redirect URL should not include the protocol (http or https) or your primary domain.

For example, if your original URL is:

http://www.mysite.com/index2.html

Enter:

/index2.html

Origin Factors

An Origin Factor specifies a value to signal to the origin web server (via cookie, header, query parameter, URL, 301 Redirect, or 302 Redirect) which Variation to show the user. Origin Factors are available only when the Origin Experiments feature is enabled.

Origin Factors do not have Triggers; they apply to every request.

Use the Type drop-down list to choose the Origin Factor Type: Cookie, Header, Query Parameter, URL, 301 Redirect, or 302 Redirect.

Origin Factor Cookies

The following image shows the fields for Origin Factor Cookies. Enter a Name and Value for the Cookie.

Types of Factors - Origin Factor Cookies

Origin Factor Headers

The following image shows the fields for Origin Factor Headers. Enter a Name and a Value for the Header.

Types of Factors - Origin Factor Headers

When you select Header, the option called Visible Only to the Origin is displayed. When you select this check box, the Origin Header is sent only to the origin, not to the client. When not checked, the header is sent to both the origin and client (in the response).

The Origin Factor Cookie/Header Name specifies the Name of the Cookie/Header.

The Origin Factor Cookie/Header Value specifies the Value of the Cookie/Header.

Origin Factor URL

The following image shows the fields for Origin Factor URL. Enter Search and Replace values for the URL. This Factor performs a search and replace on the URL in the request to the origin. The is a redirect on request and great alternative to the Redirect Factor.

Types of Factors - Origin Factor URL

Origin Factor Query Parameter

The following image shows the fields for Origin Factor Query Parameter. Enter a Name and a Value for the Parameter. This adds the specified Name and Value to the query string in the request to the origin.

Types of Factors - Origin Factor Query Parameter

301 Redirect

The following image shows the fields for the Origin Factor 301 Redirect. A 301 Redirect tells the browser that the requested URL has been permanently replaced with a new URL, without the need to go to your origin. In the Search field, enter the name of the URL you want to replace. In the Replace field, enter the name of the URL to redirect to.

Types of Factors - 301 Redirect

302 Redirect

The following image shows the fields for the Origin Factor 302 Redirect. A 302 Redirect tells the browser that the requested URL has been temporarily replaced with a new URL, without the need to go to your origin. In the Search field, enter the name of the URL you want to replace. In the Replace field, enter the name of the URL to redirect to.

Types of Factors - 302 Redirect

Client-Side Factors

Client-Side Factors work on the client side to change the page using JavaScript and are not processed using the SiteSpect engine on the server side. They make it easier to test websites that are heavily built with JavaScript. These Factors, along with a JavaScript SDK, give you a powerful approach to testing on Single-Page Application frameworks like Backbone and Angular.

When you select Client-Side Factor in the Variation Template area of the Factor page, the following fields are available to you:

  • Selector – Enter the name of a CSS Selector. When a page component matches this Selector, SiteSpect applies the Changes defined for the Variation.
  • HTML Replacement – Replaces the HTML content of the selected components.
  • Attributes – Replaces the Attribute with the specified value if the Attribute exists. If the Attribute does not exist, this adds it. Enter the name of the Attribute on the left side of the field and the Value on the right side.
  • CSS – Replaces the CSS rule with the specified value if the rule exists. If the CSS rule does not exists, this adds it. Enter the rule on the left side of the field and the value on the right. Note that if there is an !important rule, this won't override it unless this rule is also !important.
  • Custom – Lets you provide JavaScript code to execute on each matching component. The first line and the last line of the field are not editable. Note that this function is run against each matching component. In addition, each time it's run, the current component it's working on can be accessed with the keyword this.

Injecting Client-Side Factors

By default, Client-Side Factors are injected into the page right after the body tag in all requests that travel through SiteSpect. However, you can configure where the Client-Side Factors are injected using Site Settings. These settings are available only to users with admin privileges. Contact the Help Desk at helpdesk@sitespect.com or +1-844-859-1900 for more information.