# Data schema

### Understand the data schema

Your data is organized as a collection of hits organized around your visitors' session. Put differently, each of your visitors' sessions is composed of rows which are each hit that has been received.

A session ends after 30 minutes of inactivity (= of no new hit being received)

### Hits

There are several types of hits and the updated list can be found [uc-hits](https://docs.abtasty.com/client-side/data-apis/universal-collect/uc-hits "mention").

If you are using the JavaScript tag or a Flagship SDK, a lot of them are automatically sent to the collect pipeline, so here’s a quick and non-exhaustive sum-up:

each page that is being seen as its corresponding PAGEVIEW hit (or SCREENVIEW in an app),

each campaign (A/B test, flag, perso…) that is being triggered as its corresponding CAMPAIGN hit,

each time you trigger an EVENT (Action Tracking), a TRANSACTION, an ITEM, a SEGMENT, … the corresponding hit is being stored as a row in the session.

### Parameters

A hit is composed of:

* common parameters
* specific parameters

#### Common parameters

Also known as “common arguments”, these are parameters that can be attached to any type of hit. They represent global information about the session more than about the hit itself. For example, you will find the visitor ID, the page title, the account identifier or the timestamp.

The full list can be found [uc-common-arguments](https://docs.abtasty.com/client-side/data-apis/universal-collect/uc-common-arguments "mention").

#### Specific parameters

These are used to characterize a hit type. For example, for a transaction, they will be used to send the transaction revenue or shipping method. For an event, they will be used to organize it following the Category Action / Label / Value schema.

You will find [uc-hits](https://docs.abtasty.com/client-side/data-apis/universal-collect/uc-hits "mention") the details of each specific parameter for each type of hit.

### Campaign history

A visitor might be exposed to several campaigns (A/B tests, flag, perso …) during his journey. The matrix of campaign ID / variation ID pairs he has seen is referred to as his Campaign History. We keep considering a visitor as part of a campaign for 30 days after his last exposure.

Each hit has the corresponding campaign history attached. However, the chronology matters here, and a hit sent before the campaign has been activated won’t be considered as part of the campaign. See the following matrix example:

| Event                                                                  | Type of hit(s)    | Campaign history | Comment                                                                            |
| ---------------------------------------------------------------------- | ----------------- | ---------------- | ---------------------------------------------------------------------------------- |
| Visitor arrives, campaign A variation 0 is triggered                   | Pageview Campaign | {A: 0}           | Both hits are being sent together (in a batch)                                     |
| Visitor goes to a category page                                        | Pageview          | {A: 0}           | No new campaign                                                                    |
| Visitor clicks on a filter which triggers an Action Tracking (`EVENT`) | Event             | {A: 0}           | The `EVENT` is registered as being part of campaign A                              |
| Visitor goes to a product page, campaign B variation 1 is triggered.   | Pageview Campaign | {A: 0, B: 1}     | The visitor has seen the product page while being exposed to campaigns A **and** B |
| Visitor clicks on “Add to cart” which triggers an Action Tracking      | Event             | {A: 0, B: 1}     | The `EVENT` is registered as being part of campaigns A **and** B.                  |

### Session representation example

This tab represents the beginning of a session. The name of the parameters has been “translated” to improve comprehension.

{% hint style="warning" %}
The amount of columns is definitely not exhaustive and serve to illustrate the example.
{% endhint %}

| Hit type      | Specific argument 1             | Specific argument 2             | Hit URL                                                                    | Account Id         | Visitor Id             | Hit Page Title            | Campaign history           |
| ------------- | ------------------------------- | ------------------------------- | -------------------------------------------------------------------------- | ------------------ | ---------------------- | ------------------------- | -------------------------- |
| Type=Pageview |                                 |                                 | URL=”[www.mywebsite.com”](http://www.mywebsite.com”)                       | Account ID=”34684” | ID visitor=”1h89ze4g7” | PageTitle=”Homepage”      | CampaignHistory={}         |
| Type=Campaign | Campaign ID=”A”                 | Variation ID=”0”                | URL=”[www.mywebsite.com”](http://www.mywebsite.com”)                       | Account ID=”34684” | ID visitor=”1h89ze4g7” | PageTitle=”Homepage”      | CampaignHistory={A:0}      |
| Type=Pageview |                                 |                                 | URL=”[www.mywebsite.com/categories”](http://www.mywebsite.com/categories”) | Account ID=”34684” | ID visitor=”1h89ze4g7” | PageTitle=”Category page” | CampaignHistory={A:0}      |
| Type=Event    | EventCategory=”Action Tracking” | EventAction=”Click Filters”     | URL=”[www.mywebsite.com/categories”](http://www.mywebsite.com/categories”) | Account ID=”34684” | ID visitor=”1h89ze4g7” | PageTitle=”Category page” | CampaignHistory={A:0}      |
| Type=Pageview |                                 |                                 | URL=”[www.mywebsite.com/product”](http://www.mywebsite.com/product”)       | Account ID=”34684” | ID visitor=”1h89ze4g7” | PageTitle=”Product page”  | CampaignHistory={A:0}      |
| Type=Campaign | Campaign ID=”B”                 | Variation ID=”1”                | URL=”[www.mywebsite.com/product”](http://www.mywebsite.com/product”)       | Account ID=”34684” | ID visitor=”1h89ze4g7” | PageTitle=”Product page”  | CampaignHistory={A:0, B:1} |
| Type=Event    | EventCategory=”Action Tracking” | EventAction=”Click Add to Cart” | URL=”[www.mywebsite.com/product”](http://www.mywebsite.com/product”)       | Account ID=”34684” | ID visitor=”1h89ze4g7” | PageTitle=”Product page”  | CampaignHistory={A:0, B:1} |
