@segment/analytics-browser-actions-facebook-conversions-api-web 1.9.1-staging-99a2d468f.1 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/functions.d.ts +0 -1
- package/dist/cjs/functions.js +2 -11
- package/dist/cjs/functions.js.map +1 -1
- package/dist/cjs/generated-types.d.ts +1 -0
- package/dist/cjs/index.d.ts +6 -2
- package/dist/cjs/index.js +17 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/send/depends-on.js +11 -40
- package/dist/cjs/send/depends-on.js.map +1 -1
- package/dist/cjs/send/fields.js +18 -5
- package/dist/cjs/send/fields.js.map +1 -1
- package/dist/cjs/send/functions.d.ts +2 -2
- package/dist/cjs/send/functions.js +40 -29
- package/dist/cjs/send/functions.js.map +1 -1
- package/dist/cjs/send/generated-types.d.ts +2 -0
- package/dist/cjs/send/index.d.ts +5 -2
- package/dist/cjs/send/index.js +1 -1
- package/dist/cjs/send/index.js.map +1 -1
- package/dist/cjs/types.d.ts +10 -0
- package/dist/cjs/types.js.map +1 -1
- package/dist/esm/functions.d.ts +0 -1
- package/dist/esm/functions.js +2 -10
- package/dist/esm/functions.js.map +1 -1
- package/dist/esm/generated-types.d.ts +1 -0
- package/dist/esm/index.d.ts +6 -2
- package/dist/esm/index.js +17 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/send/depends-on.js +11 -40
- package/dist/esm/send/depends-on.js.map +1 -1
- package/dist/esm/send/fields.js +18 -5
- package/dist/esm/send/fields.js.map +1 -1
- package/dist/esm/send/functions.d.ts +2 -2
- package/dist/esm/send/functions.js +40 -29
- package/dist/esm/send/functions.js.map +1 -1
- package/dist/esm/send/generated-types.d.ts +2 -0
- package/dist/esm/send/index.d.ts +5 -2
- package/dist/esm/send/index.js +1 -1
- package/dist/esm/send/index.js.map +1 -1
- package/dist/esm/types.d.ts +10 -0
- package/dist/esm/types.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/__tests__/functions.test.ts +159 -0
- package/src/constants.ts +1 -1
- package/src/functions.ts +66 -65
- package/src/generated-types.ts +4 -0
- package/src/index.ts +43 -26
- package/src/send/__tests__/depends-on.test.ts +28 -0
- package/src/send/__tests__/functions.test.ts +1178 -0
- package/src/send/depends-on.ts +41 -69
- package/src/send/fields.ts +304 -299
- package/src/send/functions.ts +213 -153
- package/src/send/generated-types.ts +10 -2
- package/src/send/index.ts +4 -4
- package/src/types.ts +33 -21
package/src/send/fields.ts
CHANGED
|
@@ -3,361 +3,366 @@ import { getDependenciesFor } from './depends-on'
|
|
|
3
3
|
import { CURRENCY_ISO_CODES } from '../constants'
|
|
4
4
|
|
|
5
5
|
export const event_config: InputField = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
6
|
+
label: 'Event Configuration',
|
|
7
|
+
description: 'Specify the type of Facebook Conversions API event to send.',
|
|
8
|
+
type: 'object',
|
|
9
|
+
required: true,
|
|
10
|
+
additionalProperties: false,
|
|
11
|
+
defaultObjectUI: 'keyvalue',
|
|
12
|
+
properties: {
|
|
13
|
+
event_name: {
|
|
14
|
+
label: 'Event Name',
|
|
15
|
+
description: "Facebook Conversions API Event Name to send. Select 'Custom Event' to send a non standard event.",
|
|
16
|
+
type: 'string',
|
|
17
|
+
required: true,
|
|
18
|
+
choices: [
|
|
19
|
+
{ label: 'Custom Event', value: 'CustomEvent' },
|
|
20
|
+
{ label: 'Page View', value: 'PageView' },
|
|
21
|
+
{ label: 'Add Payment Info', value: 'AddPaymentInfo' },
|
|
22
|
+
{ label: 'Add To Cart', value: 'AddToCart' },
|
|
23
|
+
{ label: 'Add To Wishlist', value: 'AddToWishlist' },
|
|
24
|
+
{ label: 'Complete Registration', value: 'CompleteRegistration' },
|
|
25
|
+
{ label: 'Contact', value: 'Contact' },
|
|
26
|
+
{ label: 'Customize Product', value: 'CustomizeProduct' },
|
|
27
|
+
{ label: 'Donate', value: 'Donate' },
|
|
28
|
+
{ label: 'Find Location', value: 'FindLocation' },
|
|
29
|
+
{ label: 'Initiate Checkout', value: 'InitiateCheckout' },
|
|
30
|
+
{ label: 'Lead', value: 'Lead' },
|
|
31
|
+
{ label: 'Purchase', value: 'Purchase' },
|
|
32
|
+
{ label: 'Schedule', value: 'Schedule' },
|
|
33
|
+
{ label: 'Search', value: 'Search' },
|
|
34
|
+
{ label: 'Start Trial', value: 'StartTrial' },
|
|
35
|
+
{ label: 'Submit Application', value: 'SubmitApplication' },
|
|
36
|
+
{ label: 'Subscribe', value: 'Subscribe' },
|
|
37
|
+
{ label: 'View Content', value: 'ViewContent' }
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
custom_event_name:{
|
|
41
|
+
label: 'Custom Event Name',
|
|
42
|
+
description: 'Custom event name to send to Facebook',
|
|
43
|
+
type: 'string',
|
|
44
|
+
depends_on: getDependenciesFor('custom_event_name')
|
|
45
|
+
},
|
|
46
|
+
show_fields: {
|
|
47
|
+
label: 'Show all fields',
|
|
48
|
+
description: 'Show all fields, even those which are not relevant to the selected Event Name.',
|
|
49
|
+
type: 'boolean',
|
|
50
|
+
default: false
|
|
51
|
+
}
|
|
39
52
|
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
depends_on: getDependenciesFor('custom_event_name')
|
|
45
|
-
},
|
|
46
|
-
show_fields: {
|
|
47
|
-
label: 'Show all fields',
|
|
48
|
-
description: 'Show all fields, even those which are not relevant to the selected Event Name.',
|
|
49
|
-
type: 'boolean',
|
|
50
|
-
default: false
|
|
53
|
+
default: {
|
|
54
|
+
event_name: 'CustomEvent',
|
|
55
|
+
custom_event_name: {'@path': '$.event'},
|
|
56
|
+
show_fields: false
|
|
51
57
|
}
|
|
52
|
-
},
|
|
53
|
-
default: {
|
|
54
|
-
event_name: 'CustomEvent',
|
|
55
|
-
custom_event_name: { '@path': '$.event' },
|
|
56
|
-
show_fields: false
|
|
57
|
-
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
export const content_category: InputField = {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
label: 'Content Category',
|
|
62
|
+
description: 'The category of the content associated with the event.',
|
|
63
|
+
type: 'string',
|
|
64
|
+
default: { '@path': '$.properties.category' },
|
|
65
|
+
depends_on: getDependenciesFor('content_category')
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
export const content_name: InputField = {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
label: 'Content Name',
|
|
70
|
+
description: 'The name of the page or product associated with the event.',
|
|
71
|
+
type: 'string',
|
|
72
|
+
default: { '@path': '$.properties.name' },
|
|
73
|
+
depends_on: getDependenciesFor('content_name')
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
export const content_type: InputField = {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
77
|
+
label: 'Content Type',
|
|
78
|
+
description:
|
|
79
|
+
'If the IDs being passed in content_ids or contents parameter are IDs of products, then the value should be product. If product group IDs are being passed, then the value should be product_group. If no content_type is provided, Meta will match the event to every item that has the same ID, independent of its type.',
|
|
80
|
+
type: 'string',
|
|
81
|
+
choices: [
|
|
82
|
+
{ value: 'product', label: 'Product' },
|
|
83
|
+
{ value: 'product_group', label: 'Product Group' }
|
|
84
|
+
],
|
|
85
|
+
default: 'product',
|
|
86
|
+
depends_on: getDependenciesFor('content_type')
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
export const content_ids: InputField = {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
label: 'Content IDs',
|
|
91
|
+
description: "Product IDs associated with the event, such as SKUs (e.g. ['ABC123', 'XYZ789']). Accepts a single string value or array of strings.",
|
|
92
|
+
type: 'string',
|
|
93
|
+
multiple: true,
|
|
94
|
+
default: { "@liquid": "{{ properties.products | map: 'product_id' }}"}
|
|
95
|
+
,
|
|
96
|
+
depends_on: getDependenciesFor('content_ids')
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
export const contents: InputField = {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
100
|
+
label: 'Contents',
|
|
101
|
+
description: 'A list of JSON objects that contain the product IDs associated with the event plus information about the products. ID and quantity are required fields.',
|
|
102
|
+
type: 'object',
|
|
103
|
+
multiple: true,
|
|
104
|
+
additionalProperties: true,
|
|
105
|
+
defaultObjectUI: 'keyvalue',
|
|
106
|
+
properties: {
|
|
107
|
+
id: {
|
|
108
|
+
label: 'ID',
|
|
109
|
+
description: 'The product ID of the purchased item.',
|
|
110
|
+
type: 'string',
|
|
111
|
+
required: true
|
|
112
|
+
},
|
|
113
|
+
quantity: {
|
|
114
|
+
label: 'Quantity',
|
|
115
|
+
description: 'The number of items purchased.',
|
|
116
|
+
type: 'integer',
|
|
117
|
+
required: true
|
|
118
|
+
},
|
|
119
|
+
item_price: {
|
|
120
|
+
label: 'Item Price',
|
|
121
|
+
description: 'The price of the item.',
|
|
122
|
+
type: 'number'
|
|
123
|
+
}
|
|
113
124
|
},
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
125
|
+
default: {
|
|
126
|
+
'@arrayPath': [
|
|
127
|
+
'$.properties.products',
|
|
128
|
+
{
|
|
129
|
+
id: { '@path': '$.product_id' },
|
|
130
|
+
quantity: { '@path': '$.quantity' },
|
|
131
|
+
item_price: { '@path': '$.price' }
|
|
132
|
+
}
|
|
133
|
+
]
|
|
119
134
|
},
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
description: 'The price of the item.',
|
|
123
|
-
type: 'number'
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
default: {
|
|
127
|
-
'@arrayPath': [
|
|
128
|
-
'$.properties.products',
|
|
129
|
-
{
|
|
130
|
-
id: { '@path': '$.product_id' },
|
|
131
|
-
quantity: { '@path': '$.quantity' },
|
|
132
|
-
item_price: { '@path': '$.price' }
|
|
133
|
-
}
|
|
134
|
-
]
|
|
135
|
-
},
|
|
136
|
-
depends_on: getDependenciesFor('contents')
|
|
137
|
-
}
|
|
135
|
+
depends_on: getDependenciesFor('contents')
|
|
136
|
+
}
|
|
138
137
|
|
|
139
138
|
export const currency: InputField = {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
139
|
+
label: 'Currency',
|
|
140
|
+
description: 'The currency for the value specified. Currency must be a valid ISO 4217 three-digit currency code.',
|
|
141
|
+
type: 'string',
|
|
142
|
+
default: { '@path': '$.properties.currency' },
|
|
143
|
+
depends_on: getDependenciesFor('currency'),
|
|
144
|
+
choices:(() => {
|
|
145
|
+
return [...CURRENCY_ISO_CODES].map(code => ({
|
|
146
|
+
value: code,
|
|
147
|
+
label: code
|
|
148
|
+
}))
|
|
149
|
+
})(),
|
|
150
|
+
required: {
|
|
151
|
+
match: 'all',
|
|
152
|
+
conditions: [
|
|
153
|
+
{
|
|
154
|
+
fieldKey: 'event_config.event_name',
|
|
155
|
+
operator: 'is',
|
|
156
|
+
value: 'Purchase'
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
}
|
|
161
160
|
}
|
|
162
161
|
|
|
163
162
|
export const delivery_category: InputField = {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
163
|
+
label: 'Delivery Category',
|
|
164
|
+
description: 'Category of the delivery',
|
|
165
|
+
type: 'string',
|
|
166
|
+
choices: [
|
|
167
|
+
{ value: 'in_store', label: 'In Store' },
|
|
168
|
+
{ value: 'curbside', label: 'Curbside' },
|
|
169
|
+
{ value: 'home_delivery', label: 'Home Delivery' }
|
|
170
|
+
],
|
|
171
|
+
depends_on: getDependenciesFor('delivery_category')
|
|
173
172
|
}
|
|
174
173
|
|
|
175
174
|
export const num_items: InputField = {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
175
|
+
label: 'Number of Items',
|
|
176
|
+
description: 'The number of items when checkout was initiated.',
|
|
177
|
+
type: 'integer',
|
|
178
|
+
default: { '@path': '$.properties.num_items' },
|
|
179
|
+
depends_on: getDependenciesFor('num_items')
|
|
181
180
|
}
|
|
182
181
|
|
|
183
182
|
export const predicted_ltv: InputField = {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
183
|
+
label: 'Predicted LTV',
|
|
184
|
+
description: 'Predicted lifetime value of a subscriber as defined by the advertiser and expressed as an exact value.',
|
|
185
|
+
type: 'number',
|
|
186
|
+
depends_on: getDependenciesFor('predicted_ltv')
|
|
188
187
|
}
|
|
189
188
|
|
|
190
189
|
export const net_revenue: InputField = {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
190
|
+
label: 'Net Revenue',
|
|
191
|
+
description: 'The net revenue associated with the purchase.',
|
|
192
|
+
type: 'number',
|
|
193
|
+
default: { '@path': '$.properties.net_revenue' },
|
|
194
|
+
depends_on: getDependenciesFor('net_revenue')
|
|
196
195
|
}
|
|
197
196
|
|
|
198
197
|
export const search_string: InputField = {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
198
|
+
label: 'Search String',
|
|
199
|
+
description: 'The string entered by the user for the search.',
|
|
200
|
+
type: 'string',
|
|
201
|
+
default: { '@path': '$.properties.query' },
|
|
202
|
+
depends_on: getDependenciesFor('search_string')
|
|
204
203
|
}
|
|
205
204
|
|
|
206
205
|
export const status: InputField = {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
206
|
+
label: 'Registration Status',
|
|
207
|
+
description: 'The status of the registration. true for completed registrations, false otherwise.',
|
|
208
|
+
type: 'boolean',
|
|
209
|
+
depends_on: getDependenciesFor('status')
|
|
211
210
|
}
|
|
212
211
|
|
|
213
212
|
export const value: InputField = {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
}
|
|
213
|
+
label: 'Value',
|
|
214
|
+
description: 'A numeric value associated with this event. This could be a monetary value or a value in some other metric.',
|
|
215
|
+
type: 'number',
|
|
216
|
+
default: { '@path': '$.properties.value' },
|
|
217
|
+
depends_on: getDependenciesFor('value'),
|
|
218
|
+
required: {
|
|
219
|
+
match: 'all',
|
|
220
|
+
conditions: [
|
|
221
|
+
{
|
|
222
|
+
fieldKey: 'event_config.event_name',
|
|
223
|
+
operator: 'is',
|
|
224
|
+
value: 'Purchase'
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
}
|
|
230
228
|
}
|
|
231
229
|
|
|
232
230
|
export const custom_data: InputField = {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
231
|
+
label: 'Custom Data',
|
|
232
|
+
description: 'The custom data object can be used to pass custom properties.',
|
|
233
|
+
type: 'object',
|
|
234
|
+
additionalProperties: true,
|
|
235
|
+
defaultObjectUI: 'keyvalue'
|
|
238
236
|
}
|
|
239
237
|
|
|
240
238
|
export const eventID: InputField = {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
'
|
|
244
|
-
|
|
245
|
-
default: { '@path': '$.messageId' }
|
|
239
|
+
label: 'Event ID',
|
|
240
|
+
description: 'This ID can be any unique string. Event ID is used to deduplicate events sent both the server side Conversions API and the browser Pixel.',
|
|
241
|
+
type: 'string',
|
|
242
|
+
default: { '@path': '$.messageId' }
|
|
246
243
|
}
|
|
247
244
|
|
|
248
245
|
export const eventSourceUrl: InputField = {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
default: { '@path': '$.context.page.url' }
|
|
246
|
+
label: 'Event Source URL',
|
|
247
|
+
description: 'The URL of the page where the event occurred. Can be used to override the default URL taken from the current page.',
|
|
248
|
+
type: 'string',
|
|
249
|
+
default: { '@path': '$.context.page.url' }
|
|
254
250
|
}
|
|
255
251
|
|
|
256
252
|
export const userData: InputField = {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
253
|
+
label: 'User Data',
|
|
254
|
+
description: 'User data to be sent with the event. This can include hashed identifiers like email, phone number, etc.',
|
|
255
|
+
type: 'object',
|
|
256
|
+
additionalProperties: false,
|
|
257
|
+
defaultObjectUI: 'keyvalue',
|
|
258
|
+
properties: {
|
|
259
|
+
external_id: {
|
|
260
|
+
label: 'External ID',
|
|
261
|
+
description: 'A unique identifier for the user from your system',
|
|
262
|
+
type: 'string'
|
|
263
|
+
},
|
|
264
|
+
em: {
|
|
265
|
+
label: 'Email',
|
|
266
|
+
description: 'Email address of the user',
|
|
267
|
+
type: 'string',
|
|
268
|
+
format: 'email'
|
|
269
|
+
},
|
|
270
|
+
ph: {
|
|
271
|
+
label: 'Phone Number',
|
|
272
|
+
description: 'Phone number of the user. Make sure to include the country code. For example, "15551234567" for a US number.',
|
|
273
|
+
type: 'string'
|
|
274
|
+
},
|
|
275
|
+
fn: {
|
|
276
|
+
label: 'First Name',
|
|
277
|
+
description: 'First name of the user',
|
|
278
|
+
type: 'string'
|
|
279
|
+
},
|
|
280
|
+
ln: {
|
|
281
|
+
label: 'Last Name',
|
|
282
|
+
description: 'Last name of the user',
|
|
283
|
+
type: 'string'
|
|
284
|
+
},
|
|
285
|
+
ge: {
|
|
286
|
+
label: 'Gender',
|
|
287
|
+
description: 'Gender of the user. If unknown leave blank.',
|
|
288
|
+
type: 'string',
|
|
289
|
+
choices: [
|
|
290
|
+
{ label: 'Male', value: 'm' },
|
|
291
|
+
{ label: 'Female', value: 'f' }
|
|
292
|
+
]
|
|
293
|
+
},
|
|
294
|
+
db: {
|
|
295
|
+
label: 'Date of Birth',
|
|
296
|
+
description: 'Date of birth of the user',
|
|
297
|
+
type: 'string',
|
|
298
|
+
format: 'date'
|
|
299
|
+
},
|
|
300
|
+
ct: {
|
|
301
|
+
label: 'City',
|
|
302
|
+
description: 'City of the user',
|
|
303
|
+
type: 'string'
|
|
304
|
+
},
|
|
305
|
+
st: {
|
|
306
|
+
label: 'State',
|
|
307
|
+
description: 'State of the user. Facebook expects the 2-letter abbreviation for US states. For example, "CA" for California, or "NY" for New York.',
|
|
308
|
+
type: 'string'
|
|
309
|
+
},
|
|
310
|
+
zp: {
|
|
311
|
+
label: 'ZIP/Postal Code',
|
|
312
|
+
description: 'ZIP or postal code of the user. For example, U.S zip code: 94035, Australia zip code: 1987, France zip code: 75018, UK zip code: m11ae.',
|
|
313
|
+
type: 'string'
|
|
314
|
+
},
|
|
315
|
+
country: {
|
|
316
|
+
label: 'Country',
|
|
317
|
+
description: 'The country of the user. Facebook expects the 2-letter ISO 3166-1 alpha-2 country code. For example, "US" for the United States, or "GB" for the United Kingdom.',
|
|
318
|
+
type: 'string'
|
|
319
|
+
},
|
|
320
|
+
fbp: {
|
|
321
|
+
label: 'FBP',
|
|
322
|
+
description: 'Use this field to pass the Facebook browser cookie value (_fbp) associated with the user. If the "Format User Data with Parameter Builder" setting is enabled, Segment will automatically capture this value from the _fbp cookie.',
|
|
323
|
+
type: 'string'
|
|
324
|
+
},
|
|
325
|
+
fbc: {
|
|
326
|
+
label: 'FBC',
|
|
327
|
+
description: 'Use this field to pass The Facebook browser cookie value (_fbc) associated with the user. If the "Format User Data with Parameter Builder" setting is enabled, Segment will automatically capture this value from the _fbc cookie.',
|
|
328
|
+
type: 'string'
|
|
329
|
+
}
|
|
284
330
|
},
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
{
|
|
296
|
-
{
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
label: 'Date of Birth',
|
|
301
|
-
description: 'Date of birth of the user',
|
|
302
|
-
type: 'string',
|
|
303
|
-
format: 'date'
|
|
304
|
-
},
|
|
305
|
-
ct: {
|
|
306
|
-
label: 'City',
|
|
307
|
-
description: 'City of the user',
|
|
308
|
-
type: 'string'
|
|
309
|
-
},
|
|
310
|
-
st: {
|
|
311
|
-
label: 'State',
|
|
312
|
-
description:
|
|
313
|
-
'State of the user. Facebook expects the 2-letter abbreviation for US states. For example, "CA" for California, or "NY" for New York.',
|
|
314
|
-
type: 'string'
|
|
315
|
-
},
|
|
316
|
-
zp: {
|
|
317
|
-
label: 'ZIP/Postal Code',
|
|
318
|
-
description:
|
|
319
|
-
'ZIP or postal code of the user. For example, "94025" for Menlo Park, CA, or "10001" for New York City.',
|
|
320
|
-
type: 'string'
|
|
321
|
-
},
|
|
322
|
-
country: {
|
|
323
|
-
label: 'Country',
|
|
324
|
-
description:
|
|
325
|
-
'The country of the user. Facebook expects the 2-letter ISO 3166-1 alpha-2 country code. For example, "US" for the United States, or "GB" for the United Kingdom.',
|
|
326
|
-
type: 'string'
|
|
331
|
+
default: {
|
|
332
|
+
external_id: { '@path': '$.userId' },
|
|
333
|
+
em: { '@path': '$.context.traits.email' },
|
|
334
|
+
ph: { '@path': '$.context.traits.phone' },
|
|
335
|
+
fn: { '@path': '$.context.traits.first_name' },
|
|
336
|
+
ln: { '@path': '$.context.traits.last_name' },
|
|
337
|
+
ge: { '@path': '$.context.traits.gender' },
|
|
338
|
+
db: { '@path': '$.context.traits.birthday' },
|
|
339
|
+
ct: { '@path': '$.context.traits.address.city' },
|
|
340
|
+
st: { '@path': '$.context.traits.address.state' },
|
|
341
|
+
zp: { '@path': '$.context.traits.address.postal_code' },
|
|
342
|
+
country: { '@path': '$.context.traits.address.country' },
|
|
343
|
+
fbp: { '@path': '$.context.traits.fbp' },
|
|
344
|
+
fbc: { '@path': '$.context.traits.fbc' },
|
|
345
|
+
client_ip_address: { '@path': '$.context.traits.client_ip_address' }
|
|
327
346
|
}
|
|
328
|
-
},
|
|
329
|
-
default: {
|
|
330
|
-
external_id: { '@path': '$.userId' },
|
|
331
|
-
em: { '@path': '$.context.traits.email' },
|
|
332
|
-
ph: { '@path': '$.context.traits.phone' },
|
|
333
|
-
fn: { '@path': '$.context.traits.first_name' },
|
|
334
|
-
ln: { '@path': '$.context.traits.last_name' },
|
|
335
|
-
ge: { '@path': '$.context.traits.gender' },
|
|
336
|
-
db: { '@path': '$.context.traits.birthday' },
|
|
337
|
-
ct: { '@path': '$.context.traits.address.city' },
|
|
338
|
-
st: { '@path': '$.context.traits.address.state' },
|
|
339
|
-
zp: { '@path': '$.context.traits.address.postal_code' },
|
|
340
|
-
country: { '@path': '$.context.traits.address.country' }
|
|
341
|
-
}
|
|
342
347
|
}
|
|
343
348
|
|
|
344
349
|
export const AllFields = {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
}
|
|
350
|
+
event_config,
|
|
351
|
+
content_category,
|
|
352
|
+
content_ids,
|
|
353
|
+
content_name,
|
|
354
|
+
content_type,
|
|
355
|
+
contents,
|
|
356
|
+
currency,
|
|
357
|
+
delivery_category,
|
|
358
|
+
num_items,
|
|
359
|
+
predicted_ltv,
|
|
360
|
+
net_revenue,
|
|
361
|
+
search_string,
|
|
362
|
+
status,
|
|
363
|
+
value,
|
|
364
|
+
custom_data,
|
|
365
|
+
eventID,
|
|
366
|
+
eventSourceUrl,
|
|
367
|
+
userData
|
|
368
|
+
}
|