You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our Web source (Analytics.js), and our native client-side libraries (iOs, Android, React-native) allow you to choose how you send data to Segment from your website or app. Two ways are available:
1
+
Segment's web source (Analytics.js), and native client-side libraries (iOS, Android, React-native) allow you to choose how you send data to Segment from your website or app. There are two ways to send data:
2
2
3
-
-**Cloud-mode**: in this mode, the sources send data directly to the Segment servers, which then translate it for each connected downstream destination, and send it on. Translation is done on the Segment servers, keeping your page size, method count, and load time small.
3
+
-**Cloud-mode**: The sources send data directly to the Segment servers, which then translate it for each connected downstream destination, and send it on. Translation is done on the Segment servers, keeping your page size, method count, and load time small.
4
4
5
-
-**Device-mode**: in this mode, you include additional code on your website or mobile app which allows Segment to use the data you collect on the device to make calls directly to the destination tool's API, without sending it to the Segment servers _first_. (You still send your data to the Segment servers, but this occurs asynchronously.) This is also called "wrapping" or "bundling", and it might be required when the source has to be loaded on the page to work, or loaded directly on the device to function correctly. When you use Analytics.js, you can change the device-mode destinations that a specific source sends to from within the Segment web app, without touching any code.
5
+
-**Device-mode**: You include additional code on your website or mobile app which allows Segment to use the data you collect on the device to make calls directly to the destination tool's API, without sending it to the Segment servers _first_. (You still send your data to the Segment servers, but this occurs asynchronously.) This is also called *wrapping* or *bundling*, and it might be required when the source has to be loaded on the page to work, or loaded directly on the device to function correctly. When you use Analytics.js, you can change the device-mode destinations that a specific source sends from within the Segment web app, without touching any code.
6
6
7
-
> **Note:** If you use Server source libraries, they only send data directly to Segment in Cloud-mode. (Server library implementations operate in the server backend, and can't load additional destination SDKs.)
7
+
8
+
<divclass="premonition info">
9
+
<divclass="fa fa-info-circle"></div>
10
+
<divclass="content">
11
+
<p class="header"></p>
12
+
<p>If you use Server source libraries, they only send data directly to Segment in Cloud-mode. Server library implementations operate in the server backend, and can't load additional destination SDKs.</p>
Copy file name to clipboardExpand all lines: src/connections/destinations/destination-filters.md
+42-41Lines changed: 42 additions & 41 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,35 +3,32 @@ title: Destination Filters
3
3
rewrite: true
4
4
---
5
5
6
-
Use Destination Filters to prevent certain data from flowing into a destination.
7
-
8
-
With Destination Filters, you can conditionally filter out event properties, traits, and fields, or even filter out the event itself.
9
-
10
-
Common use cases for Destination Filters include the following:
6
+
Use Destination Filters to prevent certain data from flowing into a destination. With Destination Filters, you can conditionally filter out event properties, traits, and fields, or even filter out the event itself.
11
7
8
+
Common use cases for Destination Filters include:
12
9
- Managing PII (personally identifiable information) by blocking fields from reaching certain destinations
13
10
- Controlling event volume by sampling or dropping unnecessary events for specific destinations
14
11
- Increasing data relevance in your destinations by removing unused or unwanted data
15
12
- Preventing test or internally-generated events from reaching your production tools
16
13
17
-
> note ""
18
-
> Destination Filters are available to Business Tier customers only.
14
+
> info ""
15
+
> Destination Filters are only available to Business Tier customers.
19
16
20
-
### Destination filtering limitations
17
+
### Limitations
21
18
22
19
Keep the following limitations in mind when you use Destination Filters:
23
20
24
21
- Segment applies Destination Filters one at a time in the order that they appear in your workspace.
25
-
- Destination Filters can only be applied to cloud-mode (server-side) streaming destinations. Device-mode destinations aren't supported.
22
+
- Destination Filters can only be applied to cloud-mode (server-side) streaming destinations.
23
+
- Device-mode destinations aren't supported.
26
24
- You can't apply Destination Filters to Warehouses or S3 destinations.
27
25
- Each filter can only apply to one source-destination pair.
28
26
29
27
[Contact Segment](https://segment.com/help/contact/){:target="_blank"} if these limitations impact your use case.
30
28
31
29
## Create a Destination Filter
32
30
33
-
To create a Destination Filter, follow these steps:
34
-
31
+
To create a Destination Filter:
35
32
1. Go to **Connections > Destinations** and select your destination.
36
33
2. Click on the **Filters** tab of your destination.
37
34
3. Click **+ New Filter**.
@@ -43,22 +40,28 @@ To create a Destination Filter, follow these steps:
43
40
44
41
## Destination Filters API
45
42
46
-
The Destination Filters API provides more power than the Segment dashboard's Destination Filters settings. With the API, you can create complex filters that are conditionally applied using Segment's [Filter Query Language (FQL)](/docs/config-api/fql).
43
+
The Destination Filters API provides more power than Segment's dashboard Destination Filters settings. With the API, you can create complex filters that are conditionally applied using Segment's [Filter Query Language (FQL)](docs/api/config-api/fql/).
47
44
48
45
The Destination Filters API offers four different filter types:
|`drop_event`|Don't send matched events to the destination. |
53
-
|`sample_event`|Send only a percentage of events through to the destination. |
54
-
|`whitelist_fields`| Only send whitelisted properties to the destination. |
55
-
|`blocklist_fields`|Don't send blocklisted properties to the destination. |
49
+
|`drop_event`|Doesn't send matched events to the destination. |
50
+
|`sample_event`|Sends only a percentage of events through to the destination. |
51
+
|`whitelist_fields`| Only sends whitelisted properties to the destination. |
52
+
|`blocklist_fields`|Doesn't send blocklisted properties to the destination. |
56
53
57
-
To learn more, read Segment's [Destination Filters API docs](https://reference.segmentapis.com/#6c12fbe8-9f84-4a6c-848e-76a2325cb3c5){:target="_blank"}.
54
+
To learn more, read Segment's [Destination Filters API docs](https://docs.segmentapis.com/tag/Destination-Filters){:target="_blank"}.
58
55
59
56
## Examples
60
57
61
-
The following examples illustrate common Destinations Filters use cases.
58
+
The following examples illustrate common Destinations Filters use cases:
59
+
*[PII management](#pii-management)
60
+
*[Control event volume](#control-event-volume)
61
+
*[Cleaner data](#cleaner-data)
62
+
*[Remove internal and test events from production tools](#remove-internal-and-test-events-from-production-tools)
63
+
*[Sample a percentage of events](#sample-a-percentage-of-events)
64
+
*[Drop events](#drop-events)
62
65
63
66
### PII management
64
67
@@ -83,39 +86,39 @@ This example shows a rule that only sends track calls to Google Analytics.
83
86
84
87
### Remove internal and test events from production tools
85
88
86
-
This rule targets email addresses with internal domains to stop test events from reaching Destinations.
89
+
In the example below, the rule targets email addresses with internal domains to stop test events from reaching Destinations.
87
90
88
91

89
92
90
-
This rule prevents an event from sending if `Order Completed` and `properties.email` contain an internal `@segment.com` email address.
93
+
In the example below, the rule prevents an event from sending if `Order Completed` and `properties.email` contain an internal `@segment.com` email address.
Using the [Destination Filters API](https://reference.segmentapis.com/#6c12fbe8-9f84-4a6c-848e-76a2325cb3c5){:target="_blank"}, you can create a rule to randomly sample video heartbeat events.
99
+
Using the [Destination Filters API](https://docs.segmentapis.com/tag/Destination-Filters){:target="_blank"}, you can create a rule to randomly sample video heartbeat events.
97
100
98
101
### Drop events
99
102
100
103
[Watch this Destination Filters walkthrough](https://www.youtube.com/watch?v=47dhAF1Hoco){:target="_blank"} to learn how to use event names to filter events sent to destinations.
101
104
102
105
## Important notes
103
106
104
-
**Conflicting settings**
107
+
#### Conflicting settings
105
108
106
109
Some destinations offer settings that also allow you to filter data. For example, the Facebook App Events destination allows you to map `Screen` events to `Track` events. Because Destination Filters are evaluated and applied _before_ the Destination settings are applied, they can conflict with your settings.
107
110
108
-
In the example in the video above, if you have a Destination Filter that filters Track events _and_ you have the **Use Screen Events as Track Events** setting enabled, `Track` events will be dropped, but `Screen` events still process. The destination settings will transform it into a `Track` event - *after* the filters.
111
+
For example, if you have a Destination Filter that filters Track events _and_ you have the **Use Screen Events as Track Events** setting enabled, `Track` events drop, but `Screen` events still process. The destination settings transform it into a `Track` event - *after* the filters.
109
112
110
-
**Error handling**
113
+
#### Error handling
111
114
112
-
Segment makes effort to ensure that Destination Filters handle unexpected situations. For example, if you use the `contains()` FQL function on `null` field, Segment returns `false` instead of returning an error. If Segment can't infer your intent, Segment logs an internal error and drops the event. Segment defaults to this behavior to prevent sensitive information, like a PII filter, from getting through.
115
+
Segment makes effort to ensure that Destination Filters can handle unexpected situations. For example, if you use the `contains()` FQL function on the`null` field, Segment returns `false` instead of returning an error. If Segment can't infer your intent, Segment logs an internal error and drops the event. Segment defaults to this behavior to prevent sensitive information, like a PII filter, from getting through.
113
116
114
117
Errors aren't exposed in your Destination's Event Deliverability tab. For help diagnosing missing destination filter events, [contact Segment](https://segment.com/help/contact/){:target="_blank"}.
115
118
116
-
## FAQ
119
+
## FAQs
117
120
118
-
**How do Destination Filters work with array properties?**
121
+
#### How do Destination Filters work with array properties?
119
122
120
123
Destination Filters can filter properties out of objects nested in an array. For example, you can filter out the `price` property of every object in an array at `properties.products`. You can also filter out an entire array from the payload. However, you can't drop nested objects in an array or filter properties out of a single object in an array.
121
124
@@ -125,38 +128,36 @@ For example, the `properties.products.newElement` filter blocks all `newElement`
To block the Identify event trait `products.newElement`, select the option under the **User Traits** list instead. To block a context object field `products.newElement`, select it from the **Context Fields** list.
131
+
To block the Identify event trait `products.newElement`, select the option under the **User Traits** list instead. To block the context object field `products.newElement`, select it from the **Context Fields** list.
129
132
130
-
**How many filters can I create?**
133
+
#### How many filters can I create?
131
134
132
135
Segment supports 10 filters per destination. If you need help consolidating filters or would like to discuss your use case, [contact Segment](https://segment.com/help/contact/){:target="_blank"}.
133
136
134
-
**Can I set multiple `Only Send`Destination Filters?**
137
+
#### Can I set multiple `Only Send`destination filters?
135
138
136
139
Segment evaluates multiple `Only Send` filters against each other and resolves Destination Filters in order. If multiple `Only Send` filters conflict with each other, Segment won't send information downstream.
137
140
138
-
**How many properties can I view in the filter dropdown?**
141
+
#### How many properties can I view in the filter dropdown?
139
142
140
143
Segment displays the most recent 15,000 properties. To find a property not in the filter dropdown, enter the property manually.
141
144
142
-
**How can I filter out warehouse events?**
145
+
#### How can I filter out warehouse events?
143
146
144
147
To filter out events from warehouses, use Selective Sync.
145
148
146
-
**I don't see a `name` property at the top level of my events to filter on "event name".**
147
-
148
-
Generally, only Track calls have "name" properties, which correspond to the "Event" field in an event.
149
+
#### I don't see a *name* property at the top level of my events to filter on *event* name".
149
150
150
-
**How can I find out when new Destination Filters have been added or removed?**
151
+
Generally, only Track calls have *name* properties, which correspond to the *event* field in an event.
151
152
152
-
The activity feed shows the action, date, and user who performed the action when a Destination Filter is created, modified, enabled, disabled, or deleted. You can also subscribe to notifications for any of these changes in the Activity Feed settings page.
153
+
#### How can I find out when new Destination Filters have been added or removed?
153
154
154
-
The Activity Feed shows the user, date, and action performed when a Destination Filter is created, modified, enabled, disabled, or deleted.
155
+
The Activity Feed shows the action, date, and user who performed the action when a Destination Filter is created, modified, enabled, disabled, or deleted. You can also subscribe to notifications for any of these changes in the **Activity Feed** settings page.
155
156
156
-
**Why am I getting a permissions denied error when I try to save a filter?**
157
+
#### Why am I getting a permissions denied error when I try to save a filter?
157
158
158
-
You must have write access to save and edit filters; read permission allows viewing and testing access only.
159
+
You must have write access to save and edit filters. Read permission access only allows viewing and testing access.
159
160
160
-
**How can I test my filter?**
161
+
#### How can I test my filter?
161
162
162
163
Use the Destination Filter tester during setup to verify that you're filtering out the right events. Filtered events show up on the schema page but aren't counted in event deliverability graphs.
0 commit comments