Skip to content

Commit 04b4ba2

Browse files
authored
Merge pull request #1026 from segmentio/irina-facebbook-ldu
docs for new LDU feature
2 parents 6a9b46e + c6a1971 commit 04b4ba2

File tree

7 files changed

+176
-1
lines changed

7 files changed

+176
-1
lines changed

src/_data/sidenav/strat.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@ sections:
2121
section:
2222
- path: /connections/destinations/catalog/facebook-pixel
2323
title: Facebook Pixel destination
24+
- path: /connections/destinations/catalog/facebook-pixel-server-side
25+
title: Facebook Pixel Server destination (Beta)
2426
- path: /connections/destinations/catalog/facebook-app-events
2527
title: Facebook App Events destination
28+
- path: /connections/destinations/catalog/facebook-offline-conversions
29+
title: Facebook Offline Conversions destination
2630
- path: /connections/sources/catalog/cloud-apps/facebook-ads
2731
title: Facebook Ads Cloud Source
2832
- path: /connections/sources/catalog/cloud-apps/facebook-lead-ads
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
In July 2020, Facebook released [Limited Data Use feature](https://developers.facebook.com/docs/marketing-apis/data-processing-options) to help businesses comply with the California Consumer Privacy Act (CCPA). This feature limits the way user data is stored and processed for all California residents who opt out of the sale of their data. You can send Limited Data Use data processing parameters to Facebook on each event so that Facebook can appropriately apply the user’s data choice. Segment recommends that you first familiarize yourself on this feature and the [Data Processing Options Facebook accepts](https://developers.facebook.com/docs/marketing-apis/data-processing-options).
2+
3+
This destination supports the following parameters:
4+
5+
* **Data Processing Options**
6+
* **Data Processing Options Country**
7+
* **Data Processing Options State**
8+
9+
You can enable the feature using the **Use Limited Data Use** destination setting and control it using Data Processing Initialization Parameters.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
### Data Processing Destination Setting
2+
3+
You can change the **Use Limited Data Use** destination setting to enable or disable Limited Data Use. This must be enabled (set to “on”) if you want to send data processing parameters as part of the the Limited Data Use feature.
4+
5+
### Data Processing Initialization Parameters
6+
7+
The Data Processing parameters you set are the Data Processing Options Segment uses when sending data to Facebook. By default, Segment uses the following Data Processing Parameters:
8+
9+
| **Data Processing Parameter** | **Default Value** | **What it means** |
10+
| ----------------------------------- | ----------------- | ----------------------------------------------- |
11+
| **Data Processing Options** | `["LDU"]` | Use Facebook’s Limited Data Use processing |
12+
| **Data Processing Options Country** | `0` | Use Facebook’s geolocation to determine country |
13+
| **Data Processing Options State** | `0` | Use Facebook’s geolocation to determine state |

src/connections/destinations/catalog/facebook-app-events/index.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,67 @@ The most important events that can help advertisers improve campaign ROI are the
155155

156156
In addition, there are special requirements for dynamic ads. These events are marked with "m" for dynamic ads for mobile, and "t" for dynamic ads for travel within Segment's Facebook App Events settings page.
157157

158+
## Limited Data Use
159+
160+
{% include content/facebook-ldu-intro.md %}
161+
162+
> info ""
163+
> The **Use Limited Data Use** destination setting is disabled by default for all Facebook destinations except for Facebook Pixel. This must be enabled manually from the destination settings if you're using other Facebook destinations.
164+
165+
{% include content/facebook-ldu-params.md %}
166+
167+
Facebook uses the `context.ip` to determine the geolocation of the event.
168+
169+
You can manually change the Data Processing parameters by adding settings to the `integrations` object.
170+
171+
#### Server-side library
172+
173+
The example below shows how you might set custom Data Processing parameters for a Segment server library.
174+
175+
```javascript
176+
// node library example
177+
178+
analytics.track({
179+
event: 'Membership Upgraded',
180+
userId: '97234974',
181+
integrations: {
182+
"Facebook App Events": {
183+
"dataProcessingOptions": [[], 1,1000]
184+
}
185+
}
186+
})
187+
```
188+
189+
#### iOS Device Mode
190+
191+
When you use Segment’s mobile libraries, you must set the Data Processing Options when you declare the destination in your app delegate’s instance. The example below shows how you might set custom Data Processing parameters in an iOS project.
192+
193+
```objc
194+
// Add the bundle FB integration SDK
195+
// Set data processing values.
196+
SEGFacebookAppEventsIntegrationFactory *fb = [SEGFacebookAppEventsIntegrationFactory instance];
197+
[fb setDataProcessingOptions:@[ @"LDU" ] forCountry:1 forState: 1000];
198+
[config use:fb];
199+
```
200+
201+
#### Android and iOS Cloud Mode
202+
203+
To send the Data Processing Parameters in cloud mode on iOS or Android, you can set them in the integrations object. The example below shows how you might set custom Data Processing parameters in Android.
204+
205+
```java
206+
Object[] dataProcessingOptions = new Object[3]
207+
dataProcessingOptions[0] = {'LDU'} // options
208+
dataProcessOptions[1] = 1 // country
209+
dataProcessingOptions[2] = 1000 // state
210+
211+
Analytics.with(context).track(
212+
"Purchased Item",
213+
new Properties(),
214+
new Options().setIntegrationOptions(
215+
"Facebook App Events", new ImmutableMap.Builder<String, Object>().put("dateProcessingOptions", dataProcessingOptions).build());
216+
)
217+
```
218+
158219
## Other Features
159220

160221
### Facebook Login and Facebook Dialogs

src/connections/destinations/catalog/facebook-offline-conversions/index.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: Facebook Offline Conversions Destination
33
rewrite: true
4+
strat: facebook
45
---
56

67
[Facebook Offline Conversions](https://www.facebook.com/business/help/1782327938668950?utm_source=segmentio&utm_medium=docs&utm_campaign=partners) enables offline event tracking, so marketers can run campaigns, upload transaction data, and compare in-store transactions.
@@ -277,3 +278,39 @@ analytics.track({
277278
We will use SHA256 to hash all `match_keys` that include personally identifiable data in compliance with Facebook's privacy requirements.
278279

279280
Keep in mind that Facebook's furthest possible attribution window is 28 days. It is recommended that you send your server side `track` conversions within 62 days of the offline conversion occuring.
281+
282+
## Limited Data Use
283+
284+
{% include content/facebook-ldu-intro.md %}
285+
286+
> info ""
287+
> The **Use Limited Data Use** destination setting is disabled by default for all Facebook destinations except for Facebook Pixel. This must be enabled manually from the destination settings if you're using other Facebook destinations.
288+
289+
### Data Processing Destination Setting
290+
291+
You can change the **Use Limited Data Use** destination setting to enable or disable Limited Data Use. This must be enabled (set to “on”) if you want to send data processing parameters as part of the the Limited Data Use feature.
292+
293+
### Data Processing Initialization Parameters
294+
295+
The Data Processing parameters you set are the Data Processing Options Segment uses when sending data to Facebook.
296+
297+
The Facebook API does not accept an IP address field to determine the geolocation of a user. Instead, you would need to set the specific user geography options (**Data Processing Options Country** and **Data Processing Options State**) in the `integrations` object.
298+
299+
> warning ""
300+
> If the **Use Limited Data Use** destination setting is enabled, but you do *not* pass the Data Processing parameters in the `integrations` object, Segment sends an empty data processing object which disables LDU for this event.
301+
302+
The example below shows how you might set custom Data Processing parameters for a Segment server library.
303+
304+
```javascript
305+
// node.js library example
306+
307+
analytics.track({
308+
event: 'Membership Upgraded',
309+
userId: '97234974',
310+
integrations: {
311+
"Facebook Offline Conversions": {
312+
"dataProcessingOptions": [[], 1,1000]
313+
}
314+
}
315+
})
316+
```

src/connections/destinations/catalog/facebook-pixel-server-side/index.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: Facebook Pixel Server-Side Destination
33
rewrite: true
44
hidden: true
55
beta: true
6+
strat: facebook
67
---
78

89
[Facebook Pixel Server-Side API](https://developers.facebook.com/docs/marketing-api/server-side-api) allows advertisers to send events from their servers directly to Facebook. Server-Side events are linked to a pixel and are processed like browser pixel events. This means that Server-Side events are used in measurement, reporting, and optimization in the same way as browser pixel events.
@@ -145,6 +146,33 @@ uses the value of the "Value Field Identifier" setting to determine which
145146
property to use for the "value" field. This field defaults to
146147
`price`.
147148

149+
## Limited Data Use
150+
151+
{% include content/facebook-ldu-intro.md %}
152+
153+
> info ""
154+
> The **Use Limited Data Use** destination setting is disabled by default for all Facebook destinations except for Facebook Pixel. This must be enabled manually from the destination settings if you're using other Facebook destinations.
155+
156+
{% include content/facebook-ldu-params.md %}
157+
158+
Facebook uses the `context.ip` to determine the geolocation if it exists on the event.
159+
160+
You can manually change the Data Processing parameters by adding settings to the `integrations` object. The example below shows how you might set custom Data Processing parameters in Node.
161+
162+
```javascript
163+
// node.js library example
164+
165+
analytics.track({
166+
event: 'Membership Upgraded',
167+
userId: '97234974',
168+
integrations: {
169+
"Facebook Pixel Server-Side": {
170+
"dataProcessingOptions": [[], 1,1000]
171+
}
172+
}
173+
})
174+
```
175+
148176
## Verify Events in Facebook
149177

150178
After you start sending events, you should start seeing them in twenty

src/connections/destinations/catalog/facebook-pixel/index.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ analytics.identify('ze8rt1u89', {
5656
name: 'Zaphod Kim',
5757
gender: 'Male',
5858
59-
phone: '1-401-826-4421',
59+
phone: '1-401-555-4421',
6060
address: {
6161
city: 'San Francisco',
6262
state: 'Ca',
@@ -163,6 +163,29 @@ If you follow Segment's [spec](/docs/connections/spec/identify/#traits), these w
163163

164164
Facebook also accepts an External ID. This can be any unique ID from the advertiser, such as loyalty membership IDs, user IDs, and external cookie IDs. In order to send an `external_id` to Facebook you can indicate which user trait you would like Segment to map to `external_id` using the **Client-Side Only: Advanced Match Trait Key for External ID** setting.
165165

166+
## Limited Data Use
167+
168+
{% include content/facebook-ldu-intro.md %}
169+
170+
> info ""
171+
> The **Use Limited Data Use** destination setting is disabled by default for all Facebook destinations except for Facebook Pixel. This must be enabled manually from the destination settings if you're using other Facebook destinations.
172+
173+
{% include content/facebook-ldu-params.md %}
174+
175+
Facebook uses the `context.ip` to determine the geolocation of the event.
176+
177+
You can manually change the Data Processing parameters by adding settings to the `integrations` object. For Facebook Pixel, you must store these settings in the [Load object](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#load-options) so that Segment can set them *before* it calls `init`. The example below shows how you might set custom Data Processing parameters in Analytics.js.
178+
179+
```javascript
180+
analytics.load("replace_with_your_write_key", {
181+
integrations: {
182+
'Facebook Pixel': {
183+
dataProcessingOptions: [['LDU'], 1, 1000]
184+
}
185+
}
186+
});
187+
```
188+
166189
## Settings
167190

168191
### Map Categories to FB Content Types

0 commit comments

Comments
 (0)