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/linked-profiles/data-graph.md
+26-25Lines changed: 26 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,9 @@ plan: unify
4
4
beta: true
5
5
---
6
6
7
+
> info "Segment's Data Graph is in private beta"
8
+
> The Data Graph is in private beta, and Segment is actively working on this feature. Some functionality may change before it becomes generally available. [Contact Segment](https://segment.com/help/contact/){:target="_blank"} with any feedback or questions.
9
+
7
10
With Linked Profiles, you can build a Data Graph that defines relationships between any entity data set in the warehouse and the Segment Profiles you send with Profiles Sync.
8
11
9
12
Make this relational data accessible to marketers and business stakeholders to empower them with the data they need to create targeted and personalized customer engagements.
@@ -15,10 +18,10 @@ Make this relational data accessible to marketers and business stakeholders to e
15
18
16
19
To use the Data Graph, you'll need the following:
17
20
- A Snowflake Data Warehouse.
18
-
- An [Actions-based Destination](/docs/connections/destinations/actions/#available-actions-based-destinations).
21
+
- An [actions-based destination](/docs/connections/destinations/actions/#available-actions-based-destinations).
19
22
20
23
> info ""
21
-
> Linked Profiles follows Zero Copy principles, and doesn't copy entities to store in Segment. Segment stores and processes all data in the United States.
24
+
> Linked Profiles follows zero-copy principles, and doesn't copy entities to store in Segment. Segment stores and processes all data in the United States.
22
25
23
26
> warning ""
24
27
> Don't send any personal health information with the Data Graph.
@@ -47,31 +50,23 @@ To track what data has been sent to Segment on previous syncs, Segment stores de
47
50
48
51
To connect your warehouse to the Data Graph:
49
52
50
-
1.In your Segment workspace, navigate to **Unify**, and select **Data Graph**.
53
+
1.Navigate to **Unify > Data Graph**.
51
54
- This should be a Unify space with Profiles Sync already set up.
52
55
2. Click **Connect warehouse**.
53
56
3. Select your warehouse type.
57
+
- Note that Linked Audiences only supports Snowflake.
54
58
4. Enter your warehouse credentials.
55
59
5. Test your connection, then click **Save**.
56
60
57
61
## Step 3: Build your Data Graph
58
62
59
63
The Data Graph is a semantic layer that represents a subset of relevant business data that you'll use for audience targeting and personalization in downstream tools.
60
64
61
-
Use the configuration language spec below to add models to build your Data Graph.
62
-
63
-
### Delete and edit entities and/or relationships from your Data Graph
64
-
65
-
> info ""
66
-
> Each Unify space has one Data Graph. The current version is v0.0.6.
67
-
68
-
Segment recommends creating a new Linked Audience or Linked Event. Deleting entities and relationships are not yet supported. Editing entities and relationships in the Data Graph may lead to errors if these entities or relationships are referenced in existing Linked Audiences and Linked Events.
69
-
70
-
While you can delete relationships or entities from the Data Graph, these relationships and entities will still display in the Linked Audience builder and Linked Events.
65
+
Use the configuration language spec below to add models to build your Data Graph. The Data Graph currently supports 6 layers of depth, including the Profile entity.
71
66
72
67
### Define entities
73
68
74
-
Use the parameters, defintions, and examples below to help you define entities.
69
+
Use the parameters, definitions, and examples below to help you define entities.
75
70
76
71
> warning ""
77
72
> Snowflake schemas are case sensitive, so you'll need to reflect the schema, table, and column names based on how you case them in Snowflake.
@@ -131,7 +126,6 @@ Use the following relationship, parameters, and examples to help you relate enti
131
126
> warning ""
132
127
> Snowflake schemas are case sensitive, so you'll need to reflect the schema, table, and column names based on how you case them in Snowflake.
133
128
134
-
<!--Bookmark -->
135
129
#### Relate Entity to Profile
136
130
137
131
| Parameters | Definition |
@@ -194,7 +188,7 @@ data_graph {
194
188
|`relationship`| A unique slug for the relationship, which is immutable and treated as a delete if you make changes. The slug must be in all lowercase and will support dashes or underscores (for example, `user-account` or `user_account`). |
195
189
|`name`| This should be a unique label that displays throughout your Segment space. |
196
190
|`related_entity`| Reference your already defined entity. |
197
-
|`join_on`|Define relationships between two entity tables `[lefty entity name].[column name] = [right entity name].[column name]`. Note that the entity name is a reference to the alias provided in the config and doesn't need to be the fully qualified table name. |
191
+
|`join_on`|Defines relationships between two entity tables `[lefty entity name].[column name] = [right entity name].[column name]`. Note that the entity name is a reference to the alias provided in the config and doesn't need to be the fully qualified table name. |
198
192
199
193
200
194
```py
@@ -215,15 +209,17 @@ data_graph {
215
209
216
210
```
217
211
218
-
#### relating entities with a junction table
212
+
#### Relating entities with a junction table
219
213
220
-
If you're relating entities with a junction table:
214
+
If you're relating entities with a junction table:
221
215
222
-
-`Junction_table`: Define relationships between two entities tables joined by a junction table.
223
-
-`table_ref`: Define the table reference to the join table. In order to specify a connection to your table in Snowflake, a fully qualified table reference is required: `[database name].[schema name].[table name]`.
224
-
-`primary_key`: The unique identifier on the join table and should be a column with unique values per row.
225
-
-`left_join_on`: Define relationship between the two entity tables: `[left entity name].[column name] = [junction table column name]`.
226
-
-`right_join_on`: Define relationship between the two entity tables: `[junction table column name] = [right entity name].[column name]`.
|`Junction_table`| Define the table reference to the join table. In order to specify a connection to your table in Snowflake, a fully qualified table reference is required: `[database name].[schema name].[table name]`. |
219
+
|`table_ref`| Define the table reference to the join table. In order to specify a connection to your table in Snowflake, a fully qualified table reference is required: `[database name].[schema name].[table name]`. |
220
+
|`primary_key`| The unique identifier on the join table and should be a column with unique values per row. |
221
+
|`left_join_on`| Define relationship between the two entity tables: `[left entity name].[column name] = [junction table column name]`. |
222
+
|`right_join_on`| Define relationship between the two entity tables: `[junction table column name] = [right entity name].[column name]`. |
227
223
228
224
Note that `schema.table` is implied within the junction table column name and doesn't need to be provided.
229
225
@@ -244,7 +240,7 @@ data_graph {
244
240
related_entity = "product-entity"
245
241
junction_table {
246
242
primary_key = "id"
247
-
table_ref = "PRODUCTION.CUSTOM.CART_PRODUCT"
243
+
table_ref = "PRODUCTION.CUSTOMER.CART_PRODUCT"
248
244
left_join_on = "CART.ID = CART_ID"
249
245
#schema.table is implied within the cart_id key
250
246
right_join_on = "PRODUCT_ID = PRODUCT.SKU"
@@ -253,9 +249,9 @@ data_graph {
253
249
}
254
250
}
255
251
}
256
-
}
257
252
258
253
```
254
+
## Data Graph Example
259
255
260
256

261
257
@@ -334,6 +330,11 @@ To edit your Data Graph:
334
330
1. Navigate to **Unify > Data Graph**.
335
331
2. Select the **Builder** tab, and click **Edit Data Graph**.
336
332
333
+
Segment recommends creating a new Linked Audience or Linked Event. Deleting entities and relationships are not yet supported. Editing entities and relationships in the Data Graph may lead to errors if these entities or relationships are referenced in existing Linked Audiences and Linked Events.
334
+
335
+
> info ""
336
+
> While you can edit entities and relationships in the Data Graph, these relationships and entities will still display in the Linked Audience Builder and Linked Events.
337
+
337
338
You can edit your Data Graph at any time. However, some types of edits may impact existing Linked Audiences and Linked Events. These include:
338
339
339
340
- Adding a new relationship before an existing relationship
Copy file name to clipboardExpand all lines: src/unify/linked-profiles/linked-audiences.md
+27-12Lines changed: 27 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,16 @@ plan: unify
4
4
beta: true
5
5
---
6
6
7
+
> info "Linked Audiences is in private beta"
8
+
> Linked Audiences is in private beta, and Segment is actively working on this feature. Some functionality may change before it becomes generally available. [Contact Segment](https://segment.com/help/contact/){:target="_blank"} with any feedback or questions.
9
+
7
10
With Linked Audiences, you can use the relational data you've defined in your Data Graph to build audiences and send them to your downstream destinations.
8
11
9
12
From the relationships you've defined between the profiles and entities in your warehouse, you can filter on an entity, profile trait, and audience membership conditions to create hyper-segmented audiences.
10
13
14
+
> info "Linked Audiences warehouse support"
15
+
> At this time, Linked Audiences only supports Snowflake.
16
+
11
17
> success ""
12
18
> Before you build Linked Audiences, be sure you've defined entities in your [Data Graph](/docs/unify/linked-profiles/data-graph/).
13
19
@@ -17,7 +23,7 @@ From the relationships you've defined between the profiles and entities in your
17
23
To help you get started with Linked Audiences, consider the following best practices:
18
24
19
25
1. It may be helpful to first identify an entity that is directly associated with your users, such as `Accounts`, `Households`, or `Organizations`.
20
-
2. From there you can define relationships between this entity with any of the other entities that may associated with it, such as how `Accounts` can have the following: `Subscriptions`, `Purchases`, or `Carts`.
26
+
2. From there you can define relationships between this entity with any of the other entities that may be associated with it, such as how `Accounts` can have the following: `Subscriptions`, `Purchases`, or `Carts`.
21
27
3. You can create entity relationships up to six levels in depth. For example, an entity condition that queries for relationships between `Profiles`, `Accounts`, `Credit Cards`, and `Transactions` has four levels of depth.
22
28
4. To further refine your audience, identify column values that you might also want to filter your entities by, or configure profile trait and audience membership conditions.
23
29
@@ -28,7 +34,7 @@ Below are some example use cases to help you learn more about Linked Audiences.
28
34
### Build an audience of cat owners who are also a part of the platinum membership tier
29
35
30
36
Build an audience with `Households` and `Pets` where:
@@ -46,8 +52,8 @@ Furthermore, filtering the audience against `profile.audience_membership` for "P
46
52
### Build an audience of users with premium subscriptions who are located in Canada
47
53
48
54
Build an audience with `Accounts` and `Subscriptions`, where the following are true:
49
-
-`subscription.status`equals "active"
50
-
-`subscription.tier`equals "premium"
55
+
-`subscription.status`= "active"
56
+
-`subscription.tier`= "premium"
51
57
52
58
And where:
53
59
-`profile.country` = "Canada"
@@ -91,7 +97,7 @@ Use the Audience overview page to build or maintain a Linked Audiences.
91
97
6. Enter an audience name and description, then click **Create Audience**.
92
98
93
99
> warning ""
94
-
> At this time, Linked Audiences can't be edited or deleted. Create a new audience to update conditions. To disable an audience, navigate to the **Settings** tab of an audience and toggle the **Enabled** button off.
100
+
> Linked Audiences can't be edited or deleted. Create a new audience to update conditions. To disable an audience, navigate to the **Settings** tab of an audience and toggle the **Enabled** button off.
95
101
96
102
97
103
## Step 2: Activate your Linked Audience
@@ -106,12 +112,12 @@ You can use your Linked Audience to activate any [actions-based destination](/do
106
112
107
113
### Step 2a: Add an action destination
108
114
109
-
To activate your Linked Audience, you'll first need to add an action destination.
115
+
To activate your Linked Audience, you first need to add an action destination.
110
116
111
117
From the Add destination window, select your destination and click **Next**.
112
118
113
119
### Step 2b: Select event
114
-
After adding an actions destination, select what type of event you want to send to the destination. Events update the destination about changes to your entity or audiences. You can then use these actions to orchestrate campaigns in other tools.
120
+
After adding an actions-based destination, select what type of event you want to send to the destination. Events update the destination about changes to your entity or audiences. You can then use these actions to orchestrate campaigns in other tools.
115
121
116
122
You can send events:
117
123
- When an entity on a profile changes:
@@ -123,7 +129,7 @@ You can send events:
123
129
-[Audience Exited](#audience-exited)
124
130
125
131
> info ""
126
-
> Note that you can't send events before you identify people. Ensure you're making the profile(s) known in the destination before you send events. You can do this by sending an `Audience Membership Changed` event first, or by creating an Identify event in Connections.
132
+
> You can't send events before you identify people. Ensure you're making the profile(s) known in the destination before you send events. You can do this by sending an `Audience Membership Changed` event first, or by creating an Identify event in Connections.
127
133
128
134
#### Entity added
129
135
@@ -170,29 +176,38 @@ Example use case:
170
176
171
177
### Step 2c: Select an action
172
178
173
-
Next, you'll select the destination action to call when the event happens.
179
+
Select the destination action to call when the event happens.
174
180
175
181
Segment displays available actions based on the destination action you've connected with your Linked Audience.
176
182
177
183
Visit the [destination actions docs](/docs/connections/destinations/actions/) learn more about destination actions, and view available actions for your destination.
178
184
179
185
### Step 2d: Configure the event
180
186
181
-
Finally, you'll configure your event and select additional properties to include in the event.
187
+
Configure your event and select additional properties to include in the event.
182
188
183
189
To configure your event:
184
190
185
191
1. Select additional properties to include in each event.
186
192
- As you're configuring your event, you can view a preview of the enriched event based on your property selections.
187
193
2. Map your event from your audience to your destination.
188
194
- You can preview what the event will look like in your destination.
189
-
3. After configuring, click **Save** to enable your Linked Audience.
195
+
3. Select if you'd like to [send events for current profiles and entities in the audience](#send-events-for-current-profiles-and-entities-in-the-audience).
196
+
4. After configuring, click **Save** to enable your Linked Audience.
190
197
191
198
After saving, you'll be redirected to a destination sidesheet where you can view all events and their corresponding actions.
192
199
200
+
#### Send events for current profiles and entities in the audience
201
+
202
+
Select if you'd like to sync existing profiles and entities in the audience with the **Send events for current profiles and entities in audience** checkbox.
203
+
204
+
This box is unchecked by default. If you leave this box unchecked, Segment only sends events for new profiles and entities that match the audience conditions.
205
+
206
+
However, if you select this checkbox, Segment will also send events for profiles and entities that currently match the audience description.
207
+
193
208
## Step 3: Confirm the payload in your destination
194
209
195
-
Linked Audiences will send events to your destination after Segment computes the audience.
210
+
Linked Audiences sends events to your destination after Segment computes the audience.
196
211
197
212
To confirm your destination is receiving events, Segment recommends that you log in to your destination and perform one of the following:
Copy file name to clipboardExpand all lines: src/unify/linked-profiles/linked-events.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,9 @@ Use Linked Events to enrich real-time event streams with entities from your data
12
12
13
13
On this page, you'll learn how to get started with Linked Events.
14
14
15
+
> info "Linked Events warehouse support"
16
+
> Linked Events supports Snowflake, BigQuery, and Redshift.
17
+
15
18
## Use cases
16
19
17
20
With Linked Events, you can:
@@ -156,7 +159,7 @@ Use enrichments to select the entity you wish to send to your downstream destina
156
159
157
160
In the Mappings tab, locate the **Select Mappings** section where you can enrich source properties from the entities you've selected in the previous step.
158
161
159
-
1. Select the propery field that you'd like to enrich, then select the **Enrichments** tab.
162
+
1. Select the property field that you'd like to enrich, then select the **Enrichments** tab.
160
163
2. Select the entity you want to send to your destination.
161
164
- You’ll have access to all rows/columns in your data warehouse associated with the property you've selected in the previous step.
162
165
3. Add the key name on the right side, which is what Segment sends to your destination.
Copy file name to clipboardExpand all lines: src/unify/linked-profiles/setup-guides/BigQuery-setup.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,14 @@ plan: unify
7
7
> info "Linked Events is in private beta"
8
8
> Linked Events is in private beta, and Segment is actively working on this feature. Some functionality may change before it becomes generally available. [Contact Segment](https://segment.com/help/contact/){:target="_blank"} with any feedback or questions.
9
9
10
+
> info ""
11
+
> At this time, you can only use BigQuery with Linked Events.
12
+
10
13
On this page, you'll learn how to connect your BigQuery data warehouse to Segment.
11
14
15
+
16
+
## Set up BigQuery
17
+
12
18
> warning ""
13
19
> You need to be an account admin to set up the Segment BigQuery connector as well as write permissions for the `__segment_reverse_etl` dataset.
Copy file name to clipboardExpand all lines: src/unify/linked-profiles/setup-guides/redshift-setup.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,9 @@ plan: unify
7
7
> info "Linked Events is in private beta"
8
8
> Linked Events is in private beta, and Segment is actively working on this feature. Some functionality may change before it becomes generally available. [Contact Segment](https://segment.com/help/contact/){:target="_blank"} with any feedback or questions.
9
9
10
+
> info ""
11
+
> At this time, you can only use Redshift with Linked Events.
12
+
10
13
On this page, you'll learn how to connect your Redshift data warehouse to Segment.
Copy file name to clipboardExpand all lines: src/unify/linked-profiles/setup-guides/snowflake-setup.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,10 +7,14 @@ beta: true
7
7
> info "Linked Profiles is in private beta"
8
8
> Linked Profiles (Data Graph, Linked Events, and Linked Audiences) is in private beta, and Segment is actively working on this feature. Some functionality may change before it becomes generally available. [Contact Segment](https://segment.com/help/contact/){:target="_blank"} with any feedback or questions.
9
9
10
+
10
11
On this page, you'll learn how to connect your Snowflake data warehouse to Segment.
11
12
12
13
Be sure to log in with a user that has read and write permissions so that Segment can write to your database.
13
14
15
+
> info ""
16
+
> Both Linked Events and Linked Profiles support Snowflake.
17
+
14
18
15
19
## Getting started
16
20
@@ -108,7 +112,7 @@ GRANT SELECT ON TABLE <schema-name>.<table_name> TO ROLE segment_entities;
108
112
109
113
### Reverse ETL table permissions
110
114
111
-
If you've ever run Segment's Reverse ETL in your database, you'll need to add the following [table permissions](https://docs.snowflake.com/en/user-guide/security-access-control-privileges#table-privileges){:target="_blank"}:
115
+
If you've ever run Segment's [Reverse ETL](/docs/connections/reverse-etl/) in your database, you'll need to add the following [table permissions](https://docs.snowflake.com/en/user-guide/security-access-control-privileges#table-privileges){:target="_blank"}:
112
116
113
117
```sql
114
118
GRANT USAGE ON SCHEMA __segment_reverse_etl TO ROLE segment_entities;
0 commit comments