Data Dictionary
- Table campaign
- Table category
- Table country (deprecated)
- Table dimension
- Table experience
- Table goal_completion_attribution
- Table goal_completion_attribution_promoted_item
- Table goal_completion_line_item
- Table location (deprecated)
- Table order_line_item
- Table order_line_item_attribute
- Table product
- Table product_attribute
- Table product_category
- Table product_dimension
- Table segment
- Table segment_membership
- Table survey_question (deprecated)
- Table survey_response (deprecated)
- Table user
- Table user_alias
- Table user_attribute
- Table user_campaign_state
- Table user_click
- Table user_daily_stat
- Table user_daily_stat_action
- Table user_daily_stat_item_stat_category
- Table user_daily_stat_item_stat_dimension
- Table user_daily_stat_item_stat_product
- Table user_daily_stat_item_stat_promotion
- Table user_dismissal
- Table user_engagement_history
- Table user_goal_completion
- Table user_impression
- Table user_order
- Table user_order_attribute
- Table user_search
- Table user_user_visit_lookup
- Table user_visit
- Table user_visit_detail
Campaigns contain experiences you design to personalize the interaction a visitor has with your website or application.
Field Name | Data Type | Description | Example values |
---|---|---|---|
id | Char(5) | Unique identifier for a campaign | |
"type" | Varchar(32) | Campaign type implies marketing channel | Web , MobileData , TriggeredEmail |
created_ts | Timestamp without time zone | UTC date and time the campaign was created | |
updated_ts | Timestamp without time zone | UTC date and time the campaign was most recently updated | |
last_published_ts | Timestamp without time zone | UTC date and time the campaign was most recently published | |
name | Varchar(100) | Name of the campaign | |
state | Varchar(100) | Campaign state | Published , Testing , Disabled |
PRIMARY KEY campaign_pkey ON campaign USING btree (id)
TABLE "experience" CONSTRAINT "experience_campaign_id_fkey" FOREIGN KEY (campaign_id) REFERENCES campaign(id)
TABLE "user_campaign_state" CONSTRAINT "user_campaign_state_campaign_id_fkey" FOREIGN KEY (campaign_id) REFERENCES campaign(id)
In a hierarchical catalog, items belong to a category. This table stores the category IDs and names. In Personalization, there’s more than one way to represent a hierarchy. First, categories can be fully specified by the category ID itself (for example, womensapparel|denim|highrise
). A hierarchy can be derived from the path. Second, you can use the parent_id
field in the category. Products can belong to many categories. How you build categories depends on your integration, but the data structure supports both approaches.
Encoding the hierarchy in the ID is simpler. You can use the parent ID in cases where the hierarchy maybe unavailable, but the short, non-hierarchical ID remains consistent across channels and systems that reference categories.
Field Name | Data Type | Description | Example values |
---|---|---|---|
id | Varchar(200) | Unique identifier for the category | |
name | Varchar(200) | Name of the category | |
is_department | Boolean | true when the category is a department (a higher-level entity in the category hierarchy) | |
parent_id | Varchar(200) | Parent category ID of this category | |
created_ts | Timestamp without time zone | Date and time the category was created in the operational store, UTC | |
updated_ts | Timestamp without time zone | Date and time of the most recent update in the operation store, UTC (as of the recent DW import) |
PRIMARY KEY category_pkey ON category USING btree (id)
TABLE "product_category" CONSTRAINT "product_category_category_id_fkey" FOREIGN KEY (category_id) REFERENCES category(id)
TABLE "user_daily_stat_item_stat_category" CONSTRAINT "user_daily_stat_item_stat_category_category_id_fkey" FOREIGN KEY (category_id) REFERENCES category(id)
The country
dimension table is now deprecated and no longer in use.
Country lookup table. Provides iso_2
and iso_3
codes and continent information. For more information, refer to IBAN's list of country ISO codes.
Field Name | Data Type | Description | Example values |
---|---|---|---|
id | Varchar(200) | Unique identifier for the country | |
name | Varchar(100) | Name of the country | |
updated_ts | Timestamp without time zone | Date and time of the most recent update to the table | |
iso_2_code | Char(2) | 2-character country code | AW , GB , US |
iso_3_code | Char(3) | 3-character country code | ABW , GBR |
has_regions | Boolean | True if the country has regions | |
continent_code | Varchar(100) | Numeric continent code | 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 |
continent_iso_2_code | Char(2) | ISO-2 standard code for a continent | NA , AS , EU |
PRIMARY KEY country_pkey ON country USING btree (id)
Dimensions are name-value pairs associated with items (usually products). Typical defaults are brand
, color
, style
, and gender
. Custom dimensions are also available. The combination of (id
, dimension_type
) is unique.
As of September 7, 2021, there’s no distinction between items and dimensions. They’re both now known and treated as catalog objects. For more information on catalog objects, refer to the Catalog Objects documentation.
Field Name | Data Type | Description | Example values |
---|---|---|---|
id | Varchar(200) | Identifier for this dimension. The combination of id and dimension_type uniquely identifies a dimension. | |
dimension_type | Varchar(200) | Built-in and custom types are supported. Dimension types are capitalized. | Brand , Gender , Color , Style |
name | Varchar(200) | The label used when displaying the dimension | Gucci , Mens |
created_ts | Timestamp without time zone | Date and time the dimension was created | |
updated_ts | Timestamp without time zone | Date and time this dimension was most recently updated |
UNIQUE INDEX dimension_id_key ON dimension USING btree (id, dimension_type)
TABLE "product_dimension" CONSTRAINT "product_dimension_dimension_id_fkey" FOREIGN KEY (dimension_id, dimension_type) REFERENCES dimension(id, dimension_type)
Campaigns contain experiences. You can create different personalization results within the same campaign using experiences. Suppose you want to create a campaign for first-time visitors to your site. However, you want to show a different message to visitors from Boston and San Francisco where you have upcoming events. In this scenario, you would create 3 experiences in the same campaign: one campaign each for visitors from Boston and San Francisco, and one for everyone else. You can then use rules to restrict each experience's visibility to its respective target group.
Field Name | Data Type | Description | Example values |
---|---|---|---|
id | Char(5) | Unique identifier for this experience | |
name | Varchar(100) | Name of the experience | |
display_mode | Varchar(100) | Presentation detail about the experience. | Personalize , Redirect |
campaign_id | Char(5) | Associated Campaign ID |
PRIMARY KEY experience_pkey ON experience USING btree (id)
TABLE "goal_completion_attribution" CONSTRAINT "goal_completion_attribution_experience_id_fkey" FOREIGN KEY (experience_id) REFERENCES experience(id)
TABLE "goal_completion_attribution_promoted_item" CONSTRAINT "goal_completion_attribution_promoted_item_experience_id_fkey" FOREIGN KEY (experience_id) REFERENCES experience(id)
TABLE "user_click" CONSTRAINT "user_click_experience_id_fkey" FOREIGN KEY (experience_id) REFERENCES experience(id)
TABLE "user_dismissal" CONSTRAINT "user_dismissal_experience_id_fkey" FOREIGN KEY (experience_id) REFERENCES experience(id)
TABLE "user_impression" CONSTRAINT "user_impression_experience_id_fkey" FOREIGN KEY (experience_id) REFERENCES experience(id)
Stores the timestamp for the campaign goal in UTC. This table is important when reconstructing or analyzing campaign performance. Use the last_age_seconds
field to decide whether to attribute a goal completion to a campaign.
Field Name | Data Type | Description | Example values |
---|---|---|---|
user_id | Varchar(200 ) | User who satisfied the goal criteria | |
goal_ts | Timestamp without time zone | Timestamp of the goal completion in UTC | |
goal_id | Varchar(256) | One of: segment id or purchase (p) | p |
experience_id | Varchar(256) | The experience associated with the goal completion | |
user_group | Char(1) | Per experience test (D) and control (C) | C , D |
promotion_id | Varchar(200) | The promotion associated with the goal completion | |
direct_revenue | Numeric(18,4 ) | Revenue associated with the promoted item of the goal | |
event_type | Varchar(50) | The event type | click , send , impression |
first_age_seconds | Integer | First age is the time between the first attributable event and the goal time. | |
first_time_ts | Timestamp without time zone | Timestamp for the first attributable event, UTC | |
last_age_seconds | Integer | Last age is the time between the most recent attributable event and the goal time. | |
last_time_ts | Timestamp without time zone | Timestamp for the most recent attributable event, UTC | |
browser | Varchar(256) | Client browser application | Safari , Chrome , Firefox , IE |
device | Varchar(256) | Client hardware device | mobile , computer, tablet, other |
engagement | Varchar(256) | Engagement for the associated user | low , medium , high |
has_purchased | Boolean | Set when the user makes a purchase | |
is_anonymous | Boolean | true when the user isn’t named (identified) | |
is_firsttime | Boolean | true when the completion represents a first encounter with a visitor | |
os | Varchar(256) | Operating system - x is "macOS X" | x , windows , linux , ios , android , other |
platform | Varchar(256) | Platform used in the goal completion (email, web) | Email , Web |
source | Varchar(256) | For web events, source is Web . For customers who use the mobile SDK, each mobile app would be a separate source. |
UNIQUE INDEX goal_completion_attribution_user_id_key ON goal_completion_attribution USING btree (user_id, goal_id, goal_ts, experience_id, user_group, event_type)
If a goal completion has an associated promoted item, you can find it in this table. Use (user_id, goal_id, goal_ts)
to join back to the other goal tables.
Field Name | Data Type | Description | Example values |
---|---|---|---|
user_id | Varchar(200) | User associated with the goal completion | |
goal_ts | Timestamp without time zone | Timestamp of the goal completion in UTC | |
goal_id | Varchar(256) | The goal id stores different value types; for segment goals, the goal id is the segment id; for purchase goals, the goal id is the character p . | p |
experience_id | Varchar(256) | Experience associated with the goal | |
user_group | Char(1) | Per experience control (C ) and test (D ) | C , D |
item_id | Varchar(256 ) | Unique identifier for the promoted item | |
item_type | Varchar(256) | For example, p to indicate product | p |
attributes | Varchar(256) | A list of attributes for the promoted item. The underlying data is JSON, stored here as a string. | |
updated_ts | Timestamp without time zone | UTC Date and time of the most recent update of this promoted item attribution | |
revenue | Numeric(18,4) | Revenue resulting from the goal completion |
UNIQUE INDEX goal_completion_attribution_promoted_item_user_id_key ON goal_completion_attribution_promoted_item USING btree (user_id, goal_id, goal_ts, experience_id, user_group, item_type, item_id)
For goal completions that are associated with a purchase, this table stores the line items associated with that purchase.
Field Name | Data Type | Description | Example values |
---|---|---|---|
user_id | Varchar(200) | User associated with the order | |
goal_ts | Timestamp without time zone | Timestamp of the goal completion in UTC | |
goal_id | Varchar(256) | p for purchase or a segment id | p |
line_item_num | Smallint | Data warehouse internal enumeration (doesn’t have an analog in the operational store) | |
item_id | Varchar(256) | Line item | |
item_type | Varchar(256) | Typically p for product | p |
price | Numeric(18,4) | Item price | |
quantity | Smallint | Item quantity |
UNIQUE INDEX goal_completion_line_item_user_id_key ON goal_completion_line_item USING btree (user_id, goal_id, goal_ts, line_item_num)
The location
dimension table is now deprecated and no longer in use.
Use this table to de-reference geographical information stored at the visit or user level (for example, city_code
, metro_code
, postal_code
, latitude
, or longitude
) and convert it to human-readable labels.
Field Name | Data Type | Description | Example values |
---|---|---|---|
id | Varchar(200) | Unique identifier for the location | |
latitude | Numeric(9,6) | Latitude associated with the location | 40.7134 , 37.0547 |
longitude | Numeric(9,6) | Longitude associated with the location | -111.889 , -91.5281 |
postal_code | Varchar(10) | Postal code associated with the location | 02143 |
city_code | Integer | Code for the city associated with the location | |
city_name | Varchar(100) | Name of the city associated with the location | |
metro_code | Integer | Metro code associated with the location. Metro codes for US are Nielsen DMA codes | |
region_code | Varchar(10) | Region code associated with the location | UT , WI |
country_code | Varchar(100) | 2-letter Country code associated with the location | US , IT , KR |
continent_code | Varchar(100) | 2-letter continent code associated with the location | NA , SA |
updated_ts | Timestamp without time zone | UTC date and time of the most recent update to the location |
PRIMARY KEY location_pkey ON "location" USING btree (id)
Stores the line items for a given order. Use (user_id, order_id)
when joining back to order.
Field Name | Data Type | Description | Example values |
---|---|---|---|
user_id | Varchar(200) | User id associated with the order | |
order_id | Varchar(256) | Unique identifier for the order associated with the line item | |
line_item_num | Smallint | Data warehouse internal enumeration (doesn’t have an analog in the operational store) | |
item_type | Varchar(256) | Type of item. Usually product. | |
item_id | Varchar(256) | The item (usually product) associated with the order | |
price | Numeric(18,4) | Unit price | |
quantity | Smallint | Item quantity for this line item | |
currency | Varchar(256) | Currency associated with the order | |
sku | Varchar(256) | Stock Keeping Unit associated with the line item | |
order_created_ts | Timestamp without time zone | UTC date and time when the order was created |
PRIMARY KEY order_line_item_pkey ON order_line_item USING btree (user_id, order_id, item_id, order_created_ts, line_item_num)
Provides attribute name-value pairs associated with line items, as well as provenance.
Field Name | Data Type | Description | Example values |
---|---|---|---|
user_id | Varchar(200) | User associated with the order | |
order_id | Varchar(256) | Unique order identifier | |
line_item_num | Smallint | Generated in DW, a 1-based sequence value for this line item | |
item_type | Varchar(256) | Type type of item | |
item_id | Varchar(256) | Unique identifier for the associated item | |
attribute_name | Varchar(256) | The name of the attribute | quantity_shipped |
attribute_value | Varchar(256) | The value of the attribute | |
value_metadata_origin | Varchar(256 ) | The name of the entity that issues or creates the initial attribute value. | CRM , PointOfSaleSystem , FulfillmentSystem , LoyaltySystem |
value_metadata_provider | Varchar(256) | The name of the entity that is providing the attribute. | CsvUserEtlJob:user-20190528.csv.gz |
value_metadata_gear_id | Varchar(256) | ID of the Personalization gear that updated the attribute, or null if it wasn’t updated by a gear | |
value_metadata_last_updated_ts | Varchar(256) | UTC date and time when the attribute was last updated | |
value_metadata_last_verified_ts | Varchar(256) | UTC date and time when the attribute value was last verified as being true and belonging to the specified individual | |
value_metadata_classification | Varchar(256) | Metadata relevant or pertaining to the security classification of a given attribute's value |
PRIMARY KEY order_line_item_attribute_pkey ON order_line_item_attribute USING btree (user_id, order_id, item_type, item_id, line_item_num, attribute_name)
Stores product name and price.
Field Name | Data Type | Description | Example values |
---|---|---|---|
id | Varchar(200) | Unique identifier for the product | |
name | Varchar(200) | Name of the product | |
description | Varchar(500) | Description of the product | |
list_price | Real | The list price of the product | |
price | Real | Unit price displayed to an anonymous user when promoting the product | |
created_ts | Timestamp without time zone | UTC date and time the product created in Personalization system | |
updated_ts | Timestamp without time zone | UTC date and time the product was most recently updated in the Personalization system | |
promotion_state | Varchar(50) | Metadata concerning product eligibility and prioritization | Excluded , Prioritized |
url | Varchar(2048) | URL for the product | |
image_url | Varchar(2048) | URL for the product image |
PRIMARY KEY product_pkey ON product USING btree (id)
TABLE "product_attribute" CONSTRAINT "product_attribute_product_id_fkey" FOREIGN KEY (product_id) REFERENCES product(id)
TABLE "product_category" CONSTRAINT "product_category_product_id_fkey" FOREIGN KEY (product_id) REFERENCES product(id)
TABLE "product_dimension" CONSTRAINT "product_dimension_product_id_fkey" FOREIGN KEY (product_id) REFERENCES product(id)
TABLE "user_daily_stat_item_stat_product" CONSTRAINT "user_daily_stat_item_stat_product_product_id_fkey" FOREIGN KEY (product_id) REFERENCES product(id)
Stores attribute data about products, as well as provenance for the attributed value.
Field Name | Data Type | Description | Example values |
---|---|---|---|
product_id | Varchar(200) | Unique identifier for the product | |
attribute_name | Varchar(256) | The name of the attribute | |
attribute_value | Varchar(256) | The value of the attribute | |
value_metadata_origin | Varchar(256) | The name of the entity that issues or creates the initial attribute value | CRM , PointOfSaleSystem , FulfillmentSystem , LoyaltySystem |
value_metadata_provider | Varchar(256) | The name of the entity that is providing the attribute | CsvUserEtlJob:user-20190528.csv.gz |
value_metadata_gear_id | Varchar(256) | ID of the Personalization gear that updated the attribute, or null if it wasn’t updated by a gear | |
value_metadata_last_updated_ts | Varchar(256 ) | UTC date and time when the attribute was last updated | |
value_metadata_last_verified_ts | Varchar(256) | UTC date and time when the attribute value was last verified as being true and belonging to the specified individual | |
value_metadata_classification | Varchar(256) | Metadata relevant or pertaining to the security classification of a given attribute's value |
PRIMARY KEY product_attribute_pkey ON product_attribute USING btree (product_id, attribute_name)
A product can belong to more than one (fully qualified) category. This table stores product-category relationships.
Field Name | Data Type | Description | Example values |
---|---|---|---|
product_id | Varchar(256) | Unique identifier for the product | |
category_id | Varchar(256) | Unique identifier for the category |
UNIQUE INDEX product_category_product_id_key ON product_category USING btree (product_id, category_id)
Logically the (dimension_type
, dimension_id
) are a name-value pair associated with a product. Common dimensions include gender, brand, and style. Custom dimensions are also available.
Field Name | Data Type | Description | Example values |
---|---|---|---|
product_id | Varchar(200) | Unique identifier for a product | |
dimension_id | Varchar(200) | The value of a dimension | Gucci , Red |
dimension_type | Varchar(200) | The name of a dimension. Dimension names are capitalized | Brand , Gender , Style |
UNIQUE INDEX product_dimension_product_id_key ON product_dimension USING btree (product_id, dimension_type, dimension_id)
A Personalization segment is a real-time grouping of accounts or individuals based on a set of criteria you define. Segment updates in the operational store happen in real time, so any membership changes occur immediately, even during the same visit. Exports to this table, if done at all, are done one time per day. Segment export is enabled for individual segments by request, on the condition that the segment is small enough to export in this manner.
Field Name | Data Type | Description | Example values |
---|---|---|---|
id | Varchar(10) | Unique identifier for the segment | |
name | Varchar(200) | Name of the segment | |
is_goal | Boolean | true when segment is associated with a goal. | |
entity_type | Varchar(200) | The type of entity associated with this segment | Account , User |
created_ts | Timestamp without time zone | UTC date and time of creation | |
updated_ts | Timestamp without time zone | UTC date and time of recent update |
PRIMARY KEY segment_pkey ON segment USING btree (id)
TABLE "segment_membership" CONSTRAINT "segment_membership_segment_id_fkey" FOREIGN KEY (segment_id) REFERENCES segment(id)
User-segment associations. For B2C, segments are associated with users.
Field Name | Data Type | Description | Example values |
---|---|---|---|
user_id | Varchar(200) | Segment member | |
segment_id | Varchar(200) | Unique identifier for the segment | |
joined_ts | Timestamp without time zone | UTC date and time of segment join event | |
left_ts | Timestamp without time zone | UTC date and time of segment leave event. Note: This field is never populated and its value is always set to NULL . | |
is_active | Boolean | True if user is an active member of the segment | |
updated_dt | Timestamp without time zone | UTC date and time of most recent update |
UNIQUE INDEX segment_membership_user_id_key ON segment_membership USING btree (user_id, segment_id, joined_ts)
The survey_question
dimension table is now deprecated and no longer in use.
Survey questions and associated metadata
Field Name | Data Type | Description | Example values |
---|---|---|---|
survey_id | Varchar(6) | Unique identifier for the survey | |
survey_name | Varchar(200) | Name of the survey | |
survey_updated_ts | Timestamp without time zone | UTC date and time of the most recent update to the question | |
page_name | Varchar(200) | Page name on which the question appears | |
page_num | Integer | Internal sequence number for the page | |
element_name | Varchar(200) | Name of the element in which the question appears. Pages have many elements. | |
element_title | Varchar(200) | Title of the element in which the question appears | |
element_type | Varchar(200) | The type of element - text, radio button, and so on. | |
element_id | Varchar(200) | Unique identifier for the element in which the question appears | |
element_num | Integer | Internal sequence enumerating the elements on a page | |
question_id | Varchar(200) | Unique identifier for the question |
UNIQUE INDEX survey_question_survey_id_key ON survey_question USING btree (survey_id, question_id, element_id, page_num, element_num)
The survey_response
dimension table is now deprecated and no longer in use.
Field Name | Data Type | Description | Example values |
---|---|---|---|
survey_id | Varchar(6) | Unique identifier for the survey | |
started_ts | Timestamp without time zone | UTC date and time the survey was started | |
user_id | Varchar(200) | Unique identifier for the user taking the survey | |
question_id | Varchar(200) | Unique identifier for the survey question | |
survey_session | Varchar(200) | hash of survey_id , started_ts , user_id , which can help group questions into a session | |
response_ts | Timestamp without time zone | UTC date and time the response was made | |
answer | Varchar(2048) | Long text field that captures the survey answer |
UNIQUE INDEX survey_response_user_id_key ON survey_response USING btree (user_id, survey_id, question_id, response_ts)
User is the center of the Personalization data model. Much of the data about users is stored in tables other than this one; this table stores top-level information associated with a user. Fields prefixed with loc_
refer to location information. Location codes can be looked up in the Location table. Fields prefixed with or_
refer to the original referring event for this user.
Field Name | Data Type | Description | Example values |
---|---|---|---|
id | Varchar(200) | Unique id for the user | |
id_mod_100 | Integer | An offset from 0 to 99 used to create random partitions in the audience | |
first_activity_ts | Timestamp without time zone | UTC date and time the user was first observed | |
last_activity_ts | Timestamp without time zone | UTC date and time the user was most recently observed | |
engagement_score | Integer | The engagement score is an index that tracks how engaged your site visitors and application users are based on several different factors including visit information, actions, key performance indicators (KPIs), and segments. Higher values indicate deeper engagement. | |
engagement_dt | Date | The time the engagement score was computed. | |
created_ts | Timestamp without time zone | UTC date and time this record was created | |
loc_device_provided | Boolean | true if the location (loc_ fields) was provided by a device (for example, obtained via a GPS retrieval), or false if this location is an approximate determined via geocoding of an IP address | |
loc_ip_address | Varchar(100) | IP Address associated with the user location | |
loc_continent_key | Varchar(100) | 2-letter continent code associated with the user location | NA , AS |
loc_country_code | Char(2) | An ISO 3166-1 alpha-2 country code (for example, US ) | US |
loc_country_numeric_code | Smallint | ISO-3166-1 numeric country code (for example, 840 for United States) | |
loc_region_code | Integer | Location's region code. Note - doesn’t correspond to location(region_code) | |
loc_metro_code | Integer | Location's metro code, corresponds to location(metro_code) . For the US, the metro code is the Nielsen Designated Market Area (DMA) code | |
loc_city_code | Integer | Location's city code, corresponds to location(city_code) | |
loc_postal_code | Varchar(10) | Location's postal code | |
loc_isp | Varchar(100) | Internet Service Provider associated with a location | Telstra Internet , Comcast , Verizon |
loc_organization | Varchar(100) | Organization associated with a location (can be null ) | |
loc_naics_code | Integer | NAICS industry code | |
or_medium | Varchar(50) | Original referrer medium - how the user first arrived | SEARCH , EMAIL , SOCIAL , DIRECT |
or_referrer_source | Varchar(50) | Source of the original referrer | Google , Bing , Yahoo! , Facebook , Pinterest |
or_query_terms | Varchar(512) | Search terms for user who first arrived via search | |
or_referrer_domain | Varchar(100) | Domain of the original referrer | google.com , bing.com , google.de , facebook.com |
or_referrer_reverse_subdomain | Varchar(200) | Full host associated with the original referrer, reversed Used operationally | mx.com.google.www |
is_anonymous | Boolean | true when this user isn’t identifiable | |
lifetime_value | Real | Total amount this user has spent | |
loc_city | Varchar(256) | City name associated with the user's most recent location | |
loc_latitude | Real | Latitude associated with the user's most recent location | |
loc_longitude | Real | Longitude associated with the user's most recent location | |
loc_timezone | Varchar(256) | Timezone associated with the user's most recent location | |
updated_ts | Timestamp without time zone | UTC date and time the user was most recently updated | |
loc_state_province_code | Varchar(256) | Alphanumeric code associated with the user's most recent location | KY , PAC |
or_referring_url | Varchar(2048) | URL associated with the original referrer | https://www.google.com/ |
or_landing_url | Varchar(2048) | URL of the first page the user saw | |
email_address | Varchar(100) | Email address associated with the user, if available |
PRIMARY KEY user_pkey ON "user" USING btree (id)
TABLE "goal_completion_attribution_promoted_item" CONSTRAINT "goal_completion_attribution_promoted_item_user_id_fkey" FOREIGN KEY (user_id) REFERENCES "user"(id)
TABLE "goal_completion_attribution" CONSTRAINT "goal_completion_attribution_user_id_fkey" FOREIGN KEY (user_id) REFERENCES "user"(id)
TABLE "goal_completion_line_item" CONSTRAINT "goal_completion_line_item_user_id_fkey" FOREIGN KEY (user_id) REFERENCES "user"(id)
TABLE "order_line_item_attribute" CONSTRAINT "order_line_item_attribute_user_id_fkey" FOREIGN KEY (user_id) REFERENCES "user"(id)
TABLE "order_line_item" CONSTRAINT "order_line_item_user_id_fkey" FOREIGN KEY (user_id) REFERENCES "user"(id)
TABLE "segment_membership" CONSTRAINT "segment_membership_user_id_fkey" FOREIGN KEY (user_id) REFERENCES "user"(id)
TABLE "user_alias" CONSTRAINT "user_alias_user_id_fkey" FOREIGN KEY (user_id) REFERENCES "user"(id)
TABLE "user_attribute" CONSTRAINT "user_attribute_user_id_fkey" FOREIGN KEY (user_id) REFERENCES "user"(id)
TABLE "user_campaign_state" CONSTRAINT "user_campaign_state_user_id_fkey" FOREIGN KEY (user_id) REFERENCES "user"(id)
TABLE "user_click" CONSTRAINT "user_click_user_id_fkey" FOREIGN KEY (user_id) REFERENCES "user"(id)
TABLE "user_daily_stat_action" CONSTRAINT "user_daily_stat_action_user_id_fkey" FOREIGN KEY (user_id) REFERENCES "user"(id)
TABLE "user_daily_stat_item_stat_category" CONSTRAINT "user_daily_stat_item_stat_category_user_id_fkey" FOREIGN KEY (user_id) REFERENCES "user"(id)
TABLE "user_daily_stat_item_stat_dimension" CONSTRAINT "user_daily_stat_item_stat_dimension_user_id_fkey" FOREIGN KEY (user_id) REFERENCES "user"(id)
TABLE "user_daily_stat_item_stat_product" CONSTRAINT "user_daily_stat_item_stat_product_user_id_fkey" FOREIGN KEY (user_id) REFERENCES "user"(id)
TABLE "user_daily_stat_item_stat_promotion" CONSTRAINT "user_daily_stat_item_stat_promotion_user_id_fkey" FOREIGN KEY (user_id) REFERENCES "user"(id)
TABLE "user_daily_stat" CONSTRAINT "user_daily_stat_user_id_fkey" FOREIGN KEY (user_id) REFERENCES "user"(id)
TABLE "user_dismissal" CONSTRAINT "user_dismissal_user_id_fkey" FOREIGN KEY (user_id) REFERENCES "user"(id)
TABLE "user_engagement_history" CONSTRAINT "user_engagement_history_user_id_fkey" FOREIGN KEY (user_id) REFERENCES "user"(id)
TABLE "user_goal_completion" CONSTRAINT "user_goal_completion_user_id_fkey" FOREIGN KEY (user_id) REFERENCES "user"(id)
TABLE "user_impression" CONSTRAINT "user_impression_user_id_fkey" FOREIGN KEY (user_id) REFERENCES "user"(id)
TABLE "user_order_attribute" CONSTRAINT "user_order_attribute_user_id_fkey" FOREIGN KEY (user_id) REFERENCES "user"(id)
TABLE "user_order" CONSTRAINT "user_order_user_id_fkey" FOREIGN KEY (user_id) REFERENCES "user"(id)
TABLE "user_search" CONSTRAINT "user_search_user_id_fkey" FOREIGN KEY (user_id) REFERENCES "user"(id)
TABLE "user_visit" CONSTRAINT "user_visit_user_id_fkey" FOREIGN KEY (user_id) REFERENCES "user"(id)
This table contains the IDs of any anonymous users that have been merged into a given user. It also contains any non-anonymous IDs they used to have. This occurs when userIDs are changed to a new format, or simply a new ID.
Field Name | Data Type | Description | Example values |
---|---|---|---|
user_id | Varchar(200) | Unique identifier for a user | |
anon_alias | Varchar(200) | User Id associated with this user |
UNIQUE INDEX user_alias_user_id_key ON user_alias USING btree (user_id, anon_alias)
Name-value pairs associated with a user (many different use cases - ids, segment support, and so on)
Field Name | Data Type | Description | Example values |
---|---|---|---|
user_id | Varchar(200) | Unique identifier for the user | |
updated_ts | Timestamp without time zone | UTC date and time this attribute was most recently updated | |
name | Varchar(256) | Name of the attribute | |
value | Varchar(256) | Value of the attribute |
PRIMARY KEY user_attribute_pkey ON user_attribute USING btree (user_id, name, updated_ts)
This table provides summary information about a user or campaign. It mirrors the current state of an operational table for real-time reporting or other application. Although this table is less useful in a warehouse context, it does provide the state at batch time. You can use this table to quickly confirm membership or perform other on-demand tasks that can later be migrated to fully fleshed-out queries.
Field Name | Data Type | Description | Example values |
---|---|---|---|
user_id | Varchar(200) | Unique identifier for the user | |
campaign_id | Varchar(256) | Unique identifier for the campaign | |
last_reset_time_ts | Timestamp without time zone | UTC date and time of the most recent campaign reset | |
experience_id | Varchar(256) | Unique identifier for the experience | |
user_group | Varchar(256) | The user group (control or test) associated with this user's experience | |
num_clicks | Integer | Total number of clicks | |
first_click_ts | Timestamp without time zone | UTC date and time of the least recent click | |
last_click_ts | Timestamp without time zone | UTC date and time of the most recent click | |
num_impressions | Integer | Total number of impressions | |
first_impression_ts | Timestamp without time zone | UTC date and time of the least recent impression | |
last_impression_ts | Timestamp without time zone | UTC date and time of the most recent impression |
UNIQUE INDEX user_campaign_state_user_id_key ON user_campaign_state USING btree (user_id, campaign_id, experience_id, user_group)
Stores click events associated with a campaign at the visit level. Event_ts
is associated with the most recent event.
Field Name | Data Type | Description | Example values |
---|---|---|---|
user_id | Varchar(200) | Unique identifier for the user | |
experience_id | Varchar(256) | Unique identifier for the experience | |
event_ts | Timestamp without time zone | UTC date and time of the most recent click in a session | |
user_group | Char(1) | The user group associated with the user and experience - control (C ) or test (D ) | |
browser | Varchar(256) | Client browser application | Safari , Chrome , Firefox , IE , other |
device | Varchar(256) | Client hardware device | mobile , computer , tablet , other |
engagement | Varchar(256) | Engagement for the associated user | low , medium , high |
has_purchased | Boolean | Set when the user makes a purchase | |
click_count | Smallint | Total number of clicks for the session | |
is_anonymous | Boolean | true when the user isn’t named (identified) | |
is_firsttime | Boolean | true when this visit is a user's first | |
os | Varchar(256) | Operating system - x is "macOS X" | x , windows , linux , ios , android , other |
platform | Varchar(256) | Platform associated with the clicks | Email , Web |
source | Varchar(256) | For customers who use the mobile SDK, each mobile app would be listed as a separate source |
PRIMARY KEY user_click_pkey ON user_click USING btree (user_id, experience_id, event_ts)
Aggregation of events at the (user, day) grain
Field Name | Data Type | Description | Example values |
---|---|---|---|
stat_date | Date | Date of the stat aggregation for this user | |
user_id | Varchar(200) | Unique identifier for the user | |
visit_count | Integer | Number of times user visited on the stat_date | |
visit_millis | Bigint | Total visit duration, in milliseconds | |
total_actions | Integer | Number of actions performed by the user | |
num_pages | Integer | Number of pages the user viewed |
UNIQUE INDEX user_daily_stat_stat_date_key ON user_daily_stat USING btree (stat_date, user_id)
Aggregation of events at the (user, day, action) grain
Field Name | Data Type | Description | Example values |
---|---|---|---|
stat_date | Date | Date of the stat aggregation for this user | |
user_id | Varchar(200) | Unique identifier for the user | |
action_id | Varchar(200) | Identifier for an action performed by the user | Home , Search , View Category , View Product |
action_count | Integer | Total count of actions for this action on this day by the associated user |
UNIQUE INDEX user_daily_stat_action_stat_date_key ON user_daily_stat_action USING btree (stat_date, user_id, action_id)
Aggregation of events at the (user, day, product category) grain
Field Name | Data Type | Description | Example values |
---|---|---|---|
stat_date | Date | Date associated with the stat | |
user_id | Varchar(200) | Unique identifier for the user | |
category_id | Varchar(200) | Unique identifier for the category | |
cart_value | Numeric(18,4) | Total value of items in the cart for this day, category, user | |
num_cart_items | Integer | Count of items in the cart | |
num_purchases | Integer | Count of purchases | |
out_of_stock_views | Integer | Count of views of products that were out of stock | |
purchase_value | Numeric(18,4) | Total value of purchased made for this user, category, date | |
recommended_count | Integer | Number of items recommended to the user for this category | |
view_time_millis | Integer | Total view time for the category in milliseconds | |
view_value | Numeric(18,4) | The sum of the value of items viewed in this category | |
views | Integer | Number of views for this category, day, user |
UNIQUE INDEX user_daily_stat_item_stat_category_stat_date_key ON user_daily_stat_item_stat_category USING btree (stat_date, user_id, category_id)
Aggregation of events at the (user, day, product dimension) grain
Field Name | Data Type | Description | Example values |
---|---|---|---|
stat_date | Date | Date associated with the stat | |
user_id | Varchar(200) | Unique identifier for the user | |
dimension_type | Varchar(256) | The name of a dimension. Dimension names are capitalized. | Brand , Gender , Style , ItemClass |
dimension_id | Varchar(256) | Unique identifier for the dimension | |
cart_value | Numeric(18,4) | Total value of items in the cart for this day, dimension, user | |
num_cart_items | Integer | Count of items in the cart | |
num_purchases | Integer | Count of purchases | |
out_of_stock_views | Integer | Count of views of products that were out of stock | |
purchase_value | Numeric(18,4) | Total value of purchased made for this user, dimension, date | |
recommended_count | Integer | Number of items recommended to the user for this dimension | |
view_time_millis | Integer | Total view time for the dimension in milliseconds | |
view_value | Numeric(18,4) | The sum of the value of items viewed in this dimension | |
views | Integer | Number of views for this dimension, day, user |
UNIQUE INDEX user_daily_stat_item_stat_dimension_stat_date_key ON user_daily_stat_item_stat_dimension USING btree (stat_date, user_id, dimension_type, dimension_id)
Aggregation of events at the (user, day, product) grain
Field Name | Data Type | Description | Example values |
---|---|---|---|
stat_date | Date | Date associated with the stat | |
user_id | Varchar(200) | Unique identifier for the user | |
product_id | Varchar(200) | Unique identifier for the product | |
cart_value | Numeric(18,4) | Total value of items in the cart for this day, product, user | |
num_cart_items | Integer | Count of items in the cart | |
num_purchases | Integer | Count of purchases | |
out_of_stock_views | Integer | Count of views of products that were out of stock | |
purchase_value | Numeric(18,4) | Total value of purchased made for this user, product, date | |
recommended_count | Integer | Number of items recommended to the user for this product | |
view_time_millis | Integer | Total view time for the product in milliseconds | |
view_value | Numeric(18,4) | The sum of the value of items viewed in this product | |
views | Integer | Number of views for this product, day, user |
UNIQUE INDEX user_daily_stat_item_stat_product_stat_date_key ON user_daily_stat_item_stat_product USING btree (stat_date, user_id, product_id)
Aggregation of events at the (user, day, promotion) grain
Field Name | Data Type | Description | Example values |
---|---|---|---|
stat_date | Date | Date for the stat | |
user_id | Varchar(200) | Unique identifier for the user | |
promotion_id | Varchar(200) | Unique identifier for the promotion | |
cart_value | Numeric(18,4) | Total value of items in the cart for this day, promotion, user | |
num_cart_items | Integer | Count of items in the cart | |
num_purchases | Integer | Count of purchases | |
out_of_stock_views | Integer | Count of views of promotions associated with an out of stock product | |
purchase_value | Numeric(18,4) | Total value of purchases made for this user, promotion, date | |
recommended_count | Integer | Number of items recommended to the user for this promotion | |
view_time_millis | Integer | Total view time for the promotion in milliseconds | |
view_value | Numeric(18,4) | The sum of the value of promotions viewed | |
views | Integer | Number of views by this user for this promotion and day | |
eligible_for_serving | Integer | Number of times this promotion was eligible to be served | |
requested_for_serving | Integer | Number of times this promotion was requested to be served | |
served | Integer | Number of times this promotion was served |
UNIQUE INDEX user_daily_stat_item_stat_promotion_stat_date_key ON user_daily_stat_item_stat_promotion USING btree (stat_date, user_id, promotion_id)
Stores dismissal events associated with a campaign at the visit level. Event_ts is associated with the most recent event.
Field Name | Data Type | Description | Example values |
---|---|---|---|
user_id | Varchar(200) | Unique identifier for the user | |
experience_id | Varchar(256) | Unique identifier for the experience | |
event_ts | Timestamp without time zone | UTC date and time of the most recent dismissal in a session. | |
user_group | Char(1) | The user group associated with the user and experience - control (C ) or (D ) | |
browser | Varchar(256) | Client browser application | Safari , Chrome , Firefox , IE , other |
device | Varchar(256) | Client hardware device | mobile , computer , tablet , other |
engagement | Varchar(256) | Engagement for the associated user | low , medium , high |
has_purchased | Boolean | Set when the user makes a purchase | |
dismissal_count | Smallint | Total number of dismissals for the session | |
is_anonymous | Boolean | true when the user isn’t named (identified) | |
is_firsttime | Boolean | true when this visit is a user's first | |
os | Varchar(256) | Operating system - x is "macOS X" | x , windows , linux , ios , android , other |
platform | Varchar(256) | Platform associated with the dismissals | Email , Web |
source | Varchar(256) | For customers who use the mobile SDK, each mobile app would be a separate source. |
PRIMARY KEY user_dismissal_pkey ON user_dismissal USING btree (user_id, experience_id, event_ts)
Stores historical engagement values at the user grain
Field Name | Data Type | Description | Example values |
---|---|---|---|
user_id | Varchar(200) | Unique identifier for a user | |
"day" | Date | Date of the day tracked for engagement | |
score | Integer | Engagement score is an integer reflecting a percentage from 0 to 125 and the value depends on account configuration. For more information, see Engagement Score. |
UNIQUE INDEX user_engagement_history_user_id_key ON user_engagement_history USING btree (user_id, "day")
Since goal completions often involve a purchase, purchase data is stored at the top level in this table and is empty for non-purchase goal completions
Field Name | Data Type | Description | Example values |
---|---|---|---|
user_id | Varchar(200) | User who satisfied the goal criteria | |
goal_ts | Timestamp without time zone | Timestamp of the goal completion in UTC | |
goal_id | Varchar(256) | One of: segment id or purchase (p ) | p |
order_id | Varchar(256) | Unique identifier for the order. This ID comes from the customer. | |
order_currency | Varchar(256) | Currency used to purchase | |
order_line_item_count | Smallint | Count of line items in the order | |
order_total_value | Numeric(18,4) | Sum of quantity * price for all line items | |
order_units_count | Smallint | Count of units in the order | |
order_visit_age_minutes | Double precision | Age of the visit at the time of the purchase goal completion | |
order_visit_time | Timestamp without time zone | UTC date and time of the visit during which this order was made | |
browser | Varchar(256) | Client browser application | Safari , Chrome , Firefox , IE , other |
device | Varchar(256) | Client hardware device | mobile , computer , tablet , other |
engagement | Varchar(256) | Engagement for the associated user | low , medium , high |
has_purchased | Boolean | Set when the user makes a purchase | |
is_anonymous | Boolean | true when the user isn’t named (identified) | |
is_first_time | Boolean | true when the completion represents a first encounter with a visitor | |
os | Varchar(256) | Operating system - x is "macOS X" | x , windows , linux , ios , android , other |
platform | Varchar(256) | Platform used in the goal completion (email, web) | Email , Web |
source | Varchar(256) | For customers who use the mobile SDK, each mobile app would be a separate source. |
UNIQUE INDEX user_goal_completion_user_id_key ON user_goal_completion USING btree (user_id, goal_id, goal_ts)
Stores impression events associated with a campaign at the visit level, with the most recent event associated with event_ts
.
Field Name | Data Type | Description | Example values |
---|---|---|---|
user_id | Varchar(200) | Unique identifier for the user | |
experience_id | Varchar(256) | Unique identifier for the experience | |
event_ts | Timestamp without time zone | UTC date and time of the most recent impression in a session. | |
user_group | Char(1) | The user group associated with the user and experience - control (C) or test (D) | |
browser | Varchar(256) | Client browser application | Safari , Chrome , Firefox , IE , other |
device | Varchar(256) | Client hardware device | mobile , computer , tablet , other |
engagement | Varchar(256) | Engagement for the associated user | low , medium , high |
has_purchased | Boolean | Set when the user makes a purchase | |
impression_count | Smallint | Total number of impressions for the session | |
is_anonymous | Boolean | true when the user isn’t named (identified) | |
is_firsttime | Boolean | true when this visit is a user's first | |
os | Varchar(256) | Operating system - x is "macOS X" | x , windows , linux , ios , android , other |
platform | Varchar(256) | Platform associated with the impressions | Email , Web |
source | Varchar(256) | For customers who use the mobile SDK, each mobile app would be a separate source. |
PRIMARY KEY user_impression_pkey ON user_impression USING btree (user_id, experience_id, event_ts)
Stores purchases. Only purchased orders are kept in the Data Warehouse, nothing open
Field Name | Data Type | Description | Example values |
---|---|---|---|
id | Varchar(100) | Unique identifier for the order. This ID comes from the customer. | |
user_id | Varchar(200) | Unique identifier for the user | |
order_num | Smallint | 1-based sequence of orders for this user. Based on the array order in the operational store. (Not set by the customer) | |
visit_start_ts | Timestamp without time zone | Start time of the visit in which this order was placed | |
visit_num | Integer | Visit in which order create time falls within the visit start or end. | |
created_ts | Timestamp without time zone | UTC date and time at which the order was created | |
updated_ts | Timestamp without time zone | UTC date and time the order was most recently updated | |
purchased_ts | Timestamp without time zone | UTC date and time the purchase was made | |
visit_age_at_purchase_ms | Integer | Age of the session, in milliseconds, at purchase time | |
num_items | Integer | Number of items in the order | |
num_units | Integer | Number of units (distinct items) in the order | |
total_value | Numeric(18,4) | Total value of the purchase | |
currency | Varchar(200) | Currency used to make the purchase | |
status | Varchar(200) | Purchased only, other states not stored in the warehouse. (Open , Purchased , Canceled ). |
PRIMARY KEY user_order_pkey ON user_order USING btree (id)
UNIQUE INDEX user_order_user_id_key ON user_order USING btree (user_id, created_ts)
TABLE "order_line_item_attribute" CONSTRAINT "order_line_item_attribute_order_id_fkey" FOREIGN KEY (order_id) REFERENCES user_order(id)
TABLE "order_line_item" CONSTRAINT "order_line_item_order_id_fkey" FOREIGN KEY (order_id) REFERENCES user_order(id)
TABLE "user_order_attribute" CONSTRAINT "user_order_attribute_order_id_fkey" FOREIGN KEY (order_id) REFERENCES user_order(id)
Name-value pairs associated with an order
Field Name | Data Type | Description | Example values |
---|---|---|---|
order_id | Varchar(100) | Unique identifier for the order | |
user_id | Varchar(200) | User who made the purchase | |
order_num | Smallint | Internally generated 1-based sequence indicating the order number | |
attribute_name | Varchar(256) | The name of the attribute | |
attribute_value | Varchar(256) | The value of the attribute | |
value_metadata_origin | Varchar(256) | The name of the entity that issues or creates the initial attribute value | CRM , PointOfSaleSystem , FulfillmentSystem , LoyaltySystem |
value_metadata_provider | Varchar(256) | The name of the entity that is providing the attribute | CsvUserEtlJob:user-20190528.csv.gz |
value_metadata_gear_id | Varchar(256) | ID of the Personalization gear that updated the attribute, or null if it wasn’t updated by a gear | |
value_metadata_last_updated_ts | Varchar(256) | UTC date and time when the attribute was last updated | |
value_metadata_last_verified_ts | Varchar(256) | UTC date and time when the attribute value was last verified as being true and belonging to the specified individual | |
value_metadata_classification | Varchar(256) | Metadata relevant or pertaining to the security classification of a given attribute's value |
PRIMARY KEY user_order_attribute_pkey ON user_order_attribute USING btree (user_id, order_id, attribute_name)
User search terms (some normalization and tokenization is performed)
Field Name | Data Type | Description | Example values |
---|---|---|---|
user_id | Varchar(200) | User who performed the search | |
term | Varchar(200) | Search term (tokenized) | |
most_recent_search | Timestamp without time zone | UTC date and time of the most recent search for this term | |
product_clicks | Integer | Count of product clicks associated with the search | |
purchase_value | Numeric(18,4) | Total purchase value of orders associated with this search | |
search_count | Integer | Total number of searches for this term |
PRIMARY KEY user_search_pkey ON user_search USING btree (user_id, term)
Use this table to join the user_visit_detail
with other tables containing a user_id
. The user_id
in this table corresponds to the general notion of user_id
in the database, and user(id)
. The user_visit_key
is the user_id
in the user_visit_detail
table.
Field Name | Data Type | Description | Example values |
---|---|---|---|
user_id | Varchar(200) | User id from the user table | |
user_id_hashed | Varchar(200) | Hashed user id from the user_visit_detail table |
UNIQUE INDEX user_user_visit_lookup_user_id_key ON user_user_visit_lookup USING btree (user_id, user_id_hashed)
Stores information about the user visit
Fields that only appear in user visit: referring_campaign_id
, weather
, previous_path
, temperature
, referrer
, num_pageviews
, num_events
, last_event_ts
, visit_num
Fields that appear in both user visit and user visit detail: is_anonymous
, browser
, engagement
, source
, utm_parameters
, device
, is_firsttime
, has_purchased
, platform
, start_ts
, _dw_created_ts
, os
, user_id
The user_id
user_visit_detail
is a hash value of the user ID in this table; use user_user_lookup
to join
Field Name | Data Type | Description | Example values |
---|---|---|---|
user_id | Varchar(200) | User id associated with the visit | |
visit_num | Smallint | Internally generated sequence value in the visit history - the visit number. | |
num_events | Integer | Count of events for the visit | |
previous_path | Varchar(100) | The most recent page view action for this visit (operation field) | |
num_pageviews | Integer | Count of pages viewed in the visit | |
referring_campaign_id | Varchar(32) | External campaign that drove the visit | |
device | Varchar(100) | Client hardware device | mobile , computer , tablet , other |
engagement | Varchar(100) | Engagement for the associated user | low , medium , high |
os | Varchar(100) | Operating system - x is "macOS X" | x , windows , linux , ios , android , other |
browser | Varchar(100) | Client browser application | Safari , Chrome , Firefox , IE , other |
platform | Varchar(100) | Platform used in the goal completion (email, web) | Email, Web |
temperature | Varchar(100) | Recorded temperature at the physical location of the user during the visit time | |
weather | Varchar(100) | Recorded weather at the physical location of the user during the visit time | |
referrer | Varchar(2048) | HTTP referrer for the visit | |
start_ts | Timestamp without time zone | UTC date and time the visit began | |
last_event_ts | Timestamp without time zone | UTC date and time of the most recent event in the visit | |
utm_parameters | Varchar(100) | Urchin Tracking Module (UTM) parameters identify the marketing campaign that refers traffic to a specific website and are associated with the visit's referrer | |
has_purchased | Boolean | Set when the user makes a purchase | |
is_anonymous | Boolean | true when the user isn’t named (identified) | |
is_first_time | Boolean | true when this visit is the user's first | |
source | Varchar(10) | For customers who use the mobile SDK, each mobile app would be a separate source |
PRIMARY KEY user_visit_pkey ON user_visit USING btree (user_id, start_ts)
UNIQUE INDEX user_visit_user_id_key ON user_visit USING btree (user_id, visit_num)
TABLE "user_order" CONSTRAINT "user_order_user_id_visit_num_fkey" FOREIGN KEY (user_id, visit_num) REFERENCES user_visit(user_id, visit_num)
TABLE "user_order" CONSTRAINT "user_order_user_id_visit_start_ts_fkey" FOREIGN KEY (user_id, visit_start_ts) REFERENCES user_visit(user_id, start_ts)
Stores additional information about the user visit - location and referrer are usually of interest.
The following fields appear only in the visit detail, not the visit: region_code
, referrer_domain
, revenue
, city_code
, metro_code
, longitude
, industry_code
, referring_campaign
, country_code
, action_count
, page_view_count
, referrer_subdomain
, referrer_url
, referrer_terms
, referrer_source
, latitude
, duration_minutes
, referrer_landing_url
, referrer_medium
Fields that appear in both this table and user_visit
: is_anonymous
, browser
, engagement
, source
, utm_parameters
, device
, is_firsttime
, has_purchased
, platform
, start_ts
, _dw_created_ts
, os
, user_id
The user_id
in this table is a hash value on the user_id
in user_visit
Field Name | Data Type | Description | Example values |
---|---|---|---|
user_id_hashed | Varchar(200) | Hash code of the user_id (id from the user table) associated with this visit | |
start_ts | Timestamp without time zone | UTC date and time the visit started | |
referrer_medium | Varchar(100) | How the user first arrived | SEARCH , EMAIL , SOCIAL , DIRECT |
referrer_source | Varchar(100) | Source of the visit | Google , Bing , Yahoo! , Facebook , Pinterest |
referrer_terms | Varchar(255) | Search terms for associated with the referral | |
referrer_domain | Varchar(100) | Domain of the visit referrer | google.com , bing.com , google.de , facebook.com |
referrer_subdomain | Varchar(100) | Referrer host with subdomain | www.google.com.mx |
referrer_url | Varchar(2048) | URL associated with the visit referrer | |
referrer_landing_url | Varchar(2048) | URL of the first page the user saw | |
utm_parameters | Varchar(100) | Urchin Tracking Module (UTM) parameters identify the marketing campaign that refers traffic to a specific website and are associated with the visit's referrer | |
latitude | Numeric(9,6) | Latitude associated with the visitor's physical location | |
longitude | Numeric(9,6) | Longitude associated with the visitor's physical location | |
country_code | Varchar(100) | 2-letter Country code associated with the visit | |
region_code | Varchar(100) | Region code associated with the visit | |
metro_code | Integer | Metro code associated with the visit. Metro codes for US are Nielsen DMA codes | |
city_code | Integer | Code for the city associated with the visit | |
industry_code | Integer | NAICS industry code | |
referring_campaign | Varchar(32) | External campaign that drove the visit | |
device | Varchar(100) | Client hardware device | mobile , computer , tablet , other |
engagement | Varchar(100) | Engagement for the associated user | low , medium , high |
os | Varchar(100) | Operating system - x is "macOS X" | x , Windows , Linux , iOS , Android , other |
browser | Varchar(100) | Client browser application | Safari , Chrome , Firefox , IE , other |
platform | Varchar(100) | Platform (email, web) | Email , Web , Mobile |
has_purchased | Boolean | Set when the user makes a purchase | |
is_anonymous | Boolean | true when the user isn’t named (identified) | |
is_first_time | Boolean | true when this visit is the user's first | |
source | Varchar(10) | For customers who use the mobile SDK, each mobile app would be a separate source | |
duration_minutes | Double precision | Time spent in the visit, in minutes | |
revenue | Numeric(18,4) | Total revenue associated with purchases made during the visit | |
action_count | Integer | Count of actions performed this visit | |
page_view_count | Integer | Count of pages viewed this visit |
PRIMARY KEY user_visit_detail_pkey ON user_visit_detail USING btree (user_id_hashed, start_ts)