Using Google Analytics with Website Feedback
What's on This Page:
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 Feedback data together, 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. You can bring together Google and Qualtrics data in a variety of ways depending on your specific needs.
Using Google Analytics Data 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 JavaScript expression condition, you can determine the correct Google Analytics criteria that users must meet before they are presented with the intercept.
Google Analytics Expressions in Targeting Logic
- Add an intercept by using guided intercept authoring or by creating a standalone intercept.
Qtip: Guided intercept authoring will provide you assistance throughout the whole process. If you use the guided setup, you will be prompted to add a creative, connect your survey, and configure your intercept.
- On either the intercept targeting-level or the action set-level, add logic.Qtip: Clicking Add targeting logic adds the logic to the entire intercept, so you don’t have to add the logic to each individual action set.
- Drop the first field down.
- Hover over Website, and select JavaScript Expression.
- Enter the JavaScript expression you would like to use for your logic.Example: The logic in the screenshots above, set as “If JavaScript Expression dataLayer[0].contentTitle is Equal to The future of telehealth,” will only allow this intercept to appear to visitors who are on the page set in Google Analytics as “The future of telehealth.”Qtip: If you have set up the data layer and the values are available at the time that Qualtrics targeting logic is evaluated, you can use JavaScript expressions such as dataLayer[0].pageType and dataLayer[0].contentTitle.
- Indicate whether you are targeting visitors whose value is Equal To or Not Equal To what you specify in the next step.
- Enter the value the JavaScript expression should return.
Google Tag Manager Expressions in Targeting Logic
You can access the pushed data via the Google Tag Manager expressions. The variable part will be the container id of your Google Tag Manager container. In order to access pushed data, you should use the container-id that is used for the data layer.

Once you have validated that the above JavaScript expression retrieves your expected value, you can add it as JavaScript expression targeting logic.
- Add an intercept by using guided intercept authoring or by creating a standalone intercept.
Qtip: Guided intercept authoring will provide you assistance throughout the whole process. If you use the guided setup, you will be prompted to add a creative, connect your survey, and configure your intercept.On either the intercept targeting-level or the action set-level, add logic.
- On either the intercept targeting-level or the action set-level, add logic.Qtip: Clicking Add targeting logic adds the logic to the entire intercept, so you don’t have to add the logic to each individual action set.
- Drop the first field down.
- Hover over Website, and select JavaScript Expression.
- Enter the JavaScript expression you would like to use for your logic.Example: The logic in the screenshots above, set as “If JavaScript Expression dataLayer[0].contentTitle is Equal to The future of telehealth,” will only allow this intercept to appear to visitors who are on the page set in Google Analytics as “The future of telehealth.”Qtip: If you have set up the data layer and the values are available at the time that Qualtrics targeting logic is evaluated, you can use JavaScript expressions such as dataLayer[0].contentTitle and google_tag_manager[‘GTM-W6F8HX’].dataLayer.get(‘contentTitle’).
-
Indicate whether you are targeting visitors whose value is Equal To or Not Equal To what you specify in the next step.
- Enter the value the JavaScript expression should return.
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 data set.
- On any action, click Options.
- Select Embedded Data.
- Type in a variable name of your choosing. This variable name will appear as the name of the embedded data field in your Qualtrics survey data.
- Select Value from JavaScript as the value.
- Enter the value of the JavaScript expression for your Google Analytics variable.
Qtip: You can work with your web development team or inspect the web page within your browser in order to determine which Javascript expressions to use for the logic set. This expression may look like dataLayer[0].contentTitle or google_tag_manager[‘GTM-W6F8HX’].dataLayer.get(‘contentTitle’).
- Click Save.
- Select View survey.
- You will be taken to the intercept’s target survey.
- Open the Survey Flow.
- Click Add a New Element.
- Select Embedded Data.
- For the field name, enter in the name you chose in Step 3. Make sure that all formatting of the field name is identical here to the name you set in the intercept options.
- Click and hold down Move to drag the element to the top of the survey flow.
- Click Save Flow.
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.