You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/unify/data-graph/index.md
+22-23Lines changed: 22 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,14 +3,12 @@ title: Data Graph
3
3
plan: unify
4
4
redirect_from:
5
5
- '/unify/linked-profiles/data-graph'
6
+
- '/unify/data-graph/data-graph'
6
7
---
7
8
8
-
The Data Graph is a semantic layer that unifies all your customer datasets, letting you define and manage relationships between any entity data set in your warehouse (accounts, subscriptions, households, products) and the Segment Profiles you send with [Profiles Sync](/docs/unify/profiles-sync/).
9
+
The Data Graph acts as a semantic layer that allows businesses to define relationships between various entity datasets in the warehouse — such as accounts, subscriptions, households, and products — with the Segment Profile. It makes these relational datasets easily accessible to business teams for targeted and personalized customer engagements.
9
10
10
-
By linking these datasets, the Data Graph turns complex relational data into actionable insights, enabling marketers and business stakeholders to create targeted, personalized customer interactions.
11
-
relational data into actionable insights, making it accessible to marketers and business stakeholders
12
-
13
-
-**[Linked Audiences](/docs/engage/audiences/linked-audiences/)**: Empowers marketers to self-serve and build targetic logic based on any datasets defined in the Data Graph, unlocking new possibilities for hyper-personalized campaigns.
11
+
-**[Linked Audiences](/docs/engage/audiences/linked-audiences/)**: Empowers marketers to effortlessly create targeted audiences by combining behavioral data from the Segment Profile and warehouse entity data within a self-serve, no-code interface. This tool accelerates audience creation, enabling precise targeting, enhanced customer personalization, and optimized marketing spend without the need for constant data team support.
14
12
-**[Linked Events](/docs/unify/data-graph/linked-events/)**: Allows data teams to enrich event streams in real time using datasets from data warehouses or lakes, and send these enriched events to any destination. Linked Events is available for both Destination Actions and Functions.
15
13
16
14
## Prerequisites
@@ -19,17 +17,20 @@ To use the Data Graph, you'll need the following:
19
17
20
18
- A supported data warehouse with the appropriate Data Graph permissions
21
19
- Workspace Owner or Unify Read-only/Admin and Entities Admin permissions
22
-
- For Linked Audiences, set up [Profiles Sync](/docs/unify/profiles-sync/) in a Unify space with ready-to-use [data models and tables](/docs/unify/profiles-sync/tables/) in your warehouse. When setting up selective sync, Segment recommends the following settings for Linked Audiences:
20
+
- For Linked Audiences, set up [Profiles Sync](/docs/unify/profiles-sync/) in a Unify space with ready-to-use [data models and tables](/docs/unify/profiles-sync/tables/) in your warehouse. When setting up selective sync, Segment recommends the following settings:
23
21
- Under **Profile materialized tables**, select all the tables (`user_identifier`, `user_traits`, `profile_merges`) for faster and more cost-efficient Linked Audiences computations in your data warehouse.
24
22
- Under **Track event tables**, select **Sync all Track Call Tables** to enable filtering on event history for Linked Audiences conditions.
25
23
26
24
## Step 1: Set up Data Graph permissions in your data warehouse
27
25
> warning ""
28
26
> Data Graph, Reverse ETL, and Profiles Sync require different warehouse permissions.
27
+
29
28
> info ""
30
29
> Data Graph currently only supports workspaces in the United States.
31
30
32
-
To get started with the Data Graph, set up the required permissions in your warehouse. Segment supports [Snowflake](/docs/unify/data-graph/setup-guides/snowflake-setup/) and [Databricks](/docs/unify/data-graph/setup-guides/databricks-setup/) for both Linked Audiences and Linked Events.
31
+
To get started with the Data Graph, set up the required permissions in your warehouse. Segment supports the following:
32
+
- Linked Audiences: [Snowflake](/docs/unify/data-graph/setup-guides/snowflake-setup/) and [Databricks](/docs/unify/data-graph/setup-guides/databricks-setup/)
33
+
- Linked Events: [Snowflake](/docs/unify/data-graph/setup-guides/snowflake-setup/), [Databricks](/docs/unify/data-graph/setup-guides/databricks-setup/), [BigQuery](/docs/unify/data-graph/setup-guides/BigQuery-setup/), and [Redshift](/docs/unify/data-graph/setup-guides/redshift-setup/)
33
34
34
35
To track the data sent to Segment on previous syncs, Segment uses [Reverse ETL](/docs/connections/reverse-etl/) infrastructure to store diffs in tables within a dedicated schema called `_segment_reverse_etl` in your data warehouse. You can choose which database or project in your warehouse this data lives in.
35
36
@@ -59,7 +60,7 @@ The Data Graph is a semantic layer that represents a subset of relevant business
59
60
60
61
**Defining Relationships**
61
62
62
-
Similar to the concept of [cardinality in data modeling](en.wikipedia.org/wiki/Cardinality_(data_modeling)){:target="_blank"}, the Data Graph supports 3 types of relationships:
63
+
Similar to the concept of [cardinality in data modeling](https://w.wiki/Ay$u){:target="_blank"}, the Data Graph supports 3 types of relationships:
63
64
-**Profile-to-entity relationship:** This is a relationship between your entity table and the Segment Profiles tables, and is the first level of relationship.
64
65
-**1:many relationship:** For example, an `account` can have many `carts`, but each `cart` can only be associated with one `account`.
65
66
-**many:many relationship:** For example, a user can have many `carts`, and each `cart` can have many `products`. However, these `products` can also belong to many `carts`.
@@ -110,7 +111,7 @@ data_graph {
110
111
# Recommend setting up Profiles Sync materialized views to optimize warehouse compute costs
111
112
profile {
112
113
profile_folder = "PRODUCTION.SEGMENT"
113
-
type = "segment:materialized"
114
+
type = "segment:materialized"
114
115
115
116
# First branch - relate accounts table to the profile
116
117
# This is a unique type of relationship between an entity and the profile block
@@ -198,7 +199,7 @@ data_graph {
198
199
199
200
### 3b: Define the profile
200
201
> info ""
201
-
> Segments recommends that you select materialized views under the Profiles Sync Selective Sync settings to optimize warehouse compute costs.
202
+
> Segments recommends that you select materialized views under the Profiles [Selective Sync settings](/docs/unify/profiles-sync/profiles-sync-setup/#step-3-set-up-selective-sync) to optimize warehouse compute costs.
202
203
203
204
Next, define the profile. This is a special class of entity that represents Segment Profiles, which corresponds to the Profiles Sync tables and models. For Linked Audiences, this allows marketers to filter on profile traits, event history, etc. There can only be one profile for a Data Graph.
204
205
@@ -227,15 +228,13 @@ data_graph {
227
228
228
229
### 3c: Define relationships
229
230
230
-
Now define your relationships between your entities. The Data Graph supports three types of relationships:
231
-
- Profile:entity relationship. This is the first level of relationships
232
-
-1:many relationship
233
-
- Many:many relationship
234
-
235
-
All relationship types require you to define the relationship slug, name, and related entity. Each type of relationship has unique join on conditions.
231
+
Now define your relationships between your entities. Similar to the concept of [cardinality in data modeling](en.wikipedia.org/wiki/Cardinality_(data_modeling)), the Data Graph supports 3 types of relationships below. All relationship types require you to define the relationship slug, name, and related entity. Each type of relationship has unique join on conditions.
232
+
-**[Profile-to-entity relationship](#define-profile-to-entity-relationship):** This is a relationship between your entity table and the Segment Profiles tables, and is the first level of relationship.
233
+
-**[1:many relationship](#define-a-1many-relationship):** For example, an `account` can have many `carts`, but each `cart` can only be associated with one `account`.
234
+
-**[many:many relationship](#define-manymany-relationship):** For example, a user can have many `carts`, and each `cart` can have many `products`. However, these `products` can also belong to many `carts`.
236
235
237
236
#### Define profile-to-entity relationship
238
-
This is the first level of relationships and a unique type of relationship between Segment profile entity and a related entity.
237
+
This is the first level of relationships and a unique type of relationship between the Segment profile entity and a related entity.
@@ -245,13 +244,13 @@ This is the first level of relationships and a unique type of relationship betwe
245
244
246
245
To define a profile-to-entity relationship, reference your entity table and depending on your table columns, choose to join on one of the following:
247
246
248
-
**Option 1 (Most common):** Use the `external_id` block to join the profile entity with an entity table using external IDs from your [Unify ID resolution](/docs/unify/identity-resolution/externalids/) settings. Typically these identifiers are `user_id`, `email`, or`phone` depending on the column in the entity table that you want to join with.
247
+
**Option 1 (Most common)- Join on an external ID:** Use the `external_id` block to join the profile entity with an entity table using external IDs from your [Unify ID resolution](/docs/unify/identity-resolution/externalids/) settings. Typically these identifiers are `user_id`, `email`, or`phone` depending on the column in the entity table that you want to join with.
249
248
-`type`: Represents the [external IDtype](/docs/unify/identity-resolution/externalids/#default-externalids) (`email`, `phone`, `user_id`) in your id-res settings. Depending on if you are using materialized or unmaterialized profiles, these correspond to different columns in your Profiles Sync warehouse tables:
250
249
- [Materialized](/docs/unify/profiles-sync/tables/#the-user_identifiers-table) (Recommended): This corresponds to the `type` column in your Profiles Sync `user_identifiers` table.
251
250
- [Unmaterialized](/docs/unify/profiles-sync/tables/#the-external_id_mapping_updates-table): This corresponds to the `external_id_type` column in your Profiles Sync `external_id_mapping_updates` table.
252
251
-`join_key`: This is the column on the entity table that you are matching to the external identifier.
253
252
254
-
**Option 2:** Use the `traits` block to join the profile entity with an entity table using [Profile Traits](/docs/unify/#enrich-profiles-with-traits).
253
+
**Option 2- Join on a profile trait:** Use the `traits` block to join the profile entity with an entity table using [Profile Traits](/docs/unify/#enrich-profiles-with-traits).
255
254
-`name`: Represents a trait name in your Unify profiles. Depending on if you are using materialized or unmaterialized profiles, these correspond to different columns in your Profiles Sync warehouse tables:
256
255
- [Materialized](/docs/unify/profiles-sync/tables/#the-profile_traits-table) (Recommended): The trait name corresponds to a unique value of the `name` column in your Profiles Sync `user_traits` table.
257
256
- [Unmaterialized](/docs/unify/profiles-sync/tables/#the-profile_traits_updates-table): This corresponds to a column in the Profile Sync `profile_trait_updates` table.
@@ -339,7 +338,7 @@ data_graph {
339
338
For many:many relationships, define the join on between the two entity tables with the `junction_table`.
340
339
341
340
> warning ""
342
-
> Attributes from a junction table are not referenceable via the Linked Audience Builder. If a marketer would like to filter upon a column on the junction table, you must define the junction as an entity and define a relationship.
341
+
> Attributes from a junction table are not referenceable via the Linked Audience builder. If a marketer would like to filter upon a column on the junction table, you must define the junction as an entity and define a relationship.
343
342
344
343
345
344
| Parameters | Definition |
@@ -352,7 +351,7 @@ For many:many relationships, define the join on between the two entity tables wi
|`table_ref`| Defines the fully qualified table reference to the join table: `[database name].[schema name].[table name]` Segment flexibly supports tables, views and materialized views |
354
+
|`table_ref`| Defines the fully qualified table reference to the join table: `[database name].[schema name].[table name]`. Segment flexibly supports tables, views and materialized views |
356
355
|`primary_key`| The unique identifier for the given table. Must be a column with unique values per row |
357
356
|`left_join_on`| Define the relationship between the left entity table and the junction table: `[left entity slug].[column name] = [junction table column name]`. Note that schema and table are implied within the junction table column name, so you do not need to define it again |
358
357
|`right_join_on`| Define the relationship between the junction table and the right entity table: `[junction table column name] = [right entity slug].[column name]`. Note that schema and table are implied within the junction table column name, so you do not need to define it again |
@@ -403,7 +402,7 @@ To edit your Data Graph:
403
402
404
403
### View Data Graph data consumers
405
404
406
-
A data consumer refers to a Segment feature (like Linked Events, Linked Audiences) referencing datasets, such as entities and/or relationships, from the Data Graph. You can view a list of data consumers in two places:
405
+
A data consumer refers to a Segment feature like Linked EventsandLinked Audiences that are referencing datasets, such as entities and/or relationships, from the Data Graph. You can view a list of data consumers in two places:
407
406
- Under **Unify > Data Graph**, click the **Data consumers** tab
408
407
- Under **Unify > Data Graph > Overview**or the **Data Graph editor > Preview**, click into a node on the Data Graph preview and a side sheet will pop up with the list of data consumers for the respective relationship
409
408
@@ -415,4 +414,4 @@ Upon editing and saving changes to your Data Graph, a modal will pop up to warn
415
414
416
415
### Detect warehouse breaking changes
417
416
418
-
Segment has a service that regularly scans and monitors the Data Graph for changes that occur in your warehouse that may break components of the Data Graph, such as when the table being referenced by the Data Graph gets deleted from your warehouse or when the primary key column no longer exists. An alert banner will be displayed on the Data Graph landing page. The banner will be removed once the issues are resolved in your warehouse and/or the Data Graph.
417
+
Segment has a service that regularly scans and monitors the Data Graph for changes that occur in your warehouse that may break components of the Data Graph, such as when the table being referenced by the Data Graph gets deleted from your warehouse or when the primary key column no longer exists. An alert banner will be displayed on the Data Graph landing page. The banner will be removed once the issues are resolved in your warehouse and/or the Data Graph. You will also have the option to trigger a manual sync of your warehouse schema.
0 commit comments