Website Conditions
What's on this page
Qtip: If you don’t have access to any of the features described on this page, reach out to your Account Executive. For more information about the differences between Digital Feedback and CustomerXM for Digital, see Digital Feedback vs. CustomerXM for Digital.
About Website Conditions
Sometimes you have more information stored about a visitor that you would like to use in your logic. In this section, you will learn about Website conditions. These conditions can be based off cookie values, Javascript Expressions, HTML on the site, and more.
Adobe Analytics
Adobe Analytics can be used to display a creative based on the value of Adobe Analytics variable. In order to use this condition, the website needs to be integrated with Adobe Analytics beforehand. For more information, see Adobe Analytics Extension.
To set an Adobe Analytics condition
Cookie
Value from Cookie can be used to display a creative if a cookie stored on the visitor’s browser contains a value that you specify. For example, if you store a cookie called Return Visitor equal to True if the visitor is a return visitor and False if the visitor is a new visitor, you could choose to target only those who are returning visitors.
Qtip: Browser security restrictions limit Website Feedback to only seeing the cookies saved by your website. Cookies stored by other websites will not be accessible.
Attention: Website Feedback, and other client-side scripts, cannot read cookies with the “HttpOnly” attribute set. See this page for more information.
Warning: Custom coding features are provided as-is and may require programming knowledge to implement. Our support team does not offer assistance or consultation on custom coding. You can always try asking our community of dedicated users instead. If you’d like to know more about our custom coding services, please contact your Qualtrics Account Executive.
To create a Cookie condition
Event Tracking
With event tracking, you can listen for specific events on your website beyond which pages the visitor has seen. Events might include visitor actions like downloading a monthly statement on a banking website, clicking to chat with a live agent on a commerce site, and more.
For how to set Event Tracking up, see the linked support page.
To create an Event Tracking condition
HTML on Site
HTML on site conditions can be used to read the HTML of the page and display a creative if an HTML element contains a value that you specify. For example, if you wanted to target visitors who have two or more items in their shopping cart, you could use the ID of the shopping cart element to base your logic on if that element contains a number larger than or equal to 2.
In this example, we’ve determined that we want to show a creative if there are 2 or more items in the shopping cart. Looking at the HTML for this button, we’ve determined that the ID of the HTML element containing the number of items in cart is qty-in-cart.
Qtip: If the element you need to target doesn’t have an ID attribute and you aren’t able to add one, consider targeting this element using the JavaScript Expression condition:
document.getElementsByClassName('qty-in-cart')[0];For example, If the shopping cart had no ID but had a class=“qty-in-cart” and it is the first element with this class on the page, then this JavaScript expression could be used to target it.
To create HTML on Site condition
JavaScript Expression
This condition can be used to display a creative depending on the value of a JavaScript expression. Often websites will store information about their visitors in JavaScript variables. For example, a variable might store whether the visitor is a current customer or a potential customer.
In this example, a variable called navigator.language stores visitors’ language settings. This intercept will show a creative if they are using their browsers in English.
Qtip: Not sure what data are available on your website through a JavaScript expression? Check with your web team.
To create a JavaScript Expression condition
Google Data Layer
This condition can be used to display a creative depending on the value stored within a Google Data Layer. Often websites will store information about their visitors in Data Layer variables. For example, a variable might store whether the visitor is a current customer or a potential customer. Qualtrics can reload as these variables are updated, allowing for real-time targeting.
In this example, a variable called navigator.language stores visitors’ language settings. This intercept will show a creative if they are using their browsers in English.
Qtip: Not sure what data is available on your website through a Google Data Layer? Check with your web or analytics teams.
TO CREATE A GOOGLE DATA LAYER CONDITION
FAQs
When should I use logic on my action sets?
When should I use logic on my action sets?
For example, since creatives are not responsive to screen size, many users like to implement action set logic focused on whether a website viewer is/is not using a mobile device or whether the website is being displayed on a certain screen size. By using logic in this instance, you are able to target a properly formatted and sized creative to the appropriate person.
Action set logic based on location can even be used to make sure that website viewers are seeing a creative that is written in the language that most likely applies to them.
I activated my intercept, but it‘s not showing up on my site. Why not?
I activated my intercept, but it‘s not showing up on my site. Why not?
- Logic: intercept targeting logic and action set logic are the conditions that must be met in order for an intercept to be displayed to a visitor. Checking this logic will be helpful in discovering why the Intercept is not displaying on a page.
- Logic sets that use “Contains”: A common cause of logic error is the use of the “Contains” vs. “Is.” To say a condition “Contains” means that the parameter you are basing the logic off (i.e., Current URL) will have the specified value present in addition to more information. For example, if I had logic that read as Current URL contains ‘qualtrics’, this would cause the intercept to display on any URL that has the word qualtrics present. The other option you have is using Current URL is [URL]. This condition depends on the visited URL being an exact match. Any differences or additional characters will prevent the intercept logic from passing.
- Intercept Revisions: When making edits to intercepts, changes are not made live until the intercept is published. When publishing an Intercept, a version of the intercept, or a “revision,” is saved. Reviewing the revisions that have been made is very useful for identifying any changes that may have suddenly prevented the intercept from appearing.
- Debug Window: The debug window is an invaluable tool for testing why an intercept is not displaying on a particular page.
For intercepts whose deployment code was implemented before March 2019, to enable the debug window, append a query string to any given URL called Q_DEBUG. This must be prefixed with a ? or a & like the following examples: https://www.qualtrics.com?Q_DEBUG, https://www.qualtrics.com/blog?item=value&Q_DEBUG.
For intercepts whose deployment code was implemented after March 2019, run the following JavaScript snippet in the Console of your web page:The debug window breaks down all conditions required for intercepts running on the URL to appear. If you find that an intercept is not appearing, locate it in the debug window and identify any red failed warnings.
QSI.API.unload();
QSI.isDebug = true;
QSI.API.load();
QSI.API.run();Qtip: The Website Insights debugger does not function if the code has been implemented using a tag manager. Also, if the URL already has a query string with a ?, then the debugger will require a & instead. - Network Request: Most browsers possess a developer tools menu that allows a user to see a site’s source code, resources, cookies, and network calls. Website Insights possesses a distinct presence in the Network section of these tools. To check for these scripts running, open the developer tools and navigate to the Network section. Once here, reload the webpage and the menu should begin to populate with all network requests being made by the website. To identify Website Insights code, look for calls that begin with ?Q_ZID or ?Q_SID. This is the code itself running checks on the display logic. If you cannot find anything matching this format, then there is an issue with the implementation of your project code. You can refer to our support page on implementation for advice on where is best to place the code.
- Content Security Policy Issues: If you receive a console log that violates a Content Security Policy, there is most likely a restriction on your website that is blocking our intercepts from deploying. We recommend reaching out to your web-development team to resolve. To ensure your intercepts work, we generally recommend allowlisting the following items in your Content Security Policy headers:
- connect-src https://*.qualtrics.com
- frame-src https://*.qualtrics.com
- img-src https://siteintercept.qualtrics.com
- script-src https://*.qualtrics.com
- SPA URL Handling: If your site uses a single-page application (SPA) framework, make sure your code triggers history.pushState() when navigating between views. Some frameworks may re-render or update the URL without pushing a new history entry, which can prevent intercepts from firing. If you're using useEffect or similar lifecycle hooks, make sure your intercept logic runs after navigation is complete.
That's great! Thank you for your feedback!
Thank you for your feedback!