What's on this page:IntroductionWhich code do I implement?Where do I place the code?How does this code work?How will this code affect my website?
Which code do I implement?
Site Intercept provides a few variations of code for you to implement on your website. Although each variation has its use, we recommend using the Published version of the Zone Code, with Auto Protocol and No Sampling. Here’s a brief explanation of what that means and the other available variations:
Zone Code vs Intercept Code
With Zone Code, you can create new Intercepts and turn them on and off without ever needing to update the code on your website. The alternative would be to use Intercept Code, which requires a new snippet of code for each Intercept you create.
To access Zone Code:
To access Intercept Code:
- Navigate to the Intercepts section.
- Choose which Intercept you would like to implement.
- Select Get Intercept Code.
With the Published version of the code, changes you make to Intercept and Creatives in the Zone won’t go live until you click Publish.
The publishing system helps with quality control and is highly recommended. When using Editing code, any changes you make to Creatives or Intercepts will automatically go live on your website. Editing code may be appropriate for testing on a development or test version of your website.
Protocol refers to how content is delivered to the visitors’ web browser. Site Intercept offers three options — deliver the content insecurely (HTTP), deliver it securely (HTTPS), or follow whichever option your website is using (Auto). Auto is generally the best option.
Adding sampling to the code can help you reduce your Site Intercept usage, measured by Page Views. When sampling is in place, Site Intercept code is only run for a percentage of your website visitors or website page views. Changes to this setting actually modify a portion of the Intercept or Zone Code, which means if you already have the code on your website, you will need to implement new code each time you want to modify the sample rate. Because of this extra step, many will choose to use “No Sampling” and manage the sampling in the Change Options menu of the individual Intercepts.
- Sample Visitors will only run Site Intercept code for a portion of your website visitors. For each visitor, it will either run on every page they visit, or on none of the pages they visit.
- Sample Page Views will run the code n out of 100 page views for any visitor. Because the code does not run on every page, certain data points tracked by Site Intercept (such as Site History, Time Spent on Site, Page Views, etc.) will be incomplete.
Where do I place the code?
Site Intercept code can be placed on any page where you may want to display Creatives to your visitors. In addition, you will also want to place the code on any pages for which you’d like Site Intercept to track or collect information.
If you are not running any Intercepts at the moment, you can save on your Page Views by deactivating the Zone. For help deactivating a Zone, check out our Manage Zones support page.
Site Intercept code may be placed anywhere within the page HTML, although it is most commonly implemented in the page header or footer. Many clients choose to implement code through tag management systems.
Please be aware that our Support team does not support or troubleshoot an implementation that includes custom modifications to the original code.
How does this code work?
The Site Intercept code is a lightweight snippet that sends a request to Qualtrics servers to see which (if any) Creatives should be shown to the visitor.
Architecture Diagram (Simplified)
- A visitor loads a page that contains Site Intercept code.
- The Site Intercept code sends a server request checking which Intercepts are Active (turned on) and if the visitor has qualified for any of them.
- If necessary, a second server request is made, providing additional details needed to determine if a visitor qualifies for a Creative.
- Lastly, any Creatives that the visitor should see are loaded and displayed.
Architecture Diagram (Technical)
- A website visitor will view a page in their browser containing the Site Intercept code.
- The code is cued for downloading once the page loads.
- Qualtrics obtains the Site Intercept definition from the database and builds the code appropriately.
- If necessary, a second request is sent to the servers to obtain the required data.
- The Creative appears on the page.
How will this code affect my website?
Site Intercept code is designed to load after all and independent from the rest of the page (asynchronously). This means that if anything should ever happen to slow down Site Intercept requests (an issue on our servers), website visitors will not notice any anything because the page has already loaded before requests to our servers are made.