Add enrichment to any feature column
Users can build enrichment tables to join to an activity's feature column, instead of just the activity_id
column.
Useful when...
You have multiple activities that share common features.
Examples
-
Email Activities
Opened Email, Clicked Email, and Unsubscribed might all includecampaign
andsubject
features. These feature can be stored on an email enrichment table, based onemail_id
. -
Product Activities
Viewed Product and Purchased Product both include details about the product likesku
,color
,fabric
, etc. These feature can be stored on a product enrichment table, based onproduct_id
.
How it works
1. Create an enrichment table
Create an enrichment table via enrichment transformation (ex. enriched_oppty)
SELECT
o.id AS enriched_activity_id,
o.created_date AS enriched_ts,
o.description
FROM salesforce.opportunity o
2. Add the ID as a feature on your Activity
Update a feature of the activity you wish to enrich to be the enriched_activity_id
of that enrichment table (ex. opportunity_id as feature_1
)
SELECT
h.id as activity_id,
h.created_date as ts,
c.email as anonymous_customer_id,
o.company_slug_c as customer,
'became_qualified_lead'as activity,
h.opportunity_id as feature_1,
NULL as feature_2,
NULL as feature_3,
NULL as revenue_impact,
NULL as link
FROM salesforce.opportunity_history h
JOIN salesforce.opportunity o
on h.opportunity_id = o.id
LEFT JOIN salesforce.contact c
on o.contact_id = c.id
where h.stage_name in ('Qualified')
3. Link the Enrichment Table via that ID
Specify the enrichment table using the Enriched By
dropdown on the activity detail page. Select the table and feature you with to join on.
4. Use the enrichment columns in dataset like normal
Use the enrichment features as you normally would within dataset. Notice how the SQL join changes for enriched features.
User feedback helps Narrator improve. ❤️
We'd love to hear what you think. Email us @ [email protected]