Use Cases & Examples
Worked examples: win back inactive customers, cross-sell from purchase history, retire a data source, and load a nightly file from your bucket.
Use Case 1: Re-engage Inactive Customers
Problem
You want to send a win-back email to customers who haven't visited your website in 30 days. You need to identify exactly who hit that threshold and ensure each customer receives the message only once, ever.
Solution with CDP
-
Load page views into a raw table
Use a raw table such aswebsite_page_views. In Ingestion > Data Sources, open the table, choose Add a source > Public API, and allow your API Key. Airbyte (or another ELT tool), or File Import, can also fill the table; see Use Case 4. -
Map the table to events
In Ingestion > Events, click Add event source, pick the table, and set Data Sourcemy_website, Event Typepage_viewand Event Timestampoccurred_at. Check theemailanduser_idcolumns (unchecked columns never reach event properties). Markemailas Identity with kind Email (values are trimmed and lowercased before matching). Markuser_idas Identity with kind Other. -
Feed the engagement policy
Check that a source merge policy formy_websiteis listed under Applicable source rules of the unified policy that has Engagement on. Segments and campaigns only work on that policy. -
Add the email user property
In the User Properties section of Unified Profiles, click Add User Property: Display Name "Email", Property Keyemail, Compute type Raw value, Event Sourcemy_website, Event Typepage_view, Event Propertyemail. -
Create the segment
Build the "Inactive 30 days" segment as shown in Segment condition below. -
Create the campaign
In Activation > Campaigns, click New campaign. Choose the segment as Target segment and an email Channel provider (if the list is empty, add one under Activation > Channels first). On the Message step, set Send to toemail. -
Set the schedule
On the Schedule step, set When to send to Repeating and Repeat to Daily. Under Who receives this campaign on each send?, choose New members only.
Sample row to send
This is the body of POST /api/public/v1/raw-data. See
Send Raw Data Rows in the Integration Guide for the full request.
{
"source_table": "website_page_views",
"rows": [{
"email": "customer@example.com",
"user_id": "user_123",
"page": "/products",
"session_id": "sess_abc",
"device": "desktop",
"occurred_at": "2026-01-15T14:30:00.000Z"
}]
}
This sample assumes occurred_at is a DateTime64(3) column. For a plain
DateTime column, send the value without milliseconds, for example
"2026-01-15T14:30:00Z". Values with no offset are taken as UTC.
Segment condition
In Activation > Segments, click New segment and choose Segment type
Event. Add a Performed condition: event source my_website, event type
page_view, Count = 0 times within the last 30 days. Add a second
Performed condition for page_view with Count > 0 and the days box left
empty (all time), so the segment only holds people who have visited at least once. Keep the two conditions
joined with AND. To see the definition the form saves, switch the form to JSON:
{
"operator": "AND",
"conditions": [
{
"node_id": "<generated>",
"type": "performed",
"event_source": "my_website",
"event_type": "page_view",
"operator": "eq",
"value": 0,
"time_window": 2592000
},
{
"node_id": "<generated>",
"type": "performed",
"event_source": "my_website",
"event_type": "page_view",
"operator": "gt",
"value": 0
}
]
}
time_window is in seconds (30 days = 2592000). The form fills in node_id for you.
Membership is re-checked every cycle, so people enter the segment when their 30-day window passes, even if
no new events arrive.
occurred_at column in step 2. Create a Duration since user property
in Days on occurred_at for page_view, then build a
User properties segment with the condition Greater than 30.
Expected outcome
The first send goes to everyone in the segment at that moment. Each later daily send goes only to people who joined since the earlier runs. Anyone included in an earlier run is never included again, even if they return and lapse a second time, so use a separate campaign for repeat lapses.
Use Case 2: Cross-sell Based on Purchase History
Problem
You want to send a LINE message recommending accessories to customers who bought a product in the electronics category in the last 30 days, personalizing the message with the specific product they purchased.
Solution
-
Load purchases into a raw table
Use a raw table such asecommerce_purchases. In Ingestion > Data Sources, open the table, choose Add a source > Public API, and allow your API Key. -
Map the table to events
In Ingestion > Events, click Add event source, pick the table, and set Data Source (for examplemy_shop), Event Typepurchaseand Event Timestampoccurred_at. Check every column you need later:category,product_nameandline_uid(unchecked columns never reach event properties). Markemailas Identity with kind Email. -
Feed the engagement policy
Check that a source merge policy for this data source is listed under Applicable source rules of the unified policy that has Engagement on. -
Add two user properties
In the User Properties section of Unified Profiles, click Add User Property twice:-
Display Name "Last electronics product", Property Key
last_electronics_product, Compute type Raw value, Event Source your purchase data source, Event Typepurchase, Event Propertyproduct_name. Under Filter conditions (optional), addcategory=electronics. -
Display Name "LINE user ID", Property Key
line_uid, Compute type Raw value, Event Source your purchase data source, Event Typepurchase, Event Propertyline_uid.
-
Display Name "Last electronics product", Property Key
-
Create the segment
Create a segment "Electronics Buyers" with Segment type Event. Add a Performed condition with your purchase event source and event typepurchase, and Count > 0 times within the last 30 days. Under Where, addcategoryEqualselectronics. -
Create the campaign
In Activation > Campaigns, click New campaign, choose "Electronics Buyers" as Target segment and your LINE Channel provider (the channel follows from the provider you pick). On the Message step choose Message type Text, set Send to toline_uid, and enter the template below. -
Set the schedule
On the Schedule step, set When to send to Repeating and Repeat to Daily. Under Who receives this campaign on each send?, choose New members only.
Sample purchase row to send
{
"source_table": "ecommerce_purchases",
"rows": [{
"email": "buyer@example.com",
"line_uid": "U0123456789abcdef0123456789abcdef",
"order_id": "ord_789",
"amount": "450.00",
"currency": "JPY",
"category": "electronics",
"product_name": "Wireless Headphones",
"product_id": "prod_wh_001",
"occurred_at": "2026-01-15T10:30:00.000Z"
}]
}
- A LINE userId is "U" followed by 32 hex characters. Any other value is not sent and shows in the send log as "Invalid LINE userId".
occurred_atfollows the same rule as in Use Case 1.
Segment condition
The JSON view of the "Electronics Buyers" segment from step 5:
{
"operator": "AND",
"conditions": [
{
"node_id": "<generated>",
"type": "performed",
"event_source": "<purchase event source>",
"event_type": "purchase",
"operator": "gt",
"value": 0,
"time_window": 2592000,
"where_conditions": [
{
"field": "category",
"operator": "eq",
"value": "electronics",
"value_type": "string"
}
]
}
]
}
LINE template (Liquid)
Hi! You recently purchased {{ last_electronics_product }}.
Check out our accessories that work great with it:
[Link to accessories page]
Templates can use only the user properties of the segment's unified policy. On the Message step, click a property under Dynamic Variables to insert it. Any variable listed under Unmatched renders empty. If a customer has several matching purchases, the latest one wins.
Expected outcome
If Auto Transform is on for the purchase table (it is off by default), a new purchase becomes an event at the next hourly transform. It then reaches source profiles at about :05 and unified profiles at about :10 past the hour (UTC). User properties and segment membership catch up within about a minute after that. The next daily send then picks the buyer up, so expect up to about a day end to end (see Pipeline Concepts for the schedule).
With New members only, each buyer is messaged once, and a later purchase does not trigger another message. The template is filled in per recipient from their user properties, so each customer sees their latest electronics product.
Use Case 3: Retire a Deprecated Data Source
Problem
You're decommissioning an old POS system. You want to stop it producing events, remove the events and profiles it created, and optionally drop its raw table.
Deletes in CDP remove a whole event source, policy, segment or user property - an inactive source merge policy, an inactive unified merge policy, a paused segment, or a paused user property - never one customer's data such as an email or user ID. If you need to erase a specific person's data across all sources for a GDPR-style request, that isn't a built-in workflow today; talk to your platform team about a custom deletion path.
Solution with CDP
-
Deactivate the source policy
In Source Profiles, open the POS policy's row menu and choose Deactivate. -
Pause dependent segments
In Segments, pause (or edit) any active segment whose event conditions use this data source. -
Delete the event source
In Ingestion > Events, open the row menu of the POS source table and choose Delete. The dialog shows how many events will be deleted and lists anything still blocking it (Referenced by active unified rule(s), Referenced by active segment(s)). Confirm to deactivate the mapping and delete that table's events. Another table that shares the same data source is not touched. -
Remove it from unified policies, then delete the source policy
Remove the source policy from every unified policy that lists it, active or inactive. In Unified Profiles, click Deactivate on that policy (in its row menu or on its detail page), choose Edit, and remove the source card under Applicable source rules (X). Click Save changes, then Activate. A unified policy is not built while it is inactive, so turn it back on as soon as you save. A unified policy needs at least one source rule, so if this was its only source, delete that unified policy instead.
Then, in Source Profiles, open the policy's row menu and choose Delete. CDP removes its source profiles, the links between those profiles and their events, its identity lookups and merge history, then deletes the policy itself. Unified profiles that were already built are not removed. -
Optional: delete the raw table
In Ingestion > Data Sources, open the raw table and choose Delete. Tick Clear that configuration as part of the delete to also narrow API key scopes and remove import sources. Revoke any API key that only served this table.
What gets deleted
| What you delete | Must first | What is removed |
|---|---|---|
| Event source (Events > Delete) | Not be used by an active unified policy (through an active source policy of its data source) or an active segment | That table's events and the mapping (kept in the audit log). Raw data, profiles, user properties and segment membership are kept. |
| Source merge policy (Source Profiles > Delete) | Be inactive and not listed in any unified policy, active or inactive | Its source profiles, the links to their events, identity lookups, merge history, and the policy |
| Unified merge policy (Unified Profiles > Delete) | Be inactive (Deactivate) and have no segments, active or paused (the delete dialog lists them and asks you to delete them first). Its user properties do not block the delete; the dialog lists them as deleted with the policy | Its unified profiles, their events, identity lookups, merge history, its user properties (active or paused) with their computed values, and the policy |
| Segment (Segments > Delete) | Be paused; remove it from any campaign that still uses it | Its membership and the segment |
| User property (row menu > Delete) | Be paused and not used in any segment condition; remove it from any campaign that uses it as Send to or in its message | Its computed values and the property |
Deleting via the Admin API
The admin panel's Delete buttons call these endpoints, so you can script the same deletes.
curl -X DELETE "https://<your-cdp-api-host>/api/admin/v1/source-matching-rules/<inactive-source-rule-id>" \
-H "Cookie: cdp_admin_session=<your-session-cookie>"
It returns 202 with
{"workflow_id": "clean-data-SOURCE-<id>", "run_id": "..."}. Track progress with
GET /api/admin/v1/workflows/<workflow_id>/status. It requires the
data_sources:delete permission. Errors:
400 RuleActive- deactivate the policy first.400 RuleStillReferenced- a unified policy still lists it.404 NotFound- no policy with that ID.409 DeleteInProgress- a delete is already running.
The other Delete buttons use these endpoints:
| What you delete | Endpoint | Permission |
|---|---|---|
| Event source | DELETE /api/admin/v1/source-event-mapping-rules/<id> |
data_sources:delete |
| Unified merge policy | DELETE /api/admin/v1/unified-matching-rules/<id> |
data_sources:delete |
| Segment | DELETE /api/admin/v1/segments/<id> |
segments:delete |
| User property | DELETE /api/admin/v1/user-properties/<id> |
user_properties:delete |
409 DeleteInProgress. Once a delete has succeeded the resource no longer exists, and further
attempts report it as not found. Policies, segments and user properties must be paused before they can be
deleted, so active ones are never touched. The one exception is a unified policy's user properties:
deleting the paused policy also deletes them, active or paused.
Use Case 4: Load a Nightly POS File from Your Bucket
Problem
A store system drops pos_YYYYMMDD.csv into an S3 folder every night, and you want it loaded
without an engineer. File Import is one of three ways into raw data, alongside the Public API and Airbyte
(or another ELT tool).
Solution with CDP
-
Create the table
In Ingestion > Data Sources, click Create table, add the file's columns (including aDateTimecolumn for the sale time), and set Sort by to the order ID. -
Register the bucket
On the table's page, choose Add a source > File imports > Create a new import source to open Data Imports. First open its File Locations tab and click Add File Location with the bucket, region and folder prefix. This needs the Admin or "Editor - Profiles" role, and the bucket only needss3:ListBucketands3:GetObject. Run Test connection from the location's row menu. -
Create the import source
On the Import Sources tab, click New Import Source for your table. Set Mode Scheduled scan, File format CSV, the File location from step 2, File name pattern (optional)pos_*.csv, and Frequency Daily at 01:00 UTC. Set Column mapping only for headers that differ from the column names. Click Create Source. -
Let the scan pick files up
Files modified in the last 3 minutes wait for the next scan. Each file becomes one run on the Runs tab. -
Handle rejected files
If a run is Rejected, no rows were imported. Use Download rejects.csv, fix the rows, and put the corrected file in the folder. New content counts as a new file, even under the same name. -
Turn the rows into events
In Ingestion > Events, click Add event source for the table and turn Auto Transform on.
Expected outcome
Rows land in raw data overnight and become events at the next hourly transform. Re-running a Done or Partially imported run imports its rows again, so duplicates are possible in the raw table.