Skip to content

Commit 04afa9b

Browse files
authored
Update index.md
1 parent 57959b1 commit 04afa9b

File tree

1 file changed

+86
-17
lines changed
  • src/connections/destinations/catalog/facebook-pixel-server-side

1 file changed

+86
-17
lines changed

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

Lines changed: 86 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ redirect_from: '/connections/destinations/catalog/facebook-conversions-api/'
88

99
[Facebook Conversions API](https://developers.facebook.com/docs/marketing-api/conversions-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.
1010

11+
> warning "Server Event Parameter Requirements"
12+
> Starting February 15th Facebook will be enforcing new requirements for server event parameters. Events sent to the Conversions API after February 15th that do not meet the requirements will be dropped by Facebook. For details on how implement these requirements see [Server Event Parameter Requirements](/docs/connections/destinations/catalog/facebook-pixel-server-side/#server-event-parameter-requirements)
13+
1114
> info "Destination name change"
1215
> Facebook Conversions API was renamed from Facebook Pixel Server-Side.
1316
@@ -42,9 +45,9 @@ This page is about the **Facebook Conversions**. For documentation on other Face
4245
Facebook Conversions API satisfies multiple use cases. It can be used a complement to [Facebook Pixel](/docs/connections/destinations/catalog/facebook-pixel/), or it can be used as a stand-alone alternative.
4346

4447
Implementation Options:
45-
1. [Send the same events from both the browser and the server](/docs/connections/destinations/catalog/facebook-conversions-api/#send-the-same-events-from-both-the-browser-and-the-server).
46-
2. [Send different events; some from the browser others from the server](/docs/connections/destinations/catalog/facebook-conversions-api/#send-different-events-some-from-the-browser-others-from-the-server).
47-
3. [Only send events from the server](/docs/connections/destinations/catalog/facebook-conversions-api/#only-send-events-from-the-server).
48+
1. [Send the same events from both the browser and the server](/docs/connections/destinations/catalog/facebook-pixel-server-side/#send-the-same-events-from-both-the-browser-and-the-server).
49+
2. [Send different events; some from the browser others from the server](/docs/connections/destinations/catalog/facebook-pixel-server-side/#send-different-events-some-from-the-browser-others-from-the-server).
50+
3. [Only send events from the server](/docs/connections/destinations/catalog/facebook-pixel-server-side/#only-send-events-from-the-server).
4851

4952
### Send the same events from both the browser and the server
5053

@@ -86,11 +89,75 @@ If you choose this option, you do not need to worry about event deduplication.
8689

8790
Currently, Facebook Conversions only supports Track calls.
8891

89-
If you're not familiar with the Segment Specs, take a look to understand what the [Track method](/docs/connections/spec/track/) does. An example call would look like:
92+
If you're not familiar with the Segment Specs, take a look to understand what the [Track method](/docs/connections/spec/track/) does.
9093

91-
```javascript
92-
analytics.track('Products Searched', {
93-
query: 'blue roses'
94+
## Server Event Parameter Requirements
95+
96+
Starting February 15th Facebook will require 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 will be dropped by Facebook.
97+
98+
| Server Event Parameter | Requirement | Implementation |
99+
|------------------------|-----------------|----------------|
100+
| `action_source` | Always required | It is set automatically but it can be set manually. |
101+
| `event_source_url` | Only required if `action_source` = “website | It must be set manually if using a server library. It is set automatically if using our web library. |
102+
| `client_user_agent` | Only required if `action_source` = “website | It must be set manually if using a server library. It is set automatically if using our web library. |
103+
104+
105+
###Action Source
106+
107+
`action_source` will automatically be set to "website" as a default value. If a mobile library is used then `action_source` will default to “app”.
108+
109+
`action_source` can also be set manually by passing it in as a property of a Track event. Either snake case or camel case can be used to include `action_source` as a property in Track events.
110+
111+
| Action Source Values | Description |
112+
| -------------------- | --------------------------------------------------------------------------------------------------------- |
113+
| `email` | Conversion happened over email. |
114+
| `website` | Conversion was made on your website. |
115+
| `app` | Conversion was made using your app. |
116+
| `phone_call` | Conversion was made over the phone. |
117+
| `chat` | Conversion was made via a messaging app, SMS, or online messaging feature. |
118+
| `physical_store` | Conversion was made in person at your physical store. |
119+
| `system_generated` | Conversion happened automatically, for example, a subscription renewal that’s set on auto-pay each month. |
120+
| `other` | Conversion happened in a way that is not listed. |
121+
122+
123+
###Client User Agent
124+
125+
`client_user_agent` is set by including `context.userAgent` in the track event. The value used should be the user agent of the browser where the conversion event occurred. It must be set manually if using a server library. It is set automatically if using our web library.
126+
127+
###Event Source URL
128+
129+
`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. It must be set manually if using a server library. It is set automatically if using our web library.
130+
131+
###Implementating Server Event Parameter Requirements
132+
133+
If `action_source` = 'website' then the `context.userAgent` and the `context.page.url` fields are required. Segment server-side libraries do not automatically collect the `context.userAgent` or the `context.page.url`. This data will need to be manually grabbed from the client and passed to the server.
134+
135+
Example of a [`Product Added`](/docs/connections/spec/ecommerce/v2/#product-added) event using Node.js
136+
```javascript
137+
analytics.track({
138+
context: {
139+
userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36",
140+
page: {
141+
url: "https://segment.com/"
142+
}
143+
},
144+
userId: "97980cfea0067",
145+
event: "Product Added",
146+
properties: {
147+
brand: "Hasbro",
148+
cart_id: "skdjsidjsdkdj29j",
149+
category: "Games",
150+
coupon: "MAYDEALS",
151+
image_url: "https://www.example.com/product/path.jpg",
152+
name: "Monopoly: 3rd Edition",
153+
position: 3,
154+
price: 18.99,
155+
product_id: "507f1f77bcf86cd799439011",
156+
quantity: 1,
157+
sku: "G-32",
158+
url: "https://www.example.com/product/path",
159+
variant: "200 pieces"
160+
},
94161
});
95162
```
96163

@@ -127,6 +194,8 @@ Segment maps the following Segment traits to [Facebook properties](https://devel
127194

128195
| **Segment Property** | **Pixel Property** | **Notes** |
129196
| ----------------------------------- | ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
197+
| `context.userAgent` | `user_data.client_user_agent` | |
198+
| `context.page.url` | `event_source_url` | |
130199
| `context.ip` | `user_data.client_ip_address` | |
131200
| `context.traits.address.city` | `user_data.ct` | hashed |
132201
| `context.traits.address.postalCode` | `user_data.zp` | hashed |
@@ -136,9 +205,9 @@ Segment maps the following Segment traits to [Facebook properties](https://devel
136205
| `context.traits.firstName` | `user_data.fn` | hashed |
137206
| `context.traits.lastName` | `user_data.ln` | hashed |
138207
| `context.traits.phone` | `user_data.ph` | hashed |
139-
| `context.userAgent` | `user_data.client_user_agent` | |
140208
| `event` | `event_name` | |
141209
| `messageId` | `event_id` | |
210+
| `properties.action_source` | `action_source` | |
142211
| `properties.currency` | `custom_data.currency` | Defaults to USD if not set |
143212
| `properties.fbc` | `fbc` | |
144213
| `properties.fbp` | `fbp` | |
@@ -197,15 +266,15 @@ You can manually change the Data Processing parameters by adding settings to the
197266
```javascript
198267
// node.js library example
199268

200-
analytics.track({
201-
event: 'Membership Upgraded',
202-
userId: '97234974',
203-
integrations: {
204-
"Facebook Conversions": {
205-
"dataProcessingOptions": [[], 1,1000]
206-
}
207-
}
208-
})
269+
analytics.track({
270+
event: 'Membership Upgraded',
271+
userId: '97234974',
272+
integrations: {
273+
"Facebook Conversions": {
274+
"dataProcessingOptions": [[], 1,1000]
275+
}
276+
}
277+
})
209278
```
210279

211280
## Verify Events in Facebook

0 commit comments

Comments
 (0)