Skip to content

Commit 9bfd113

Browse files
committed
Apply suggestions from code review
1 parent 7c08304 commit 9bfd113

File tree

6 files changed

+71
-39
lines changed

6 files changed

+71
-39
lines changed

src/unify/linked-profiles/data-graph.md

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ plan: unify
44
beta: true
55
---
66

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+
710
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.
811

912
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
1518

1619
To use the Data Graph, you'll need the following:
1720
- 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).
1922

2023
> 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.
2225
2326
> warning ""
2427
> 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
4750
4851
To connect your warehouse to the Data Graph:
4952

50-
1. In your Segment workspace, navigate to **Unify**, and select **Data Graph**.
53+
1. Navigate to **Unify > Data Graph**.
5154
- This should be a Unify space with Profiles Sync already set up.
5255
2. Click **Connect warehouse**.
5356
3. Select your warehouse type.
57+
- Note that Linked Audiences only supports Snowflake.
5458
4. Enter your warehouse credentials.
5559
5. Test your connection, then click **Save**.
5660

5761
## Step 3: Build your Data Graph
5862

5963
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.
6064

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.
7166

7267
### Define entities
7368

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.
7570

7671
> warning ""
7772
> 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
131126
> warning ""
132127
> 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.
133128
134-
<!--Bookmark -->
135129
#### Relate Entity to Profile
136130

137131
| Parameters | Definition |
@@ -194,7 +188,7 @@ data_graph {
194188
| `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`). |
195189
| `name` | This should be a unique label that displays throughout your Segment space. |
196190
| `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. |
198192

199193

200194
```py
@@ -215,15 +209,17 @@ data_graph {
215209

216210
```
217211

218-
#### relating entities with a junction table
212+
#### Relating entities with a junction table
219213

220-
If you're relating entities with a junction table:
214+
If you're relating entities with a junction table:
221215

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]`.
216+
| Parameters | Definition |
217+
| ----------- | --------------------------------------------------------------------- |
218+
| `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]`. |
227223

228224
Note that `schema.table` is implied within the junction table column name and doesn't need to be provided.
229225

@@ -244,7 +240,7 @@ data_graph {
244240
related_entity = "product-entity"
245241
junction_table {
246242
primary_key = "id"
247-
table_ref = "PRODUCTION.CUSTOM.CART_PRODUCT"
243+
table_ref = "PRODUCTION.CUSTOMER.CART_PRODUCT"
248244
left_join_on = "CART.ID = CART_ID"
249245
#schema.table is implied within the cart_id key
250246
right_join_on = "PRODUCT_ID = PRODUCT.SKU"
@@ -253,9 +249,9 @@ data_graph {
253249
}
254250
}
255251
}
256-
}
257252

258253
```
254+
## Data Graph Example
259255

260256
![An example of a data graph](/docs/unify/images/data-graph-example.png)
261257

@@ -334,6 +330,11 @@ To edit your Data Graph:
334330
1. Navigate to **Unify > Data Graph**.
335331
2. Select the **Builder** tab, and click **Edit Data Graph**.
336332

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+
337338
You can edit your Data Graph at any time. However, some types of edits may impact existing Linked Audiences and Linked Events. These include:
338339

339340
- Adding a new relationship before an existing relationship

src/unify/linked-profiles/linked-audiences.md

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ plan: unify
44
beta: true
55
---
66

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+
710
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.
811

912
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.
1013

14+
> info "Linked Audiences warehouse support"
15+
> At this time, Linked Audiences only supports Snowflake.
16+
1117
> success ""
1218
> Before you build Linked Audiences, be sure you've defined entities in your [Data Graph](/docs/unify/linked-profiles/data-graph/).
1319
@@ -17,7 +23,7 @@ From the relationships you've defined between the profiles and entities in your
1723
To help you get started with Linked Audiences, consider the following best practices:
1824

1925
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`.
2127
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.
2228
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.
2329

@@ -28,7 +34,7 @@ Below are some example use cases to help you learn more about Linked Audiences.
2834
### Build an audience of cat owners who are also a part of the platinum membership tier
2935

3036
Build an audience with `Households` and `Pets` where:
31-
- `pets.type` equals "cat"
37+
- `pets.type` = "cat"
3238

3339
And where:
3440
- `profile.audience_membership` = "Platinum membership tier"
@@ -46,8 +52,8 @@ Furthermore, filtering the audience against `profile.audience_membership` for "P
4652
### Build an audience of users with premium subscriptions who are located in Canada
4753

4854
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"
5157

5258
And where:
5359
- `profile.country` = "Canada"
@@ -91,7 +97,7 @@ Use the Audience overview page to build or maintain a Linked Audiences.
9197
6. Enter an audience name and description, then click **Create Audience**.
9298

9399
> 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.
95101
96102

97103
## Step 2: Activate your Linked Audience
@@ -106,12 +112,12 @@ You can use your Linked Audience to activate any [actions-based destination](/do
106112
107113
### Step 2a: Add an action destination
108114

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.
110116

111117
From the Add destination window, select your destination and click **Next**.
112118

113119
### 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.
115121

116122
You can send events:
117123
- When an entity on a profile changes:
@@ -123,7 +129,7 @@ You can send events:
123129
- [Audience Exited](#audience-exited)
124130

125131
> 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.
127133
128134
#### Entity added
129135

@@ -170,29 +176,38 @@ Example use case:
170176

171177
### Step 2c: Select an action
172178

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.
174180

175181
Segment displays available actions based on the destination action you've connected with your Linked Audience.
176182

177183
Visit the [destination actions docs](/docs/connections/destinations/actions/) learn more about destination actions, and view available actions for your destination.
178184

179185
### Step 2d: Configure the event
180186

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.
182188

183189
To configure your event:
184190

185191
1. Select additional properties to include in each event.
186192
- As you're configuring your event, you can view a preview of the enriched event based on your property selections.
187193
2. Map your event from your audience to your destination.
188194
- 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.
190197

191198
After saving, you'll be redirected to a destination sidesheet where you can view all events and their corresponding actions.
192199

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+
193208
## Step 3: Confirm the payload in your destination
194209

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.
196211

197212
To confirm your destination is receiving events, Segment recommends that you log in to your destination and perform one of the following:
198213
- Monitor the event activity

src/unify/linked-profiles/linked-events.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ Use Linked Events to enrich real-time event streams with entities from your data
1212

1313
On this page, you'll learn how to get started with Linked Events.
1414

15+
> info "Linked Events warehouse support"
16+
> Linked Events supports Snowflake, BigQuery, and Redshift.
17+
1518
## Use cases
1619

1720
With Linked Events, you can:
@@ -156,7 +159,7 @@ Use enrichments to select the entity you wish to send to your downstream destina
156159

157160
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.
158161

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.
160163
2. Select the entity you want to send to your destination.
161164
- You’ll have access to all rows/columns in your data warehouse associated with the property you've selected in the previous step.
162165
3. Add the key name on the right side, which is what Segment sends to your destination.

src/unify/linked-profiles/setup-guides/BigQuery-setup.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,14 @@ plan: unify
77
> info "Linked Events is in private beta"
88
> 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.
99
10+
> info ""
11+
> At this time, you can only use BigQuery with Linked Events.
12+
1013
On this page, you'll learn how to connect your BigQuery data warehouse to Segment.
1114

15+
16+
## Set up BigQuery
17+
1218
> warning ""
1319
> 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.
1420

src/unify/linked-profiles/setup-guides/redshift-setup.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ plan: unify
77
> info "Linked Events is in private beta"
88
> 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.
99
10+
> info ""
11+
> At this time, you can only use Redshift with Linked Events.
12+
1013
On this page, you'll learn how to connect your Redshift data warehouse to Segment.
1114

1215
## Getting started

src/unify/linked-profiles/setup-guides/snowflake-setup.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@ beta: true
77
> info "Linked Profiles is in private beta"
88
> 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.
99
10+
1011
On this page, you'll learn how to connect your Snowflake data warehouse to Segment.
1112

1213
Be sure to log in with a user that has read and write permissions so that Segment can write to your database.
1314

15+
> info ""
16+
> Both Linked Events and Linked Profiles support Snowflake.
17+
1418

1519
## Getting started
1620

@@ -108,7 +112,7 @@ GRANT SELECT ON TABLE <schema-name>.<table_name> TO ROLE segment_entities;
108112

109113
### Reverse ETL table permissions
110114

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"}:
112116

113117
```sql
114118
GRANT USAGE ON SCHEMA __segment_reverse_etl TO ROLE segment_entities;

0 commit comments

Comments
 (0)