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.
- Create a new Origin Factor.
- Select Header as the Type.
- Provide a Header Name; this is the name of the flag your 3rd-party sites can use.
- 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:
- Make an XMLHttpRequest (XHR) to your domain (served through SiteSpect).
- The XHR request must leverage the X-Set-SiteSpect-Cookie/X-SiteSpect-Cookie headers (as described in a separate document).
- When receiving the response, call the following method of the XHR object: xhr.getResponseHeader('<Name-of-your-Origin-Factor>').
- The value of this method call is the value you set for the Variation served to the client.