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/catalog/facebook-pixel-server-side/index.md
+24-24
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ hide-dossier: true
21
21
> info "Destination name change"
22
22
> Facebook Conversions API was renamed from Facebook Pixel Server-Side.
23
23
24
-
### Other Facebook Destinations Supported by Segment
24
+
### Other Facebook destinations supported by Segment
25
25
26
26
This page is about the **Facebook Conversions API** destination. For documentation on other Facebook destinations, including Facebook Pixel, see the pages linked below.
27
27
@@ -32,15 +32,15 @@ This page is about the **Facebook Conversions API** destination. For documentati
|**[Facebook Pixel](/docs/connections/destinations/catalog/facebook-pixel/)**| No |
34
34
35
-
## Getting Started
35
+
## Getting started
36
36
37
37
{% include content/connection-modes.md %}
38
38
39
39
Next, set up your Pixel to work with the Facebook Conversions API destination. You can use an existing Facebook Pixel that you already have set up, or create a new one. If you don't already have a Facebook Pixel configured, follow the "New Pixel" instructions below to create one.
40
40
41
41
### Option 1 - Create a new pixel
42
42
43
-
1. Go to the Facebook Business [Events Manager](https://www.facebook.com/events_manager/) and click **Connect Data Sources**.
43
+
1. Go to the Facebook Business [Events Manager](https://www.facebook.com/events_manager/){:target="_blank"} and click **Connect Data Sources**.
44
44
2. Choose Web, App, or Offline and then click **Get Started**.
45
45
3. Select "Conversions API" and then click **Connect**.
46
46
4. Choose "Segment" from the list of partners.
@@ -58,12 +58,12 @@ Next, set up your Pixel to work with the Facebook Conversions API destination. Y
58
58
1. From the Destinations catalog page in the Segment App, click **Add Destination**.
59
59
2. Search for "Facebook Conversions API" in the Destinations Catalog, and select the "Facebook Conversions API" destination.
60
60
3. Choose which Source should send data to the "Facebook Conversions API" destination.
61
-
4. Go to the Facebook Business [Event Manager Pixel Settings](https://business.facebook.com/events_manager/pixel/settings), find and copy the "Pixel ID".
61
+
4. Go to the Facebook Business [Event Manager Pixel Settings](https://business.facebook.com/events_manager/pixel/settings){:target="_blank"}, find and copy the "Pixel ID".
62
62
5. Enter the "Pixel ID" in the "Facebook Conversions API" destination settings in Segment.
63
63
64
64
65
65
> info ""
66
-
> See the [Configuration options](#configuration-options) section below for additional implementation steps
66
+
> See the [Configuration options](#configuration-options) section below for additional implementation steps.
67
67
68
68
## Configuration options
69
69
@@ -82,7 +82,7 @@ This approach provides a redundancy that ensures maximum signal reliability. Eve
82
82
83
83
For this option to work best, pass the same `external_id` from the browser and the server. To achieve this, go to the Facebook Pixel destination settings in Segment and enable the **Enable Advanced Matching** and **Use User ID or Anonymous ID as External ID** settings. By default, the Facebook Conversions API destination uses the `userId` (or `anonymousId` if not present) to set the `external_id`, so when you configure Facebook Pixel to use the same settings, Facebook matches users by those IDs.
84
84
85
-
You can also increase the match rate for events from a server source by sending [user traits in the context object of the track events](#default-mappings-to-facebook-properties). You can also collect other fields from the browser, such as `userAgent`, `ip` address, and [Facebook's parameters (fbp, fbc)](https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/fbp-and-fbc) and pass them to the server, and manually add them to the events.
85
+
You can also increase the match rate for events from a server source by sending [user traits in the context object of the track events](#default-mappings-to-facebook-properties). Collect other fields from the browser, such as `userAgent`, `ip` address, and [Facebook's parameters (fbp, fbc)](https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/fbp-and-fbc){:target="_blank"}, pass them to the server, and manually add them to the events.
86
86
87
87
#### Deduplication considerations
88
88
@@ -110,7 +110,7 @@ Use this approach if you don't want to track users from the browser with Faceboo
110
110
111
111
If you use Facebook Conversions API as a stand-alone without certain data fields collected from the browser, the match rate might not be as high as if you included them.
112
112
113
-
You can also increase the match rate for events from a server source by sending [user traits in the context object of the track events](#default-mappings-to-facebook-properties). You can also collect other fields from the browser, such as `userAgent`, `ip` address, and [Facebook's parameters (fbp, fbc)](https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/fbp-and-fbc) and pass them to the server, and manually add them to the events.
113
+
You can also increase the match rate for events from a server source by sending [user traits in the context object of the track events](#default-mappings-to-facebook-properties). Collect other fields from the browser, such as `userAgent`, `ip` address, and [Facebook's parameters (fbp, fbc)](https://developers.facebook.com/docs/marketing-api/conversions-api/parameters/fbp-and-fbc){:target="_blank"}, pass them to the server, and manually add them to the events.
For more information about Track calls, see the [Track method](/docs/connections/spec/track/) in the Segment Spec.
125
125
126
-
## Server Event Parameter Requirements
126
+
## Server event parameter requirements
127
127
128
-
Beginning February 15th 2021, Facebook requires the `action_source` server event parameter for all events sent to the Conversions API. This parameter is used to specify where the conversions occurred. If `action_source` is set to 'website' then the `client_user_agent` and the `event_source_url` parameters are also required. Events sent to the Conversions API after February 15th that do not meet the requirements may not be available for optimization, targeting, or measurement.
128
+
Beginning February 15th, 2021, Facebook requires the `action_source` server event parameter for all events sent to the Conversions API. This parameter is used to specify where the conversions occurred. If `action_source` is set to 'website' then the `client_user_agent` and the `event_source_url` parameters are also required. Events sent to the Conversions API after February 15th that do not meet the requirements may not be available for optimization, targeting, or measurement.
129
129
130
130
| Server Event Parameter | Requirement | Implementation p |
@@ -159,7 +159,7 @@ You can set `action_source` manually by passing it as a property of a Track even
159
159
160
160
`event_source_url` is set by including `context.page.url` in the track event. The value used should be the browser URL where the conversion event occurred. If you're using a server library, set `event_source_url` manually. If you're using the Segment web library, `event_source_url` is set automatically.
161
161
162
-
### Implementing Server Event Parameter Requirements
162
+
### Implementing server event parameter requirements
163
163
164
164
If `action_source` is set to 'website', the `context.userAgent` and the `context.page.url` fields are required. Segment server-side libraries do not collect `context.userAgent` or `context.page.url` by default. This data must be retrieved manually from the client and passed to the server.
165
165
@@ -193,9 +193,9 @@ analytics.track({
193
193
});
194
194
```
195
195
196
-
### Default Mappings to Facebook Standard Events
196
+
### Default mappings to Facebook standard events
197
197
198
-
The following mappings are automatic and require no additional set up. Any of the Segment Ecommerce Events in the table below will be sent as the corresponding Facebook Standard Event. You learn more about these in the Facebook pixel [standard events documentation](https://developers.facebook.com/docs/facebook-pixel/implementation/conversion-tracking#standard-events).
198
+
The following mappings are automatic and require no additional set up. Any of the Segment Ecommerce Events in the table below will be sent as the corresponding Facebook Standard Event. You learn more about these in the Facebook pixel [standard events documentation](https://developers.facebook.com/docs/facebook-pixel/implementation/conversion-tracking#standard-events){:target="_blank"}.
199
199
200
200
| Segment E-commerce Event | Facebook Standard Event |
@@ -209,20 +209,20 @@ The following mappings are automatic and require no additional set up. Any of th
209
209
> info ""
210
210
> Facebook requires a currency for "Purchase" events -- if you leave it out, Segment will set a default value of "USD".
211
211
212
-
### Custom Mappings to Facebook Standard Events
212
+
### Custom mappings to Facebook standard events
213
213
214
214
To map any of your Segment Events (not listed in the table above) to a Facebook _Standard event_, use the Segment destination setting labeled **Map Your Events to Standard FB Events**. Then, when Segment receives an event that appears in that mapping, the event is sent to Facebook as the standard event you specified. All properties included in the event are sent as event properties.
215
215
216
216
217
-
### Facebook Custom Events
218
-
Any unmapped events are automatically sent to Facebook Conversions as a _custom_ event. If Facebook's predefined standard events aren't suitable for your needs, you can track your own custom events, which also can be used to define [custom audiences](https://developers.facebook.com/docs/facebook-pixel/implementation/custom-audiences) for ad optimization. Custom events also support parameters, which you can include to provide additional information about each custom event.
217
+
### Facebook custom events
218
+
Any unmapped events are automatically sent to Facebook Conversions as a _custom_ event. If Facebook's predefined standard events aren't suitable for your needs, you can track your own custom events, which also can be used to define [custom audiences](https://developers.facebook.com/docs/facebook-pixel/implementation/custom-audiences){:target="_blank"} for ad optimization. Custom events also support parameters, which you can include to provide additional information about each custom event.
219
219
220
220
> warning ""
221
221
> Custom event names cannot exceed 50 characters in length.
222
222
223
-
### Default Mappings to Facebook Properties
223
+
### Default mappings to Facebook properties
224
224
225
-
Segment maps the following Segment traits to [Facebook properties](https://developers.facebook.com/docs/marketing-api/server-side-api/parameters):
225
+
Segment maps the following Segment traits to [Facebook properties](https://developers.facebook.com/docs/marketing-api/server-side-api/parameters){:target="_blank"}:
@@ -256,7 +256,7 @@ Segment maps the following Segment traits to [Facebook properties](https://devel
256
256
> info "About hashing"
257
257
> For each of the hashed properties above, Segment's integration code hashes the values before they're sent to the destination.
258
258
259
-
To access the `contexts` and `context.traits` objects in a Track call, you can use the [context-traits format](/docs/connections/sources/catalog/libraries/website/javascript/#context--traits) as in the example below.
259
+
To access the `contexts` and `context.traits` objects in a Track call, you can use the [context-traits format](/docs/connections/sources/catalog/libraries/website/javascript/identity/#saving-traits-to-the-context-object) as in the example below.
Any properties you send that aren't listed above are sent in the `custom_data` part of the Segment payload to Facebook.
274
274
275
-
### Alternative External IDs
275
+
### Alternative external IDs
276
276
277
277
By default, Segment sends the `userId` as `external_id`, and if `userId` is absent falls back to `anonymousId`. To use a different field in your payload as the `external_id`, use the **Alternative External ID Field** setting. An example value for this setting would be `properties.externalId`.
278
278
279
-
### Alternative Value Properties
279
+
### Alternative value properties
280
280
281
281
For most events Segment sends revenue for the Pixel value field, but for
282
282
the pre-purchase events `Product Viewed` and `Product Added`, Segment
283
283
uses the value of the **Value Field Identifier** setting to determine which
284
284
property to use for the `value` field. This field defaults to
285
285
`price`.
286
286
287
-
## Limited Data Use
287
+
## Limited data use
288
288
289
289
{% include content/facebook-ldu-intro.md %}
290
290
@@ -311,7 +311,7 @@ analytics.track({
311
311
})
312
312
```
313
313
314
-
## Verify Events in Facebook
314
+
## Verify events in Facebook
315
315
316
316
After you start sending events, you should start seeing them in twenty
317
317
minutes. You can confirm that Facebook received them:
@@ -323,4 +323,4 @@ minutes. You can confirm that Facebook received them:
323
323
> info ""
324
324
> **Note**: It might take a few minutes before events appear in the Events Manager.
325
325
326
-

326
+

0 commit comments