# Schemas

With Blotout Cloud, we provide two versions of the Cloud Schema to accommodate different data collection and processing needs. Each version is designed to offer flexibility in how event data is structured, transmitted, and stored, allowing teams to choose the schema that best aligns with their infrastructure and use case requirements.

We have provided example payloads for both versions to help you understand the expected data format, field structure, and schema conventions. These examples serve as a reference when integrating your data pipelines or validating event payloads against the schema definitionSc.

### Example Payload

```json
{
  "origin": "https://shop.example.com",
  "sessionId": "1b2c3d4e5f6789012345678",
  "payload": {
    "pageUrl": "https://shop.example.com/checkout",
    "pageTitle": "Checkout | Example Store",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
    "referrer": "https://shop.example.com/cart",
    "search": "?utm_source=google&utm_medium=cpc",
    "locale": "en-US",
    "sdkVersion": "1.4.2",
    "eventName": "initiateCheckout",
    "eventId": "evt_9f8e7d6c5b4a321098765432",
    "timestamp": 1735689600000,
    "serverTriggered": false,
    "data": {
      "checkoutUrl": "https://shop.example.com/checkout?token=abc123",
      "currency": "USD",
      "value": 149.99,
      "orderId": "ORD-2024-00123",
      "discounts": [
        {
          "code": "SAVE10",
          "value": "10",
          "type": "percentage"
        }
      ],
      "sourceId": "src_78910",
      "search": "running shoes",
      "category": "Footwear",
      "skipIPAddress": false,
      "source": "web",
      "skipTransformation": false,
      "predicted_ltv": "540.00",
      "name": "Nike Air Zoom Pegasus 40",
      "content_type": "product",
      "keywords": ["running", "shoes", "nike", "sport"],
      "userEmail": "jane.doe@example.com",
      "userPhone": "+14155552671",
      "userFirstName": "Jane",
      "userLastName": "Doe",
      "userGender": "female",
      "userDateOfBirth": "1990-06-15",
      "userCountry": "US",
      "userState": "CA",
      "userCity": "San Francisco",
      "userZip": "94105",
      "userIP": "203.0.113.42"
    }
  },
  "hostData": {
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
    "ip": "203.0.113.42",
    "country": "US",
    "city": "San Francisco",
    "region": "California",
    "regionCode": "CA",
    "timezone": "America/Los_Angeles",
    "postalCode": "94105",
    "continent": "NA",
    "longitude": "-122.4194",
    "latitude": "37.7749",
    "ja4": "t13d1516h2_8daaf6152771_b1ff8ab2d16f",
    "ja3": "cd08e31494f9531f560d64c695473da9",
    "isEUCountry": "false"
  },
  "user": {
    "userId": "usr_3c2b1a0f9e8d7c6b5a4f3e2d",
    "email": "jane.doe@example.com",
    "phone": "+14155552671",
    "firstName": "Jane",
    "lastName": "Doe",
    "gender": "female",
    "dateOfBirth": "1990-06-15",
    "country": "US",
    "state": "CA",
    "city": "San Francisco",
    "zip": "94105",
    "ip": "203.0.113.42",
    "region": "California",
    "regionCode": "CA",
    "timezone": "America/Los_Angeles",
    "postalCode": "94105",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
    "createdAt": "2023-03-22T08:30:00Z"
  },
  "customData": {
    "customData1": "one",
    "customData2": "two"
  },
  "queryData": {
    "facebook": {
      "fbclid": "IwAR3h2x0nE4k"
    },
    "google": {
      "gclid": "EAIaIQobChMI8JzW4fG7_wIVDhzICh3Y9Q1VEAAYASAAEgL5v_D_BwE"
    }
  }
}
```

The Payload has the following Structure :&#x20;

{% tabs %}
{% tab title="Schema Structure" %}

| Property     | Type                                     |
| ------------ | ---------------------------------------- |
| origin       | string                                   |
| sessionId    | string                                   |
| payload      | Payload                                  |
| hostData     | Record\<string, string>                  |
| user         | FullUser                                 |
| queryData    | Record\<string, Record\<string, string>> |
| customData   | customData: Record\<string, unknown>     |
| {% endtab %} |                                          |

{% tab title="FullUser Obj" %}
FullUser Object is as detailed below&#x20;

| Key               | Description               | Type   |
| ----------------- | ------------------------- | ------ |
| userId            | User's unique ID          | string |
| email             | User's email address      | string |
| phone             | User's phone number       | string |
| firstName         | User's first name         | string |
| lastName          | User's last name          | string |
| gender            | User's gender             | string |
| dateOfBirth       | User's date of birth      | string |
| country           | User's country            | string |
| state             | User's state              | string |
| city              | User's city               | string |
| zip               | User's zip code           | string |
| ip                | User's IP address         | string |
| consent           | User's consent string     | string |
| consentCategories | User's consent categories | string |
| created\_at       | User creation timestamp   | string |
| {% endtab %}      |                           |        |

{% tab title="Payload Obj" %}
The Payload Object is as detailed below&#x20;

| Key               | Description               | Type   |
| ----------------- | ------------------------- | ------ |
| userId            | User's unique ID          | string |
| email             | User's email address      | string |
| phone             | User's phone number       | string |
| firstName         | User's first name         | string |
| lastName          | User's last name          | string |
| gender            | User's gender             | string |
| dateOfBirth       | User's date of birth      | string |
| country           | User's country            | string |
| state             | User's state              | string |
| city              | User's city               | string |
| zip               | User's zip code           | string |
| ip                | User's IP address         | string |
| consent           | User's consent string     | string |
| consentCategories | User's consent categories | string |
| created\_at       | User creation timestamp   | string |
| {% endtab %}      |                           |        |
| {% endtabs %}     |                           |        |

### Version 1 : Schema Applied on the Example Payload&#x20;

```json
{
  "city": "San Francisco",
  "continent": "North America",
  "country": "United States",
  "epoch_utc": 1735689600000,
  "event_id": "evt_9f8e7d6c5b4a321098765432",
  "event_name": "initiateCheckout",
  "event_type": "codified",
  "ip": "203.0.113.42",
  "lat": "37.7749",
  "long": "-122.4194",
  "origin": "https://shop.example.com",
  "page": "https://shop.example.com/checkout",
  "page_title": "Checkout | Example Store",
  "referrer": "https://shop.example.com/cart",
  "sdk_version": "0.13.0",
  "state": "CA",
  "timezone_offset": 330,
  "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
  "user_agent_parsed": "0~Mac OS~10.15.7~desktop~Macintosh~Apple~Chrome",
  "user_id_created_utc": 2023,
  "user_id": "usr_3c2b1a0f9e8d7c6b5a4f3e2d",
  "zip": "94105",
  "data_checkout_url": "https://shop.example.com/checkout?token=abc123",
  "data_currency": "USD",
  "data_value": "149.99",
  "data_order_id": "ORD-2024-00123",
  "data_discounts": [
    {
      "code": "SAVE10",
      "value": "10",
      "type": "percentage"
    }
  ],
  "data_source_id": "src_78910",
  "data_search": "running shoes",
  "data_category": "Footwear",
  "data_skip_i_p_address": "false",
  "data_source": "web",
  "data_skip_transformation": "false",
  "data_predicted_ltv": "540.00",
  "data_name": "Nike Air Zoom Pegasus 40",
  "data_content_type": "product",
  "data_keywords": [
    "running",
    "shoes",
    "nike",
    "sport"
  ],
  "data_user_email": "jane.doe@example.com",
  "data_user_phone": "+14155552671",
  "data_user_first_name": "Jane",
  "data_user_last_name": "Doe",
  "data_user_gender": "female",
  "data_user_date_of_birth": "1990-06-15",
  "data_user_country": "US",
  "data_user_state": "CA",
  "data_user_city": "San Francisco",
  "data_user_zip": "94105",
  "data_user_i_p": "203.0.113.42",
  "custom_custom_data1": "one",
  "custom_custom_data2": "two"
}
```

### Version 2 : Schema Applied on the Example Payload&#x20;

```json
{
  "event_session_id": "1b2c3d4e5f6789012345678",
  "event_timestamp": "1735689600000",
  "event_id": "evt_9f8e7d6c5b4a321098765432",
  "event_name": "initiateCheckout",
  "event_page_url": "https://shop.example.com/checkout",
  "event_page_title": "Checkout | Example Store",
  "event_referrer": "https://shop.example.com/cart",
  "event_origin": "https://shop.example.com",
  "payload_checkout_url": "https://shop.example.com/checkout?token=abc123",
  "payload_currency": "USD",
  "payload_value": "149.99",
  "payload_order_id": "ORD-2024-00123",
  "payload_discounts": [
    {
      "code": "SAVE10",
      "value": "10",
      "type": "percentage"
    }
  ],
  "payload_source_id": "src_78910",
  "payload_search": "running shoes",
  "payload_category": "Footwear",
  "payload_skip_i_p_address": "false",
  "payload_source": "web",
  "payload_skip_transformation": "false",
  "payload_predicted_ltv": "540.00",
  "payload_name": "Nike Air Zoom Pegasus 40",
  "payload_content_type": "product",
  "payload_keywords": [
    "running",
    "shoes",
    "nike",
    "sport"
  ],
  "payload_user_email": "jane.doe@example.com",
  "payload_user_phone": "+14155552671",
  "payload_user_first_name": "Jane",
  "payload_user_last_name": "Doe",
  "payload_user_gender": "female",
  "payload_user_date_of_birth": "1990-06-15",
  "payload_user_country": "US",
  "payload_user_state": "CA",
  "payload_user_city": "San Francisco",
  "payload_user_zip": "94105",
  "payload_user_i_p": "203.0.113.42",
  "user_email": "jane.doe@example.com",
  "user_phone": "+14155552671",
  "user_first_name": "Jane",
  "user_last_name": "Doe",
  "user_gender": "female",
  "user_date_of_birth": "1990-06-15",
  "user_country": "US",
  "user_state": "CA",
  "user_city": "San Francisco",
  "user_zip": "94105",
  "user_ip": "203.0.113.42",
  "user_region": "California",
  "user_region_code": "CA",
  "user_timezone": "America/Los_Angeles",
  "user_postal_code": "94105",
  "user_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
  "user_created_at": "2023-03-22T08:30:00Z",
  "user_id": "usr_3c2b1a0f9e8d7c6b5a4f3e2d",
  "user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
  "query_fbclid": "IwAR3h2x0nE4k",
  "query_gclid": "EAIaIQobChMI8JzW4fG7_wIVDhzICh3Y9Q1VEAAYASAAEgL5v_D_BwE",
  "geo_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
  "geo_ip": "203.0.113.42",
  "geo_country": "US",
  "geo_city": "San Francisco",
  "geo_region": "California",
  "geo_region_code": "CA",
  "geo_timezone": "America/Los_Angeles",
  "geo_postal_code": "94105",
  "geo_continent": "NA",
  "geo_longitude": "-122.4194",
  "geo_latitude": "37.7749",
  "geo_ja4": "t13d1516h2_8daaf6152771_b1ff8ab2d16f",
  "geo_ja3": "cd08e31494f9531f560d64c695473da9",
  "geo_is_e_u_country": "false",
  "custom_data_custom_data1": "one",
  "custom_data_custom_data2": "two"
}
```
