> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usertick.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Analytics, FullStory and UXCam

> When a visitor completes a survey on your site, the widget sends an event to Google Analytics, FullStory or UXCam through the tool's own script on the page.

Google Analytics, FullStory and UXCam already run on your pages, so Usertick doesn't connect to them with a key. Instead, the widget tells them about each completed survey in the visitor's browser, through the tool's own script. The setting is switched on per site and works on every plan.

The event carries the survey ID, the response ID and the score, but never answers or personal data.

## Switch it on

**1. Open the tool**

In **Settings → Integrations**, select **Google Analytics**, **FullStory** or **UXCam**. The panel asks for no key or ID, because nothing needs to be connected.

**2. Turn on the sites**

Under **Sites**, turn on the switch for each site that should send the event. Each switch shows the site's domain and "Send survey responses to Google Analytics on this site".

A tool that is on for at least one site appears under **Connected** on the Integrations page, marked **On**, with the names of those sites.

Opening **Settings → Integrations** requires the **Manage integrations** permission, and changing a site's switch also requires **Manage sites**. A member without **Manage sites** sees **On** or **Off** beside each site instead of a switch.

## What the tool receives

When a visitor completes a survey on a site with the tool switched on, the widget sends the tool one event, if the tool is already loaded on that page. The widget never loads a tool's script itself.

The event fires right after the visitor submits, once the response is on its way to Usertick. A response that the widget keeps in the browser to send later, because the connection dropped, fires the event too.

| Tool | How the widget sends it | Event name |
| - | - | - |
| Google Analytics | `gtag('event', ...)`. Without `gtag`, `dataLayer.push(...)` when Google Tag Manager's `dataLayer` is on the page | `usertick_survey_response` |
| FullStory | `FS('trackEvent', ...)`. If your site renamed FullStory's `FS` global, the widget uses the name in `window._fs_namespace` | `Usertick survey response` |
| UXCam | `uxc.event(...)` | `Usertick survey response` |

Each tool receives the same fields:

| Field | What it holds |
| - | - |
| `survey_id` | The survey's ID |
| `response_id` | The response's ID in Usertick |
| `score` | A number: the first answered NPS question, else the first answered rating question. Left out when the response has neither |

The event carries nothing else about the response or the person, such as answers, an email or a user ID.

For Google Analytics with `gtag`, the call looks like this:

```js theme={null}
gtag('event', 'usertick_survey_response', {
  survey_id: '8d2f6c1e-4b7a-4e0b-9c35-1f6a2d9e7b40',
  response_id: 'c41e9a07-5d2b-4f8e-a6c3-0b9e7d1f2a58',
  score: 9,
});
```

## When nothing is sent

The widget sends no event in these cases:

* The tool isn't on the page: there is no `gtag` or `dataLayer` for Google Analytics, no `FS` for FullStory and no `uxc` for UXCam.
* The survey has **Anonymous responses** on.
* The survey is a link, QR code or email survey, which runs on Usertick's own survey page instead of your site.
* Usertick refused the response, so the form stays open.
* The survey runs as a preview in the editor.

Each tool receives one event per response, never two. Because the event names no one, the site's **Send user identity with responses** setting doesn't affect it.

## Google Analytics

### With Google Tag Manager

When the page has `gtag`, the widget calls it. When the page has only Google Tag Manager, the widget pushes the event into the `dataLayer` as `{ event: 'usertick_survey_response', survey_id, response_id, score }`. Tag Manager does nothing with it until a tag uses it:

**1. Add a trigger**

In Tag Manager, create a trigger of the type **Custom Event**, with the event name `usertick_survey_response`.

**2. Add the variables**

Create a **Data Layer Variable** for each of `survey_id`, `response_id` and `score`.

**3. Add the tag**

Create a **Google Analytics: GA4 Event** tag with the event name `usertick_survey_response`, add the three variables as event parameters under the same names, and fire it on the trigger.

**4. Publish**

Submit and publish the container.

### Show the fields in your reports

Google Analytics keeps every parameter, but its reports show only the ones that are registered. To show the survey and the response, open **Admin** → **Custom definitions** in Google Analytics and create a custom dimension with the scope **Event** for `survey_id` and for `response_id`, using the exact parameter names. To average or sum the score, register `score` as a custom metric. A custom definition fills only from the day it is created.

To check the setup, complete a survey on your site and look for `usertick_survey_response` in the **Realtime** report.

## FullStory

FullStory records the event in the session it is recording on that page, as "Usertick survey response" with the three fields as its properties. The event helps find the sessions where someone completed a survey. The answers stay in Usertick, where the response opens by its `response_id`.

## UXCam

UXCam records the event in its session on that page, as "Usertick survey response" with the three fields as its properties. The widget runs on websites, so the event requires UXCam's web script on the page. UXCam sessions in mobile apps don't receive it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.