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
Copy file name to clipboardExpand all lines: src/connections/destinations/destination-filters.md
+34-28Lines changed: 34 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,32 +3,38 @@ title: Destination Filters
3
3
rewrite: true
4
4
---
5
5
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.
6
+
> info ""
7
+
> Destination filters are only available to Business Tier customers.
8
+
>
9
+
> Destination filters for mobile device-mode destinations are in beta and only supports [Swift](/docs/connections/sources/catalog/libraries/mobile/swift-ios#destination-filters), [Kotlin](/docs/connections/sources/catalog/libraries/mobile/kotlin-android/#destination-filters) and [React Native 2.0](/docs/connections/sources/catalog/libraries/mobile/react-native/#destination-filters) libraries.
10
+
11
+
Use destination filters to prevent certain data from flowing into a destination. You can conditionally filter out event properties, traits, and fields, or even filter out the event itself.
12
+
13
+
You can configure destination filters on cloud-mode, mobile, and web device-mode and actions-based destinations. With device-mode destinations, you can use the same user interface or API mechanism that you use for your cloud-mode destinations, and have those filters acted upon for device-mode destinations on web and mobile.
7
14
8
-
Common use cases for Destination Filters include:
15
+
Common use cases for destination filters include:
9
16
- Managing PII (personally identifiable information) by blocking fields from reaching certain destinations
10
17
- Controlling event volume by sampling or dropping unnecessary events for specific destinations
11
18
- Increasing data relevance in your destinations by removing unused or unwanted data
12
19
- Preventing test or internally-generated events from reaching your production tools
13
20
14
-
> info ""
15
-
> Destination Filters are only available to Business Tier customers.
16
-
17
21
### Limitations
18
22
19
-
Keep the following limitations in mind when you use Destination Filters:
23
+
Keep the following limitations in mind when you use destination filters:
20
24
21
-
- Segment applies Destination Filters one at a time in the order that they appear in your workspace.
22
-
- Destination Filters can only be applied to cloud-mode (server-side) streaming destinations.
23
-
- Device-mode destinations aren't supported.
24
-
- You can't apply Destination Filters to Warehouses or S3 destinations.
25
+
- Segment applies destination filters one at a time in the order that they appear in your workspace.
26
+
- You can't apply destination filters to Warehouses or S3 destinations.
25
27
- Each filter can only apply to one source-destination pair.
28
+
-*(For device-mode)* Destination filters don't apply to items that are added to the payload server-side such as IP addresses.
29
+
-*(For device-mode)* Destination filters don't filter on native events that the destination SDK collects. Instead, you can use the load option to conditionally load relevant bundled JavaScript on the page. See the docs for [load options](/docs/connections/sources/catalog/libraries/website/javascript/#load-options).
30
+
-*(For device-mode)* Destination filters don't filter some fields that are collected by the destination SDK outside of Segment such as `page.url` and `page.referrer`.
31
+
-*(For web device-mode)* Destination filters for web device-mode only supports the Analytics.js 2.0 source. You need to enable device mode destination filters for your Analytics.js source. To do this, go to your Javascript source and navigate to **Settings > Analytics.js** and turn the toggle on for **Destination Filters**.
26
32
27
33
[Contact Segment](https://segment.com/help/contact/){:target="_blank"} if these limitations impact your use case.
28
34
29
-
## Create a Destination Filter
35
+
## Create a destination filter
30
36
31
-
To create a Destination Filter:
37
+
To create a destination filter:
32
38
1. Go to **Connections > Destinations** and select your destination.
33
39
2. Click on the **Filters** tab of your destination.
34
40
3. Click **+ New Filter**.
@@ -38,11 +44,11 @@ To create a Destination Filter:
38
44
7. Name your filter and click the toggle to enable it.
39
45
8. Click **Save**.
40
46
41
-
## Destination Filters API
47
+
## Destination filters API
42
48
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/).
49
+
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/).
44
50
45
-
The Destination Filters API offers four different filter types:
51
+
The destination filters API offers four different filter types:
@@ -55,7 +61,7 @@ To learn more, read Segment's [Destination Filters API docs](https://docs.segmen
55
61
56
62
## Examples
57
63
58
-
The following examples illustrate common Destinations Filters use cases:
64
+
The following examples illustrate common destinations filters use cases:
59
65
*[PII management](#pii-management)
60
66
*[Control event volume](#control-event-volume)
61
67
*[Cleaner data](#cleaner-data)
@@ -67,7 +73,7 @@ The following examples illustrate common Destinations Filters use cases:
67
73
68
74
Example: Remove email addresses from `context` and `properties`:
69
75
70
-
Property-level allowlisting is available with Segment's API. Using Destination Filters, you can configure a rule that removes email addresses from `context` and `properties`. As a result, Segment only sends traits without PII to the destination.
76
+
Property-level allowlisting is available with Segment's API. Using destination filters, you can configure a rule that removes email addresses from `context` and `properties`. As a result, Segment only sends traits without PII to the destination.
@@ -96,31 +102,31 @@ In the example below, the rule prevents an event from sending if `Order Complete
96
102
97
103
### Sample a percentage of events
98
104
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.
105
+
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.
100
106
101
107
### Drop events
102
108
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.
109
+
[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.
104
110
105
111
## Important notes
106
112
107
113
#### Conflicting settings
108
114
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.
115
+
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.
110
116
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.
117
+
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.
112
118
113
119
#### Error handling
114
120
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.
121
+
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.
116
122
117
123
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"}.
118
124
119
125
## FAQs
120
126
121
-
#### How do Destination Filters work with array properties?
127
+
#### How do destination filters work with array properties?
122
128
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.
129
+
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.
124
130
125
131
To block a specific property from all of the objects within a properties array, set the filter using the following the format: `<propertyType>.<arrayName>.<arrayElementLabel>`.
126
132
@@ -136,7 +142,7 @@ Segment supports 10 filters per destination. If you need help consolidating filt
136
142
137
143
#### Can I set multiple `Only Send` destination filters?
138
144
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.
145
+
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.
140
146
141
147
#### How many properties can I view in the filter dropdown?
142
148
@@ -150,14 +156,14 @@ To filter out events from warehouses, use Selective Sync.
150
156
151
157
Generally, only Track calls have *name* properties, which correspond to the *event* field in an event.
152
158
153
-
#### How can I find out when new Destination Filters have been added or removed?
159
+
#### How can I find out when new destination filters have been added or removed?
154
160
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.
161
+
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.
156
162
157
163
#### Why am I getting a permissions denied error when I try to save a filter?
158
164
159
165
You must have write access to save and edit filters. Read permission access only allows viewing and testing access.
160
166
161
167
#### How can I test my filter?
162
168
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.
169
+
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.
Copy file name to clipboardExpand all lines: src/connections/sources/catalog/libraries/mobile/kotlin-android/index.md
+26-2Lines changed: 26 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -340,8 +340,8 @@ analytics.add(yourPlugin)
340
340
```
341
341
342
342
### Example projects using Analytics-Kotlin
343
-
See how different platforms and languages use Analytics-Kotlin in different [example projects](https://github.com/segmentio/analytics-kotlin/tree/main/samples).
344
-
The example projects contain sample [plugins](https://github.com/segmentio/analytics-kotlin/tree/main/samples/kotlin-android-app/src/main/java/com/segment/analytics/next/plugins) and [destination plugins](https://github.com/segmentio/analytics-kotlin/tree/main/samples/kotlin-android-app-destinations/src/main/java/com/segment/analytics/destinations/plugins) you can utilize.
343
+
See how different platforms and languages use Analytics-Kotlin in different [example projects](https://github.com/segmentio/analytics-kotlin/tree/main/samples){:target="_blank"}.
344
+
The example projects contain sample [plugins](https://github.com/segmentio/analytics-kotlin/tree/main/samples/kotlin-android-app/src/main/java/com/segment/analytics/next/plugins){:target="_blank"} and [destination plugins](https://github.com/segmentio/analytics-kotlin/tree/main/samples/kotlin-android-app-destinations/src/main/java/com/segment/analytics/destinations/plugins){:target="_blank"} you can use.
345
345
346
346
## Utility methods
347
347
The Analytics-Kotlin utility methods help you work with plugins from the analytics timeline. They include:
@@ -442,6 +442,30 @@ analytics.reset()
442
442
{% endcodeexampletab %}
443
443
{% endcodeexample %}
444
444
445
+
## Destination filters
446
+
> info ""
447
+
> Destination filters are only available to Business Tier customers.
448
+
>
449
+
> Destination filters on mobile device-mode destinations are in beta and only supports Analytics-Kotlin, [Analytics-Swift](/docs/connections/sources/catalog/libraries/mobile/swift-ios/), and [Analytics-React-Native 2.0](/docs/connections/sources/catalog/libraries/mobile/react-native/).
450
+
451
+
Use Analytics-Kotlin (Android) to configure [destination filters](docs/connections/destinations/destination-filters/) on your mobile device-mode destinations.
452
+
453
+
> warning ""
454
+
> Keep [these limitations](/docs/connections/destinations/destination-filters/#limitations) in mind when using destination filters.
455
+
456
+
457
+
To get started with destination filters on mobile device-mode destinations using Kotlin:
> Destination filters are only available to Business Tier customers.
497
+
>
498
+
> Destination filters on mobile device-mode destinations are in beta and only supports Analytics-React-Native 2.0, [Analytics-Swift](/docs/connections/sources/catalog/libraries/mobile/swift-ios/) and [Analytics-Kotlin](/docs/connections/sources/catalog/libraries/mobile/kotlin-android/).
499
+
500
+
Use Analytics-React-Native 2.0 to set up [destination filters](docs/connections/destinations/destination-filters/) on your mobile device-mode destinations.
501
+
502
+
> warning ""
503
+
> You must use Analytics-React-Native version 2.9 or higher to implement destination filters.
504
+
>
505
+
> Keep [these limitations](/docs/connections/destinations/destination-filters/#limitations) in mind when using destination filters.
506
+
507
+
To get started with destination filters on mobile device-mode destinations using Analytics-React-Native 2.0:
508
+
1. Download and install the `@segment/analytics-react-native-plugin-destination-filters` package as a dependency in your project.
2. Follow the instructions for [adding plugins](/docs/connections/sources/catalog/libraries/mobile/react-native/#adding-plugins) on the main Analytics client.
518
+
3. Add `DestinationFiltersPlugin` after you create your Segment client.
Segment supports a large number of [Cloud-mode](/docs/connections/destinations/#connection-modes) destinations. Segment also supports the below destinations for Analytics React Native 2.0 in device-mode, with more to follow:
0 commit comments