Skip to content

Commit 71dd1b9

Browse files
authored
Merge pull request #6228 from StackAdapt/am/s2s-docs-update
Add documentation on using trait information in event rules
2 parents 2e3f932 + 9451904 commit 71dd1b9

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed
25.7 KB
Loading

src/connections/destinations/catalog/actions-stackadapt/index.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ For example, to create a conversion event when an order is completed with a reve
9191
This rule would match a Segment event fired with code such as:
9292

9393
```javascript
94-
analytics.track("Order Completed", {
94+
analytics.track('Order Completed', {
9595
order_id: '50314b8e9bcf000000000000',
9696
revenue: 11.5
9797
products: [
@@ -106,6 +106,35 @@ analytics.track("Order Completed", {
106106
});
107107
```
108108

109+
#### Trait Fields
110+
111+
Although trait fields are not frequently used in event rules, the StackAdapt destination forwards them and they can be used if desired.
112+
113+
| Segment Trait Property | StackAdapt Event Key |
114+
|------------------------|----------------------|
115+
| `traits.email` | `email` |
116+
| `traits.first_name` | `first_name` |
117+
| `traits.last_name` | `last_name` |
118+
| `traits.phone` | `phone` |
119+
120+
For example, to create a conversion event when a user with the domain `example.com` completes an order, you could set up an event rule matching an `action` value of `Order Completed` and an `email` containing `@example.com` as shown below:
121+
122+
![Image showing event rule in StackAdapt the matches an Order Completed event with an email containing @example.com](images/email-event-rule.png)
123+
124+
This rule would match a Segment event fired with code such as:
125+
126+
```javascript
127+
analytics.track('Order Completed', {
128+
order_id: '50314b8e9bcf000000000000',
129+
traits: {
130+
131+
first_name: 'John',
132+
last_name: 'Smith',
133+
phone: '+180055501000'
134+
}
135+
});
136+
```
137+
109138
### URL rules
110139

111140
If you are using URL rules, these will be matched whenever Segment sends an event to StackAdapt with a `url` matching the URL rule. This should be accomplished by the page event Segment automatically fires when a page is viewed, so setup of URL rules should be identical to setting up URL rules with the StackAdapt pixel.

0 commit comments

Comments
 (0)