Skip to content

Commit e644909

Browse files
authored
Merge pull request #4207 from sailthru/cha-1585-update_sailthru_v2_documentation
[CHA-1585] add user deletion, cart clearing, email under traits
2 parents 9fe904b + f148331 commit e644909

File tree

1 file changed

+47
-3
lines changed
  • src/connections/destinations/catalog/sailthru-v2

1 file changed

+47
-3
lines changed

src/connections/destinations/catalog/sailthru-v2/index.md

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ Screen events require a `url` property. If Sailthru receives a Screen call witho
4646

4747
### Identify
4848

49-
Send [Identify](/docs/connections/spec/identify) calls to to create or update a Sailthru profile for any identified user on your site.
49+
Send [Identify](/docs/connections/spec/identify) calls to create or update a Sailthru profile for any identified user on your site.
5050

51+
Pass an email address at the top level using the `identify` call:
5152
```js
5253
analytics.identify("assigned-userId", {
5354
"name": "Stephen Noel",
@@ -57,6 +58,22 @@ analytics.identify("assigned-userId", {
5758
});
5859
```
5960

61+
Pass an email under `context.traits` using the identify call:
62+
```js
63+
analytics.identify("assigned-userId", {
64+
"name": "Stephen Noel",
65+
"plan": "premium",
66+
"logins": 5
67+
},
68+
{
69+
"traits": {"email": "[email protected]"}
70+
}
71+
);
72+
```
73+
74+
> note ""
75+
> **NOTE:** Sailthru searches for the email address in the `identify` call under `context.traits` if it isn't provided at the top-level.
76+
6077
### Track
6178

6279
Send [Track](/docs/connections/spec/track) calls to:
@@ -65,6 +82,7 @@ Send [Track](/docs/connections/spec/track) calls to:
6582
* record abandoned carts via “Product Added” and “Product Removed” events
6683
* subscribe users via “Subscribed” events
6784
* trigger Lifecycle Optimizer journeys with all other events
85+
* delete users via “User Deleted” events
6886

6987
Sailthru automatically creates and maps custom fields from Segment.
7088

@@ -78,6 +96,20 @@ analytics.track("Subscribed", {
7896
});
7997
```
8098

99+
#### Delete a User
100+
101+
To delete a user, you need to include the email in the `userId` or `context.traits` track call, in a call like the following:
102+
103+
```js
104+
analytics.track("User Deleted", {userId:"[email protected]" })
105+
```
106+
107+
```js
108+
analytics.track("User Deleted", {}, {"traits":{"email": "[email protected]"}})
109+
```
110+
111+
If the user exists, it will be removed from both Segment and Sailthru.
112+
81113
#### Record a Purchase
82114

83115
Record purchases in Sailthru wih the `Order Completed` event to send order confirmation messages, personalize messaging, and create purchase-related audiences.
@@ -118,7 +150,9 @@ analytics.track("Order Completed", {
118150
#### Update Cart
119151
Send `Product Added` and `Product Removed` Track events for Sailthru's abandoned cart messaging to enable the Cart Abandonment entry in Lifecycle Optimizer.
120152

121-
Sailthru abandoned cart messaging requires the `url` to function properly.
153+
Sailthru abandoned cart messaging requires the `url` to function properly.
154+
155+
To determine if the cart is expired, the timestamp of the last payload received (`purchase_incomplete.time`) is compared with the `clearIncompleteCartAfterNHours` value. If the cart is expired, any pre-existing products in the cart will be removed.
122156

123157
```js
124158
analytics.track('Product Added', {
@@ -128,11 +162,21 @@ analytics.track('Product Added', {
128162
sku: 'G-32',
129163
category: 'Games',
130164
name: 'Monopoly: 3rd Edition',
165+
url: "https://www.example.com/product/monopoly",
131166
brand: 'Hasbro',
132167
variant: '200 pieces',
133168
price: 18.99,
134169
quantity: 1,
135170
coupon: 'MAYDEALS',
136-
position: 3
171+
position: 3,
172+
173+
clearIncompleteCartAfterNHours: 24
137174
});
138175
```
176+
177+
**Notes:**
178+
* By default the value is null
179+
* Requirement is for the value to be greater than 0
180+
* Only whole positive numbers are supported. If fractional numbers are included, the number will be truncated (for example, 1.5 will be 1)
181+
* If a number is passed in a string format such as `"1"`, it will be parsed and converted to integer
182+
* Non-numeric characters are not allowed

0 commit comments

Comments
 (0)