# Google Analytics

## Overview

We currently support integrations with Universal Analytics and Google Analytics 4 (GA4). This is a tag based integration and is managed using callbacks. Please see more details about callbacks [here](https://docs.pulseinsights.com/implementing-pulse-insights-dev/implementing-on-web-and-mobile-web/callbacks).&#x20;

{% hint style="warning" %}
Google Analytics 4 is replacing Universal Analytics. On July 1, 2023 all standard Universal Analytics properties will stop processing data. (360 Universal Analytics properties with a current order will receive a one-time processing extension ending on July 1, 2024.)
{% endhint %}

## What the integration accomplishes

Integrating with Google Analytics allows you to record survey response data and view responses alongside the rest of your data. &#x20;

For example you might:

* **Gain deeper insights**: Get a better understanding of customer behavior and how users are interacting with your website or application. Identify pain points, areas for improvement, and potential opportunities to enhance the user experience.
* **Make data-driven decisions**: Google Analytics is a powerful tool for tracking user behavior and engagement, but it's even more valuable when combined with customer feedback. By using both quantitative and qualitative data, you can make more informed decisions about how to optimize your digital channels and improve customer satisfaction.
* **Measure the impact of changes**: As you make changes to your website, you can understand how those changes are impacting user perceptions and behavior. By tracking customer feedback alongside analytics data, you can see how your enhancements are having the intended impacts.&#x20;
* **Identify trends and patterns**: Identify recurring themes and issues that may not be immediately apparent from analytics data alone. By analyzing feedback in conjunction with other metrics, you can gain a more holistic view of user behavior and preferences.
* **Improve customer satisfaction**: Ultimately, the goal of incorporating customer feedback into Google Analytics is to improve the overall customer experience. By understanding what users like and dislike about your website, your can make targeted improvements that lead to greater satisfaction, loyalty, and retention.

## Some ideas for what to analyze

* See how user's responses change per traffic source (e.g. organic, paid, referral) to learn about the audience quality and needs by channel.
* See how answers vary between first time visitors and returning visitors to understand the impact of the website itself on user perceptions.

## Integration Setup

When a user answers any Pulse Insights question, Pulse Insights will set an event in Google Analytics with the answer text of what the user's response. You can, in turn, create segments in GA based on the responses in order to analyze behavior. This level of analytics in GA4 requires some setup steps, both in your tag manager and in Google Analytics.

* **If you use Google Tag Manager (GTM)** please follow the steps in the [GTM Setup](#google-tag-manager-gtm-setup) section to:
  * [Create a Trigger](#first-create-a-trigger)
  * [Create a New Tag](#next-create-a-new-tag)

{% hint style="info" %}
If you do not use Google Tag Manager, please reach out to your Customer Success Manager for instructions.&#x20;
{% endhint %}

* **Setup steps are also required in Google Analytics.** Please reference the [Google Analytics Setup ](#google-analytics-setup)section to create a custom user dimension.&#x20;

## Google Tag Manager (GTM) Setup

### First, create a Trigger

While in your Google Tag Manager workspace:

1. Click **Triggers** from the left sidebar menu ![and then](https://lh3.googleusercontent.com/QbWcYKta5vh_4-OgUeFmK-JOB0YgLLoGh69P478nE6mKdfpWQniiBabjF7FVoCVXI0g=h36) **New**.

<figure><img src="https://563760996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkJBdddbwa2Hgh4yTRC5g%2Fuploads%2FzyE9U5vLKEfaTKcjaFTt%2Fimage.png?alt=media&#x26;token=01d2beb0-74de-4b63-905b-e9d43b16dc68" alt=""><figcaption></figcaption></figure>

2. Enter a name for the trigger: `Pulse_Insights_Surveys`
3. Click **Trigger Configuration** and choose the **Custom Event** trigger type (located in the "Other" group).

<figure><img src="https://563760996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkJBdddbwa2Hgh4yTRC5g%2Fuploads%2FonNnqy6BaiFDbMrUScX3%2Fimage.png?alt=media&#x26;token=d096c241-e3e6-4b90-94f7-7309022d494b" alt="" width="375"><figcaption></figcaption></figure>

4. Enter the Event Name: `SurveyAnswered`
5. Select "**use regex matching**" to allow this field to handle regular expressions.
6. For the "This trigger fires on", choose the "**Some Custom Events**" option.
7. Fire this trigger when an Event occurs and all of these conditions are true:
   * In the first dropdown, choose **Event**
   * In the second dropdown, choose **contains**
   * In the third box, enter `SurveyAnswered`
8. Click the **Save** button

**It should look something like this:**&#x20;

<figure><img src="https://563760996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkJBdddbwa2Hgh4yTRC5g%2Fuploads%2FV09mZ7FUlWaooBwPTjP7%2Fimage.png?alt=media&#x26;token=3351ea1d-8fdf-454c-b33b-4dd537892418" alt=""><figcaption></figcaption></figure>

### Define User-Defined Data Layer Variables

Before setting up event parameters, create the necessary Data Layer variables to be used in the GA4 Event tag. These variables will capture key survey response details and make them available for Google Tag Manager.

To create the user-defined Data Layer variables, use the following names:

<table><thead><tr><th>Variable Name</th><th></th><th data-hidden></th></tr></thead><tbody><tr><td><strong>DIV - survey_id</strong></td><td><code>eventModel.survey_id</code></td><td></td></tr><tr><td><strong>DIV - acc_identifier</strong></td><td><code>eventModel.acc_identifier</code></td><td></td></tr><tr><td><strong>DIV - question_id</strong></td><td><code>eventModel.question_id</code></td><td></td></tr><tr><td><strong>DIV - question_text</strong></td><td><code>eventModel.question_text</code></td><td></td></tr><tr><td><strong>DIV - answer_id</strong></td><td><code>eventModel.answer_id</code></td><td></td></tr><tr><td><strong>DIV - answer_text</strong></td><td><code>eventModel.answer_text</code></td><td></td></tr></tbody></table>

Once these variables are created, they will be available when setting up event parameters in the next step.

<figure><img src="https://563760996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkJBdddbwa2Hgh4yTRC5g%2Fuploads%2FgWMSG61KwB9Y2V2oPTuW%2Fimage.png?alt=media&#x26;token=7ddaa88c-8b2f-4cce-92dc-8dd36805407d" alt=""><figcaption></figcaption></figure>

### Next, create a new Tag

1. In your Workspace, click <img src="https://fonts.gstatic.com/s/i/short-term/release/googlesymbols/label/fill1/48px.svg" alt="" data-size="line"> **Tags** in the left sidebar menu.
2. To add a tag, click **New**.

<figure><img src="https://563760996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkJBdddbwa2Hgh4yTRC5g%2Fuploads%2F1RmWNZ610qcev0EdBKDk%2Fimage.png?alt=media&#x26;token=38830d4e-72d8-4dff-80ae-3e11aa73e44a" alt=""><figcaption></figcaption></figure>

3. Name the tag: `GA4-PulseInsights`
4. Click the edit icon in the Tag Configuration section and choose the tag type: \
   `Google Analytics: GA4 Event`

<figure><img src="https://563760996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkJBdddbwa2Hgh4yTRC5g%2Fuploads%2FDldEoWpnBggSikrBLjnb%2Fimage.png?alt=media&#x26;token=f4ae08b7-fd63-4d8d-999e-e0fd5653e306" alt=""><figcaption></figcaption></figure>

5. In the "Configuration Tag" dropdown menu and select your **GA 4 Config** tag.

{% hint style="info" %}
If you need more help configuring a Google Analytics 4 tag in Google Tag Manager, please refer to Google's guide [here](https://support.google.com/tagmanager/answer/9442095?sjid=6368941973364861334-NA).
{% endhint %}

6. In the Event Name field, enter `SurveyAnswered`

<figure><img src="https://563760996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkJBdddbwa2Hgh4yTRC5g%2Fuploads%2F8sBiIbLOXgEx2KipueFo%2Fimage.png?alt=media&#x26;token=d6372744-96da-4c75-a4da-bb081e63a701" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If you are asked to enter a Measurement ID, please refer to Google's guide for steps to find your Measurement ID, [here](https://support.google.com/analytics/answer/12270356). It should be a 'G-' followed by a combination of numbers and letters.
{% endhint %}

7. Set up the following Event Parameters:
   1. Click **Add Row**
   2. Type in the **Parameter Name** (please refer to the table below for Parameter names)
   3. Enter the corresponding **Value** (please refer to the table below for Value names)
   4. Click "**Add Row**" and repeat the steps until all six Event Parameters listed below are added.

<table><thead><tr><th>Parameter Name</th><th>Value</th><th data-hidden></th></tr></thead><tbody><tr><td>survey_id</td><td>{{DIV - survey_id}}</td><td></td></tr><tr><td>acc_identifier</td><td>{{DIV - acc_identifier}}</td><td></td></tr><tr><td>question_id</td><td>{{DIV - question_id}}</td><td></td></tr><tr><td>question_text</td><td>{{DIV - question_text}}</td><td></td></tr><tr><td>answer_id</td><td>{{DIV - answer_id}}</td><td></td></tr><tr><td>answer_text</td><td>{{DIV - answer_text}}</td><td></td></tr></tbody></table>

{% hint style="info" %}
If the Values shown in the table above do not show from the list of variable options, please contact your Customer Success Manager for help.&#x20;

You can also visit the Google support page for more details on [User-Defined Variables](https://support.google.com/tagmanager/topic/9125128?sjid=6368941973364861334-NA).&#x20;
{% endhint %}

8. Set up the following User Properties:
   1. Click **Add Row**
   2. Type in the **Property Name** (please refer to the table below for Property names)
   3. Enter the corresponding **Value** (please refer to the table below for Value names)
   4. Click "**Add Row**" and repeat the steps until all six User Properties listed below are added.

<table><thead><tr><th>Property Name</th><th>Value</th><th data-hidden></th><th data-hidden></th><th data-hidden></th></tr></thead><tbody><tr><td>survey_id</td><td>{{DIV - survey_id}}</td><td></td><td></td><td></td></tr><tr><td>acc_identifier</td><td>{{DIV - acc_identifier}}</td><td></td><td></td><td></td></tr><tr><td>question_id</td><td>{{DIV - question_id}}</td><td></td><td></td><td></td></tr><tr><td>question_text</td><td>{{DIV - question_text}}</td><td></td><td></td><td></td></tr><tr><td>answer_id</td><td>{{DIV - answer_id}}</td><td></td><td></td><td></td></tr><tr><td>answer_text</td><td>{{DIV - answer_text}}</td><td></td><td></td><td></td></tr></tbody></table>

{% hint style="info" %}
If the Values shown in the table above do not show from the list of user-defined variable options, please contact your Customer Success Manager for help.\
\
You can also visit the Google support page for more details on [User-Defined Variables](https://support.google.com/tagmanager/topic/9125128?sjid=6368941973364861334-NA).&#x20;
{% endhint %}

9. Lastly, in the Triggering section, click the edit icon, and choose the  `Pulse_Insights_Surveys` custom event (which was set up earlier in the [Create a Trigger](#first-create-a-trigger) section.
10. Click **Save**.

When you view this newly created tag, it should look something like:

<figure><img src="https://563760996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkJBdddbwa2Hgh4yTRC5g%2Fuploads%2Fdq868F2oPt0qort14fas%2Fimage.png?alt=media&#x26;token=457bd3ab-005e-40b6-8b4a-92cfd5048fc3" alt=""><figcaption></figcaption></figure>

<figure><img src="https://563760996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkJBdddbwa2Hgh4yTRC5g%2Fuploads%2FriquCcvmZjvw4SYbBlRG%2Fimage.png?alt=media&#x26;token=1d1aca8b-36d9-4988-bb22-02199b4fff8b" alt=""><figcaption></figcaption></figure>

***

## Google Analytics Setup:

This section documents how to create a custom user dimension using the `answer_text` and `answer_id` user properties.&#x20;

### Create Custom Dimensions

A custom dimension allows you to analyze survey answers alongside other data and metrics collected on your website or app. The user scoped custom dimension is built using custom user properties. To set up the custom dimension in Google Analytics:

1. Click on the gear icon to access the "**Admin**" settings in the left sidebar.

<figure><img src="https://563760996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkJBdddbwa2Hgh4yTRC5g%2Fuploads%2FepFB4SIjbZdhYUZ0L2Gx%2Fimage.png?alt=media&#x26;token=54d7ecb8-d239-49db-bacc-0501b053eea9" alt="" width="119"><figcaption></figcaption></figure>

2. Click on "**Custom definitions**".

<figure><img src="https://563760996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkJBdddbwa2Hgh4yTRC5g%2Fuploads%2FdRWzjCABmlP5Sjth9Hym%2Fimage.png?alt=media&#x26;token=e4e3f4a2-e40e-4af4-b8cd-734a8eb2cd23" alt=""><figcaption></figcaption></figure>

3. In the Custom dimensions tab the “**Create custom dimensions**” button.&#x20;

<figure><img src="https://563760996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkJBdddbwa2Hgh4yTRC5g%2Fuploads%2FjzUCR3HGQMHlMCEGvgtC%2Fimage.png?alt=media&#x26;token=7bd377b8-e3e7-47ba-8d46-62396bab9b0c" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
If you do not see this button this may mean that you do not have to proper access level to create custom dimensions. Please contact your Google Analytics Administrator.&#x20;
{% endhint %}

4. Fill out the form fields as follows:

<table><thead><tr><th>Field Name</th><th width="134.33333333333331">Value</th><th>Description</th></tr></thead><tbody><tr><td><strong>Dimension Name</strong></td><td>Pulse Insights Answer Text</td><td>Type in the unique name of "Pulse Insights Answer Text" without hyphens. </td></tr><tr><td><strong>Scope</strong></td><td>User</td><td>Choose "User" from the dropdown menu. </td></tr><tr><td><strong>Description</strong></td><td>Pulse Insights Answer Text captured at the user level</td><td>This short description will help you and others have context for what the custom dimension is. </td></tr><tr><td><strong>User Property</strong></td><td>answer_text</td><td>Choose from the dropdown. Dropdown options, such as <code>answer_text</code> are set up as User Properties in the Google tag or in Google Tag Manager. <a href="#google-tag-manager-gtm-setup">See instructions above</a>.</td></tr></tbody></table>

<figure><img src="https://563760996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkJBdddbwa2Hgh4yTRC5g%2Fuploads%2FAs4ftkktAX6LNtT4QD0w%2Fimage.png?alt=media&#x26;token=3777fb69-f657-4236-9613-74527a69ab42" alt=""><figcaption></figcaption></figure>

5. Click the "**Save**" button in the top right.&#x20;

### Next, create the Pulse Insights Answer ID dimension.

This dimension will enable you to correlate the answer text with the answer's unique ID. This is especially helpful if you have similar answer choices in multiple questions within a survey or in a different survey.  &#x20;

1. Repeat steps 1-3 above and fill out the form as follows:

| Field Name         | Value                                                                                         | Description                                                                                                                                                                                        |
| ------------------ | --------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Dimension Name** | Pulse Insights Answer ID                                                                      | Type in the unique name of "Pulse Insights Answer ID" without hyphens.                                                                                                                             |
| **Scope**          | User                                                                                          | Choose "User" from the dropdown menu.                                                                                                                                                              |
| **Description**    | Unique number that is associated with one and only one answer in the Pulse Insights database. | This short description will help you and others have context for what the custom dimension is.                                                                                                     |
| **User Property**  | answer\_id                                                                                    | Choose from the dropdown. Dropdown options, such as `answer_id` are set up as User Properties in the Google tag or in Google Tag Manager. [See instructions above](#google-tag-manager-gtm-setup). |

2. Click the "**Save**" button in the top right.&#x20;

<figure><img src="https://563760996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkJBdddbwa2Hgh4yTRC5g%2Fuploads%2FnRvddypFiLPWhEGi1qgK%2Fimage.png?alt=media&#x26;token=fcfa17e2-a7f8-4b04-b693-ef359199b6eb" alt=""><figcaption></figcaption></figure>

### You can now add the custom dimensions as a "Comparison" in Reports:

1. On the Reports page, click the "**Add Comparison +**" button

<figure><img src="https://563760996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkJBdddbwa2Hgh4yTRC5g%2Fuploads%2FQZS0KonsMYQVUhWGPAA0%2Fimage.png?alt=media&#x26;token=87731983-1e52-4164-a8ed-88b0d5b4347a" alt="" width="399"><figcaption></figcaption></figure>

2. Select a custom dimension from the dropdown menu
3. Select a dimension value from the dropdown menu

You can add up to 5 dimensions. To add another dimension, click the "**+ Add new condition**" button. Click the trash icon to remove a condition.&#x20;

<figure><img src="https://563760996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkJBdddbwa2Hgh4yTRC5g%2Fuploads%2F0JITePCgONlcX69VIqLB%2Fimage.png?alt=media&#x26;token=d0b5c95b-1cb7-470a-a0c7-5570d2dfc1fd" alt="" width="237"><figcaption></figcaption></figure>

4. Click "**Apply**"

<figure><img src="https://563760996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkJBdddbwa2Hgh4yTRC5g%2Fuploads%2FiLMtOwcOPRpky94fWMkM%2Fimage.png?alt=media&#x26;token=6940e258-e755-4c41-95f2-54d9741b2e80" alt="" width="257"><figcaption><p>Add Pulse Insights custom dimensions as a comparison in Reports</p></figcaption></figure>

### Or as a "Dimension" in Explorations:

<figure><img src="https://563760996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkJBdddbwa2Hgh4yTRC5g%2Fuploads%2FXszdnxvu9fgXBGMk4EZP%2Fimage.png?alt=media&#x26;token=68bac0d6-fbd2-4ff6-ac62-2220e2759d3b" alt="" width="563"><figcaption><p>Add Pulse Insights Survey as a dimension in Explorations</p></figcaption></figure>

{% hint style="warning" %}
Note: You will see a value of [(not set)](https://support.google.com/analytics/answer/11151150) for a custom dimension in the first 48 hours. Any survey responses collected before creating the custom dimension will not be set. Be sure to create the custom dimension before setting the survey live.
{% endhint %}

### Data Availability in Google Analytics

Before you can analyze survey response data and run comparisons, the survey must be **live and actively collecting responses**. Data typically takes **24–48 hours** to appear in Google Analytics due to standard GA processing times. This delay is a Google Analytics requirement and not specific to Pulse Insights.

If you do not see data immediately, please check back after 48 hours and ensure the survey is receiving responses.
