Using Google Analytics with Website / App Insights
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 Google Analytics
Google Analytics is a powerful web analytics tool that tracks and reports on website traffic and online behavior patterns. When you combine Google Analytics and Qualtrics Website / App Insights data, you can obtain a holistic picture of your end user’s experience on your websites as well as ensure that you are showing an intercept to the right user at the right time in their digital journey.
The Google Analytics Data Layer can be used for real time targeting and embedded data capture. As soon as a value within the Data Layer is updated, Qualtrics will automatically re-evaluate the intercept targeting logic. This allows Qualtrics to reload as soon as values are updated without having to wait for the next page load.
You can bring together Google and Qualtrics data in a variety of ways depending on your specific needs.Qtip: For detailed documentation on using Google Analytics, please visit the Google Support site. For detailed documentation on the Google Data Layer, please visit the Google Data Layer Support Page.
Attention: Custom coding features are provided as-is and require programming knowledge to implement. Qualtrics Support does not offer assistance or consultation on custom coding. You can always try asking our community of dedicated users instead.
Qtip: Qualtrics also supports a more advanced Google Analytics integration using custom engineering services. Please contact your Account Executive for more information.
Integrating with Google Data Layer
You must have access to both Google Data Layer and Google Tag Manager to use this feature.
To use the Google Data Layer with Qualtrics, you will have to give Qualtrics information about your Google Container ID. This can either be added by a Brand Administrator within Organization Settings so it applies to all Website / App Insights projects, or it can be added to a specific intercept project.
Adding the Google Container ID within Organization Settings
These steps can only be performed by a Brand Administrator.
Attention: Google Container IDs added here will apply to every Website / App Insights project. If there are differences between what is entered here and within an intercept project, the value from the project will be the value that’s used.
Adding the Google Container ID within an Intercept Project
Using Google Data Layer Variables in Visitor-Targeting Logic
Google Analytics can help you ensure that your intercept is shown to the right user at the right point in their digital journey. By adding targeting logic or action set logic to your intercept with a Google Data Layer condition, you can determine the correct Google Analytics criteria that users must meet before they are presented with the intercept.
Qtip: Only the latest key values that were pushed to the data layer object are used to evaluate intercept logic. For example, if the key-value pairs{"currentPage": "shoppingCart"}and{"currentPage": "checkOut"}are pushed to the data layer in this order, then querying the data layer object for the key “currentPage” will return “checkOut,” the latest value pushed for this key. If you would like a different value to be returned, then push that key-value pair again to the data layer.
Google Analytics Expressions in Targeting Logic
Qtip: You can work with your web development team or inspect the web page within your browser in order to determine which Data Layer variables you can use for the logic set.
Passing Google Analytics Data to Qualtrics
Embedded data can capture the values of Google Analytics variables from your site and add them to your Qualtrics dataset. Once this data has been passed over to Qualtrics, you can use it with other features you may have access to, such as CX Dashboards and Stats iQ.
Qtip: Only the latest key values that were pushed to the data layer object can be added to your Qualtrics dataset. For example, if the key-value pairs{"currentPage": "shoppingCart"}and{"currentPage": "checkOut"}are pushed to the data layer in this order, then querying the data layer object for the key “currentPage” will result in “checkOut,” the latest value pushed for this key. If you would like a different value to be returned, then push that key-value pair again to the data layer.
Once this is set up, you will have a field in your survey data that stores the information captured from the intercept. You can use this field when reporting within Qualtrics and it will be present when you export your survey’s data.
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!