---
title: Data Schema - Data Connect
description: Understanding the data schema and structure of Data Connect tables in your data warehouse
lastUpdated: 20 April 2026
source_url:
  html: https://docs.contentsquare.com/en/connect/data-schema/
  md: https://docs.contentsquare.com/en/connect/data-schema/index.md
---

> Documentation index: https://docs.contentsquare.com/llms.txt
> Use this file to discover all available pages before exploring further.

Data Connect creates the following tables in your data warehouse, each representing a different aspect of user behavior data. Understanding this schema is essential for effective analysis and joining with other data sources.

Data Connect adopts a hierarchical schema. By default, Data Connect will sync the following tables:

* One users table (for all user information)
* One sessions table (for all session information)
* One pageviews table (for all pageview information)

S3 format differences

When syncing to S3, timestamp columns are stored in UNIX timestamp format (milliseconds since epoch) rather than native timestamp types. You'll need to convert these during your ETL process. See [Amazon S3](https://docs.contentsquare.com/en/connect/amazon-s3/) for more details.

## Time-related columns

Several columns across tables track time in different ways. Understanding their differences is important for writing accurate queries.

| Column | Table | Meaning |
| - | - | - |
| `time` | sessions | Timestamp when the session started. Use for session-level date filters. |
| `time` | events | Timestamp when the event occurred. |
| `session_time` | events | Seconds elapsed since the session started. Use for analyzing event timing within a session (for example, `WHERE session_time <= 60` to find events in the first minute). |
| `joindate` | users | Timestamp when the user was first seen. Use for cohort analysis and user lifetime calculations. |

S3 timestamp format

In S3, `time` and `joindate` are stored as UNIX timestamps in milliseconds. Divide by 1000 before converting to a timestamp type. See [Amazon S3](https://docs.contentsquare.com/en/connect/amazon-s3/#data-types-and-formats) for details.

```sql
-- Find users and their first action within 30 seconds of session start
SELECT u.user_id, u.joindate, e.event_table_name, e.session_time
FROM users u
JOIN all_events e ON u.user_id = e.user_id
WHERE e.session_time <= 30
ORDER BY u.joindate DESC;
```

## Core tables

### users

The `users` table contains a row for each unique user that has visited your site.

| Column Name | Type | Description |
| - | - | - |
| `user_id` | BIGINT | Unique ID of user, randomly generated by Contentsquare (CSQ). |
| `identity` | TEXT | User's username or other unique token, passed [identify](https://docs.contentsquare.com/en/web/command-reference/#identify). Must be unique. |
| `handle` | TEXT | User's username or other unique token, passed [identify](https://docs.contentsquare.com/en/web/command-reference/#identify). |
| `email` | TEXT | User's email address, passed in via [addUserProperties](https://docs.contentsquare.com/en/web/command-reference/#adduserproperties) API. |
| `joindate` | TIMESTAMP | Timestamp without time zone of when the user was first seen. In S3, this is in UNIX timestamp format. |
| `last_modified` | TIMESTAMP | Timestamp without time zone of when the user's data was last modified. In S3, this is in UNIX timestamp format. |
| user properties | TEXT | There will be one column for every unique user property you've sent via the [addUserProperties](https://docs.contentsquare.com/en/web/command-reference/#adduserproperties) API (name, gender, account status, etc). The column type is automatically inferred from the underlying property values. |

### sessions

The `sessions` table represents individual user sessions.

| Column Name | Type | Description |
| - | - | - |
| `event_id` | BIGINT | ID of associated session event, randomly generated by CSQ. |
| `user_id` | BIGINT | ID of associated user, randomly generated by CSQ. |
| `session_id` | BIGINT | ID of associated session, randomly generated by CSQ. |
| `time` | TIMESTAMP | Timestamp without time zone of when session started. |
| `library` | TEXT | Version of Contentsquare library which began the session. Can be one of "web" or "iOS". |
| `platform` | TEXT | User's operating system. |
| `device_type` | TEXT | Device type. Can be one of: Mobile, Desktop, or Tablet. |
| `country` | TEXT | Country in which user session occurred, based on IP. |
| `region` | TEXT | Region in which user session occurred, based on IP. |
| `city` | TEXT | City in which user session occurred, based on IP. |
| `referrer` | TEXT | URL that linked to your site and initiated the session. If the user navigated directly to your site, or referral headers were stripped, then this value will appear as NULL downstream and as `direct` in the UI. |
| `landing_page` | TEXT | URL of the first pageview of the session. |
| `browser` | TEXT | User's browser. |
| `utm_source` | TEXT | GA-based utm\_source tag associated with the session's initial pageview. |
| `utm_campaign` | TEXT | GA-based utm\_campaign tag associated with the session's initial pageview. |
| `utm_medium` | TEXT | GA-based utm\_medium tag associated with the session's initial pageview. |
| `utm_term` | TEXT | GA-based utm\_term tag associated with the session's initial pageview. |
| `utm_content` | TEXT | GA-based utm\_content tag associated with the session's initial pageview. |
| Custom variables | TEXT | One column is created for every unique custom variable key you've attached. The column type is automatically inferred from the underlying property values. |
| `session_replay_link` | TEXT | Contentsquare Platform url link of the session replay. |
| `session_duration` | TEXT | Total duration of the session. |
| `session_language` | TEXT | Language displayed during the session. |
| `session_number_of_views` | TEXT | The number of page views in the session. |
| `frustration_score` | TEXT | Measure of user frustration during the session. |
| `looping_Index` | TEXT | The proportion of same urls visited during the session (meaning the user is doing back & forth). |
| `page_consumption` | TEXT | Proportion of pages where the user spent less than 2s and did less than 2 clicks. |
| `filtered_APV` | TEXT | Number of views in which APVs (Artificial Pageviews) are not counted / a boolean determining whether a given page view is an Artificial Page view. |

### pageviews

The `pageviews` table contains detailed information about each pageview.

| Column Name | Type | Description |
| - | - | - |
| `event_id` | BIGINT | ID of associated pageview event. |
| `user_id` | BIGINT | Unique ID of associated user, randomly generated by CSQ. |
| `session_id` | BIGINT | Unique ID of associated session, randomly generated by CSQ. |
| `time` | TIMESTAMP | Timestamp without time zone of when the pageview occurred. |
| `library` | TEXT | Version of Contentsquare library which started the session. Can be one of "web" or "iOS". |
| `platform` | TEXT | User's operating system. |
| `device_type` | TEXT | Device type. Can be one of: Mobile, Desktop, or Tablet. |
| `country` | TEXT | Country in which user session occurred, based on IP. |
| `region` | TEXT | Region in which user session occurred, based on IP. |
| `city` | TEXT | City in which user session occurred, based on IP. |
| `referrer` | TEXT | URL that linked to your site and started the session. If the user navigated directly to your site, or referral headers were stripped, then this value will appear as NULL downstream and as `direct` in the UI. |
| `landing_page` | TEXT | URL of the first pageview of the session. |
| `browser` | TEXT | User's browser. |
| `utm_source` | TEXT | GA-based utm\_source tag associated with the session's initial pageview. |
| `utm_campaign` | TEXT | GA-based utm\_campaign tag associated with the session's initial pageview. |
| `utm_medium` | TEXT | GA-based utm\_medium tag associated with the session's initial pageview. |
| `utm_term` | TEXT | GA-based utm\_term tag associated with the session's initial pageview. |
| `utm_content` | TEXT | GA-based utm\_content tag associated with the session's initial pageview. |
| `path` | TEXT | The path of the pageview. |
| `query` | TEXT | The query parameters associated with the pageview. |
| `hash` | TEXT | The hash parameters associated with the pageview. |
| `title` | TEXT | Title of the current page. |
| Custom variables | TEXT | One column is created for every unique custom variable key you've attached. The column type is automatically inferred from the underlying property values. |
| Dynamic variables | TEXT | One column is created for every unique dynamic variable key you've attached. The column type is automatically inferred from the underlying property values. |
| `view_number` | TEXT | The pageview number in the session. |
| `is_first` | TEXT | If the page is the entry page then value is 1 otherwise value is 0. |
| `is_last` | TEXT | If the page is the exit page then value is 1, otherwise value is 0. |
| `scroll_rate` | TEXT | The portion of the page which was displayed (in percentage points). |
| `view_duration_msec` | TEXT | Duration between the page view event time (view\_time) and the timestamp of the last interaction event (in milliseconds). |
| `first_input_delay` | TEXT | Delay (in milliseconds) between the first user interaction and when the web browser can handle it (part of Core Web Vitals). |
| `interaction_to_next_paint` | TEXT | Longest visual delay (in milliseconds) experienced by a user when interacting with the page (clicks or keystrokes). |
| `time_to_first_byte` | TEXT | Delay (in milliseconds) between the request for the web page and when the web browser received the first piece of data. |
| `largest_contentful_paint` | TEXT | Delay (in milliseconds) to render the largest piece of content (part of Core Web Vitals). |
| `cumulative_layout_shift` | TEXT | Score about the layout stability of the page rendering (part of Core Web Vitals). |
| `dom_interactive_after_msec` | TEXT | The time in milliseconds required before the user is able to interact with the page (although all resources may not be fully loaded yet). |
| `fully_loaded` | TEXT | The time in milliseconds required to fully load all the resources of the page, from initiation of the pageview to load completion in the browser. |
| `first_contentful_paint` | TEXT | Delay (in milliseconds) to render the first piece of content. |
| `start_render` | TEXT | Timestamp sent by tag when the rendering of the page started. |
| `window_height` | TEXT | Height of the window in which the page is opened. |
| `window_width` | TEXT | Width of the window in which the page is opened. |
| `session_replay_link` | TEXT | Contentsquare Platform url link of the session replay. |

## Event tables

### events

Contentsquare will create one table for every labeled event you've created within Contentsquare and synced downstream. See how to [create, manage, and sync Events ↗](https://support.contentsquare.com/hc/en-us/articles/39322036577553-How-to-create-manage-and-sync-Events-in-Data-Connect).

| Column Name | Type | Description |
| - | - | - |
| `event_id` | BIGINT | ID of the associated event, randomly generated by CSQ. |
| `user_id` | BIGINT | Unique ID of the associated user, randomly generated by CSQ. |
| `session_id` | BIGINT | Unique ID of the associated session, randomly generated by CSQ. |
| `pageview_id` | BIGINT | Unique ID of the associated page, randomly generated by CSQ. |
| `time` | TIMESTAMP | Timestamp without time zone of when the event happened. |
| `type` | TEXT | For web autocaptured events, can be any of view page, click, submit, change, with push state events registered as view page events. For custom events, this will be the custom event name. |
| `library` | TEXT | Version of Contentsquare library on which event occurred. Can be one of "web", "iOS", or "server". |
| `platform` | TEXT | User's operating system. |
| `device_type` | TEXT | Device type. Can be one of: Mobile, Desktop, or Tablet. |
| `country` | TEXT | Country in which user session occurred, based on IP. |
| `region` | TEXT | Region in which user session occurred, based on IP. |
| `city` | TEXT | City in which user session occurred, based on IP. |
| `referrer` | TEXT | URL that linked to your site and started the session. If the user navigated directly to your site, or referral headers were stripped, then this value will appear as NULL downstream and as `direct` in the UI. |
| `landing_page` | TEXT | URL of the first pageview of the session. |
| `landing_page_query` | TEXT | The query parameters of the first page of the user's session. |
| `landing_page_hash` | TEXT | The hash route of the first page of the user's session. |
| `browser` | TEXT | User's browser. |
| `utm_source` | TEXT | GA-based utm\_source tag associated with the session's initial pageview. |
| `utm_campaign` | TEXT | GA-based utm\_campaign tag associated with the session's initial pageview. |
| `utm_medium` | TEXT | GA-based utm\_medium tag associated with the session's initial pageview. |
| `utm_term` | TEXT | GA-based utm\_term tag associated with the session's initial pageview. |
| `utm_content` | TEXT | GA-based utm\_content tag associated with the session's initial pageview. |
| `domain` | TEXT | Domain including subdomain, e.g. blog.company.io. |
| `path` | TEXT | Portion of the current URL following your domain, e.g. /docs for company.io/docs. |
| `hash` | TEXT | Portion of the current URL following the hash sign, e.g. #install for company.io/docs#install. |
| `query` | TEXT | Query params of the page's current URL, e.g. ?utm\_id=1234 for company.io?utm\_id=1234. |
| `title` | TEXT | Title of the current page. |
| `href` | TEXT | href property of link (used for clicks on anchor tags). |
| `target_text` | TEXT | Button text of the event target. |

### `all_events`

Table Does Not Sync For S3. The `all_events` table does not sync for S3. You can create an `all_events` view of all synced tables after the data synced to S3 has gone through ETL processing.

| Column Name | Type | Description |
| - | - | - |
| `event_id` | BIGINT | ID of associated event, randomly generated by Contentsquare. |
| `user_id` | BIGINT | Unique ID of associated user, randomly generated by Contentsquare. |
| `session_id` | BIGINT | Unique ID of associated session, randomly generated by Contentsquare. |
| `time` | TIMESTAMP | Timestamp without time zone of when event happened. |
| `event_table_name` | TEXT | Name of the table where similar events can be found. |

#### Primary Key Considerations

The `all_events` table is a **UNION** of all individual event tables. Because a single event can qualify for multiple event definitions, the same `event_id` may appear multiple times in this table with different `event_table_name` values.

**For data warehouses (Redshift, BigQuery, Snowflake):**

* The composite primary key for `all_events` should be: `(user_id, event_id, event_table_name)`
* Individual event tables can use: `(user_id, event_id)`

**For S3:**

* You must handle deduplication in your ETL process after identity resolution
* Use the same composite key pattern when creating views

See [Troubleshooting](https://docs.contentsquare.com/en/connect/troubleshooting/#why-are-there-duplicate-event-ids-in-the-all-events-view-in-my-data-warehouse) for more information about duplicate event IDs.

BigQuery Limitations

In most cases, the schema for the `all_events` view will consist of the union of all columns from all event tables, with nulls filled in where applicable. However, if you are syncing many tables to your project, this can run into BigQuery query length limits, in which case we'll fall back to one of the following reduced column sets:

* All built-in Contentsquare columns that is `event_view_name` and columns contained in the pageviews/sessions tables
* Basic columns - `event_view_name`, `user_id`, `event_id`, `session_id`, time

If your `all_events` view is created with a reduced column set, you can join it with the underlying event views to access any property columns that are not available in the view.

### `ecommerce_transactions`

The `ecommerce_transactions` table contains information about e-commerce transactions.

| Column Name | Type | Description |
| - | - | - |
| `event_id` | BIGINT | ID of associated session event, randomly generated. |
| `user_id` | BIGINT | ID of associated user, randomly generated. |
| `session_id` | BIGINT | ID of associated session, randomly generated. |
| `time` | TIMESTAMP | Timestamp without time zone of when the pageview occurred. |
| `library` | TEXT | Version of Contentsquare library which began the session. "web" or "iOS". |
| `platform` | TEXT | User's operating system. |
| `country` | TEXT | Country in which user session occurred, based on IP. |
| `region` | TEXT | Region in which user session occurred, based on IP. |
| `city` | TEXT | City in which user session occurred, based on IP. |
| `referrer` | TEXT | URL that linked to your site and initiated the session. If the user navigated directly to your site, or referral headers were stripped, then this value will appear as NULL downstream and as `direct` in the UI. |
| `type` | TEXT | E-commerce transaction. |
| `device_type` | TEXT | Device type. Can be one of: Mobile, Desktop, or Tablet. |
| `transaction_amount` | TEXT | The total monetary value of a purchase or payment made by a user during a session. |
| `transaction_currency` | TEXT | The currency in which the transaction amount was processed. |

## Error tables

### `api_errors`

Experience Monitoring

The `api_errors` table contains information about API errors detected during user sessions.

| Column Name | Type | Description |
| - | - | - |
| `event_id` | BIGINT | ID of associated event, randomly generated. |
| `user_id` | BIGINT | ID of associated user, randomly generated. |
| `session_id` | BIGINT | ID of associated session, randomly generated. |
| `pageview_id` | BIGINT | Unique ID of the associated page, randomly generated by CSQ. |
| `time` | TIMESTAMP | Timestamp without time zone of when the event happened. |
| `library` | TEXT | Version of Contentsquare library which began the session. "web" or "iOS". |
| `platform` | TEXT | User's operating system. |
| `device_type` | TEXT | Device type. Can be one of: Mobile, Desktop, or Tablet. |
| `country` | TEXT | Country in which user session occurred, based on IP. |
| `region` | TEXT | Region in which user session occurred, based on IP. |
| `city` | TEXT | City in which user session occurred, based on IP. |
| `landing_page` | TEXT | URL of the first pageview of the session. |
| `api_error_duration` | TEXT | Time taken to resolve API error. |
| `api_error_endpoint` | TEXT | URL where API errors are reported. |
| `api_error_method` | TEXT | Standardized communication of API error responses. |
| `api_error_status_code` | TEXT | Numerical code identifying API error. |
| `errors_after_clicks` | TEXT | Issue occurring post-user interaction (boolean). |
| `error_group_id` | TEXT | Identifier for categorizing related errors. |
| `error_source` | TEXT | Origin point of the reported error. |
| `type` | TEXT | API error. |
| `referrer` | TEXT | URL that linked to your site and initiated the session. If the user navigated directly to your site, or referral headers were stripped, then this value will appear as NULL downstream and as `direct` in the UI. |

### `js_errors`

Experience Monitoring

The `js_errors` table contains information about JavaScript errors detected during user sessions.

| Column Name | Type | Description |
| - | - | - |
| `event_id` | BIGINT | ID of associated session event, randomly generated. |
| `user_id` | BIGINT | ID of associated user, randomly generated. |
| `session_id` | BIGINT | ID of associated session, randomly generated. |
| `pageview_id` | BIGINT | Unique ID of the associated page, randomly generated by CSQ. |
| `time` | TIMESTAMP | Timestamp without time zone of when the event happened. |
| `library` | TEXT | Version of Contentsquare library which began the session. "web" or "iOS". |
| `platform` | TEXT | User's operating system. |
| `device_type` | TEXT | Device type. Can be one of: Mobile, Desktop, or Tablet. |
| `country` | TEXT | Country in which user session occurred, based on IP. |
| `region` | TEXT | Region in which user session occurred, based on IP. |
| `city` | TEXT | City in which user session occurred, based on IP. |
| `landing_page` | TEXT | URL of the first pageview of the session. |
| `error_message` | TEXT | Description of the encountered error. |
| `error_line_number` | TEXT | Line in the code where the error occurred. |
| `js_error_file_name` | TEXT | File name containing the JavaScript error. |
| `js_error_column_number` | TEXT | Column in the file where the error occurred. |
| `errors_after_clicks` | TEXT | Issue occurring post-user interaction (boolean). |
| `error_group_id` | TEXT | Identifier for categorizing related errors. |
| `error_source` | TEXT | Origin point of the reported error. |
| `type` | TEXT | JS error. |
| `referrer` | TEXT | URL that linked to your site and initiated the session. If the user navigated directly to your site, or referral headers were stripped, then this value will appear as NULL downstream and as `direct` in the UI. |

### `custom_errors`

Experience Monitoring

The `custom_errors` table contains information about custom errors detected during user sessions.

| Column Name | Type | Description |
| - | - | - |
| `event_id` | BIGINT | ID of associated session event, randomly generated. |
| `user_id` | BIGINT | ID of associated user, randomly generated. |
| `session_id` | BIGINT | ID of associated session, randomly generated. |
| `pageview_id` | BIGINT | Unique ID of the associated page, randomly generated by CSQ. |
| `time` | TIMESTAMP | Timestamp without time zone of when the event happened. |
| `library` | TEXT | Version of Contentsquare library which began the session. "web" or "iOS". |
| `platform` | TEXT | User's operating system. |
| `device_type` | TEXT | Device type. Can be one of: Mobile, Desktop, or Tablet. |
| `country` | TEXT | Country in which user session occurred, based on IP. |
| `region` | TEXT | Region in which user session occurred, based on IP. |
| `city` | TEXT | City in which user session occurred, based on IP. |
| `landing_page` | TEXT | URL of the first pageview of the session. |
| `error_message` | TEXT | Description of the encountered error. |
| `errors_after_clicks` | TEXT | Issue occurring post-user interaction (boolean). |
| `error_group_id` | TEXT | Identifier for categorizing related errors. |
| `error_source` | TEXT | Origin point of the reported error. |
| `type` | TEXT | Custom Error. |
| `referrer` | TEXT | URL that linked to your site and initiated the session. If the user navigated directly to your site, or referral headers were stripped, then this value will appear as NULL downstream and as `direct` in the UI. |

### `console_message`

Experience Monitoring

The `console_message` table contains information about console messages detected during user sessions.

| Column Name | Type | Description |
| - | - | - |
| `event_id` | BIGINT | ID of associated session event, randomly generated. |
| `user_id` | BIGINT | ID of associated user, randomly generated. |
| `session_id` | BIGINT | ID of associated session, randomly generated. |
| `pageview_id` | BIGINT | Unique ID of the associated page, randomly generated by CSQ. |
| `time` | TIMESTAMP | Timestamp without time zone of when the event happened. |
| `library` | TEXT | Version of Contentsquare library which began the session. "web" or "iOS". |
| `platform` | TEXT | User's operating system. |
| `device_type` | TEXT | Device type. Can be one of: Mobile, Desktop, or Tablet. |
| `country` | TEXT | Country in which user session occurred, based on IP. |
| `region` | TEXT | Region in which user session occurred, based on IP. |
| `city` | TEXT | City in which user session occurred, based on IP. |
| `landing_page` | TEXT | URL of the first pageview of the session. |
| `error_message` | TEXT | Description of the encountered error. |
| `errors_after_clicks` | TEXT | Issue occurring post-user interaction (boolean). |
| `error_group_id` | TEXT | Identifier for categorizing related errors. |
| `error_source` | TEXT | Origin point of the reported error. |
| `type` | TEXT | Console Message. |
| `referrer` | TEXT | URL that linked to your site and initiated the session. If the user navigated directly to your site, or referral headers were stripped, then this value will appear as NULL downstream and as `direct` in the UI. |

## Frustration tables

Data Connect creates one table per frustration signal type, each prefixed with `frustration_events_`. All frustration tables share a common set of columns, with a few table-specific columns listed under each table.

### Common columns (all `frustration_events_*` tables)

| Column Name | Type | Description |
| - | - | - |
| `event_id` | BIGINT | ID of the associated event, randomly generated by Contentsquare. |
| `user_id` | BIGINT | Unique ID of the associated user, randomly generated by Contentsquare. |
| `session_id` | BIGINT | Unique ID of the associated session, randomly generated by Contentsquare. |
| `pageview_id` | BIGINT | Unique ID of the associated page, randomly generated by Contentsquare. |
| `time` | TIMESTAMP | Timestamp without time zone of when the event happened. |
| `library` | TEXT | Always `frustration`. |
| `platform` | TEXT | User's operating system. |
| `device_type` | TEXT | Device type. Can be one of: Mobile, Desktop, or Tablet. |
| `country` | TEXT | Country in which user session occurred, based on IP. |
| `region` | TEXT | Region in which user session occurred, based on IP. |
| `city` | TEXT | City in which user session occurred, based on IP. |
| `landing_page` | TEXT | URL of the first pageview of the session. |
| `landing_page_query` | TEXT | Query parameters of the landing page URL. |
| `landing_page_hash` | TEXT | Hash fragment of the landing page URL. |
| `type` | TEXT | Frustration signal type (e.g. `Rage Click`, `Multiple Button Interactions`). |
| `referrer` | TEXT | URL that linked to your site and initiated the session. If the user navigated directly to your site, or referral headers were stripped, then this value will appear as NULL downstream and as `direct` in the UI. |
| `domain` | TEXT | Domain including subdomain, e.g. blog.company.io. |
| `path` | TEXT | Portion of the current URL following your domain, e.g. /docs for company.io/docs. |
| `hash` | TEXT | Portion of the current URL following the hash sign, e.g. #install for company.io/docs#install. |
| `query` | TEXT | Query params of the page's current URL, e.g. ?utm\_id=1234 for company.io?utm\_id=1234. |
| `title` | TEXT | Title of the current page. |
| `href` | TEXT | `href` attribute of the link element, if the frustration event occurred on an anchor tag. |
| `target_text` | TEXT | The text displayed on the element where the event occurred. |
| `frustration_score` | TEXT | Frustration score of the pageview. |

### `frustration_events_rage_click`

A rage click occurs when a user clicks on the same element multiple times in quick succession, indicating frustration.

| Column Name | Type | Description |
| - | - | - |
| `target_path` | TEXT | Target path of the HTML component where the event happened. |
| `relative_time` | INT | Time offset in milliseconds from the start of the pageview. |
| `value` | INT | Number of clicks recorded. |

### `frustration_events_multiple_button_interactions`

A multiple button interaction occurs when a user clicks the same button multiple times, suggesting the button may not be responding as expected.

| Column Name | Type | Description |
| - | - | - |
| `target_path` | TEXT | Target path of the HTML component where the event happened. |
| `relative_time` | INT | Time offset in milliseconds from the start of the pageview. |
| `value` | INT | Number of clicks recorded. |

### `frustration_events_multiple_field_interactions`

A multiple field interaction occurs when a user interacts with the same form field multiple times, which may indicate confusion or an error in the form.

| Column Name | Type | Description |
| - | - | - |
| `target_path` | TEXT | Target path of the HTML component where the event happened. |
| `relative_time` | INT | Time offset in milliseconds from the start of the pageview. |
| `value` | INT | Number of interactions recorded. |

### `frustration_events_multiple_use_target`

A multiple use target event occurs when a user clicks the same element multiple times across the page.

| Column Name | Type | Description |
| - | - | - |
| `target_path` | TEXT | Target path of the HTML component where the event happened. |
| `relative_time` | INT | Time offset in milliseconds from the start of the pageview. |
| `value` | INT | Number of clicks recorded. |
| `count` | INT | Number of times the target was used. |

### `frustration_events_excessive_hover`

An excessive hover event occurs when a user hovers over an element for an unusually long time, which may indicate hesitation or confusion.

| Column Name | Type | Description |
| - | - | - |
| `target_path` | TEXT | Target path of the HTML component where the event happened. |
| `relative_time` | INT | Time offset in milliseconds from the start of the pageview. |
| `value` | INT | Duration of the hover in milliseconds. |
| `count` | INT | Number of hover events recorded. |

### `frustration_events_loading_time`

A loading time event is recorded when a page or resource takes longer than expected to load, which can negatively impact user experience.

| Column Name | Type | Description |
| - | - | - |
| `target_path` | TEXT | Target path of the HTML component associated with the loading event. |
| `relative_time` | INT | Time offset in milliseconds from the start of the pageview. |
| `value` | INT | Loading time duration in milliseconds. |
| `count` | INT | Number of loading time events recorded. |

### `frustration_events_low_activity`

A low activity event is recorded when a user shows very little interaction with a page (fewer than 2 clicks and less than 2 seconds of engagement), suggesting disengagement.

| Column Name | Type | Description |
| - | - | - |
| `target_path` | TEXT | Target path of the HTML component where the low activity was detected. |
| `relative_time` | INT | Time offset in milliseconds from the start of the pageview. |
| `value` | INT | Activity metric value. |
| `count` | INT | Number of low activity events recorded. |

### `frustration_scores`

The `frustration_scores` view is automatically created when a customer syncs at least one frustration table. It aggregates frustration signals at the pageview level by joining the `pageviews` table with all active `frustration_events_*` tables. Each row corresponds to one pageview and includes all [pageview columns](#pageviews) plus one count column per synced frustration table.

The count columns are dynamically named `number_of_<table_name>` based on which frustration tables are enabled. For example:

| Column Name | Type | Description |
| - | - | - |
| `number_of_frustration_events_rage_click` | INT | Number of rage click events for this pageview. `NULL` if none occurred. |
| `number_of_frustration_events_excessive_hover` | INT | Number of excessive hover events for this pageview. `NULL` if none occurred. |
| `number_of_frustration_events_loading_time` | INT | Number of loading time events for this pageview. `NULL` if none occurred. |
| `number_of_frustration_events_multiple_button_interactions` | INT | Number of multiple button interaction events. `NULL` if none occurred. |
| `number_of_frustration_events_multiple_field_interactions` | INT | Number of multiple field interaction events. `NULL` if none occurred. |
| `number_of_frustration_events_multiple_use_target` | INT | Number of multiple use target events for this pageview. `NULL` if none occurred. |
| `number_of_frustration_events_low_activity` | INT | Number of low activity events for this pageview. `NULL` if none occurred. |

Only columns for frustration tables actively synced by the customer will appear in the view.

## System tables

### `_sync_history`

Contentsquare creates a table called `_sync_history` that contains a record for every attempted sync. This table is helpful for monitoring sync performance and scheduling dependent jobs. All timestamps are in UTC for Redshift and BigQuery and in local time for Snowflake.

| Column Name | Type | Description |
| - | - | - |
| `status` | STRING | Takes value running/succeeded/failed based on the outcome of the sync attempt. |
| `start_time` | TIMESTAMP | Start time of the sync attempt. |
| `finish_time` | TIMESTAMP | Finish time of the sync attempt. |
| `error` | STRING | Error message if sync fails. |
| `next_scheduled_sync_at` | TIMESTAMP | Time of the next scheduled sync (estimated at the time of sync based on sync frequency settings). |

### `_sync_info`

Contentsquare creates a table called `_sync_info` that contains metadata around the sync process and last updated times.

| Column Name | Type | Description |
| - | - | - |
| `event_table_name` | TEXT | The event name. |
| `sync_started` | TIMESTAMP | A timestamp for when that table began syncing. |
| `sync_ended` | TIMESTAMP | A timestamp for when that table completed syncing. |
| `synced_to_time` | TIMESTAMP | A timestamp that reflects the most recent occurrence of the event. |
| `inserted_row_count` | BIGINT | The number of rows inserted during the most recent sync. |

### `user_migrations`

When a user is identified, a migration occurs to aggregate the data under the new identity. These migrations are recorded in this table. Time is a column for Redshift and S3 destinations only. Snowflake and BigQuery do not have a column for time.

| Column Name | Type | Description |
| - | - | - |
| `from_user_id` | BIGINT | The migrating user's ID. |
| `to_user_id` | BIGINT | The destination user's ID. |
| `time` | TIMESTAMP | A timestamp for when the migration occurred. |

### `event_metadata`

This table contains metadata about the names of events, which allows you to build automated jobs that use this metadata. This table is re-created on each sync to stay updated with the latest event metadata.

| Column Name | Type | Description |
| - | - | - |
| `table_name` | TEXT | For each event, this row contains the sanitized name of the table containing the event's data synced to your warehouse. |
| `ui_name` | TEXT | For each event, this row contains the name of the event in Contentsquare. |
| `last_updated_at` | TIMESTAMP | Time event label was last updated. |
| `last_updated_by` | TEXT | User who last updated event label. |
| `notes` | TEXT | Notes attached to the event. |
| `source` | TEXT | Data capture source (ex: web, ios, android). |
| `verified_at` | TIMESTAMP | Time event was verified. |
| `verified_by` | TEXT | User who verified the event. |

The `event_metadata` table shows up differently for S3. You can query it as follows:

```json
{
  "ui_name": "Stripe charge",
  "table_name": "stripe_charge",
  "source": "stripe",
  "last_updated_at": "1609459200000",
  "last_updated_by": "sales@company.com",
  "notes": "This is a note",
  "verified_at": "1640995200000",
  "verified_by": "admin@company.com"
}
```
