Using an Origin Header Factor as a Flag for 3rd-Party Testing

Setting-up the Flag in SiteSpect

To allow third-party sites to use a flag sent by SiteSpect to enable different behavior, use an Origin Header Factor.

  1. Create a new Origin Factor.
  2. Select Header as the Type.
  3. Provide a Header Name; this is the name of the flag your 3rd-party sites can use.
  4. Provide a Header Value. Each Variation you create can have a different value. This is how you can identify which users belong to which cohort.

Using the Flag on a 3rd-Party Site

To retrieve the flag and parse its value, you must write some JavaScript that runs on the 3rd-party Sites. The script must:

  1. Make an XMLHttpRequest (XHR) to your domain (served through SiteSpect).
  2. The XHR request must leverage the X-Set-SiteSpect-Cookie/X-SiteSpect-Cookie headers (as described in a separate document).
  3. When receiving the response, call the following method of the XHR object: xhr.getResponseHeader('<Name-of-your-Origin-Factor>').
  4. The value of this method call is the value you set for the Variation served to the client.