@segment/action-destinations 3.308.0 → 3.309.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/destinations/actions-pardot/index.js +13 -2
- package/dist/destinations/actions-pardot/index.js.map +1 -1
- package/dist/destinations/braze/trackEvent/generated-types.d.ts +1 -0
- package/dist/destinations/braze/trackEvent/index.js +7 -0
- package/dist/destinations/braze/trackEvent/index.js.map +1 -1
- package/dist/destinations/braze/trackPurchase/generated-types.d.ts +1 -0
- package/dist/destinations/braze/trackPurchase/index.js +7 -0
- package/dist/destinations/braze/trackPurchase/index.js.map +1 -1
- package/dist/destinations/braze/updateUserProfile/generated-types.d.ts +1 -0
- package/dist/destinations/braze/updateUserProfile/index.js +7 -0
- package/dist/destinations/braze/updateUserProfile/index.js.map +1 -1
- package/dist/destinations/contentstack/audienceSync/generated-types.d.ts +10 -0
- package/dist/destinations/contentstack/audienceSync/generated-types.js.map +1 -0
- package/dist/destinations/contentstack/audienceSync/index.js +48 -0
- package/dist/destinations/contentstack/audienceSync/index.js.map +1 -0
- package/dist/destinations/contentstack/computedAttributeSync/generated-types.d.ts +10 -0
- package/dist/destinations/contentstack/{types.js → computedAttributeSync/generated-types.js} +1 -1
- package/dist/destinations/contentstack/computedAttributeSync/generated-types.js.map +1 -0
- package/dist/destinations/contentstack/computedAttributeSync/index.d.ts +5 -0
- package/dist/destinations/contentstack/computedAttributeSync/index.js +48 -0
- package/dist/destinations/contentstack/computedAttributeSync/index.js.map +1 -0
- package/dist/destinations/contentstack/generated-types.d.ts +0 -2
- package/dist/destinations/contentstack/index.js +5 -48
- package/dist/destinations/contentstack/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/constants.d.ts +1 -0
- package/dist/destinations/google-enhanced-conversions/constants.js +5 -0
- package/dist/destinations/google-enhanced-conversions/constants.js.map +1 -0
- package/dist/destinations/google-enhanced-conversions/functions.d.ts +1 -0
- package/dist/destinations/google-enhanced-conversions/functions.js +15 -1
- package/dist/destinations/google-enhanced-conversions/functions.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/uploadCallConversion/generated-types.d.ts +2 -0
- package/dist/destinations/google-enhanced-conversions/uploadCallConversion/index.js +62 -0
- package/dist/destinations/google-enhanced-conversions/uploadCallConversion/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/uploadCallConversion2/generated-types.d.ts +2 -0
- package/dist/destinations/google-enhanced-conversions/uploadCallConversion2/index.js +65 -0
- package/dist/destinations/google-enhanced-conversions/uploadCallConversion2/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/generated-types.d.ts +2 -0
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js +95 -0
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion2/generated-types.d.ts +2 -0
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion2/index.js +100 -0
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion2/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/generated-types.d.ts +2 -0
- package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js +96 -0
- package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment2/generated-types.d.ts +2 -0
- package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment2/index.js +99 -0
- package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment2/index.js.map +1 -1
- package/dist/destinations/index.js +2 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/iterable/utils.js +7 -7
- package/dist/destinations/iterable/utils.js.map +1 -1
- package/dist/destinations/nextdoor-capi/generated-types.d.ts +4 -0
- package/dist/destinations/nextdoor-capi/generated-types.js +3 -0
- package/dist/destinations/nextdoor-capi/generated-types.js.map +1 -0
- package/dist/destinations/nextdoor-capi/index.d.ts +4 -0
- package/dist/destinations/nextdoor-capi/index.js +42 -0
- package/dist/destinations/nextdoor-capi/index.js.map +1 -0
- package/dist/destinations/nextdoor-capi/sendConversion/generated-types.d.ts +44 -0
- package/dist/destinations/nextdoor-capi/sendConversion/generated-types.js +3 -0
- package/dist/destinations/nextdoor-capi/sendConversion/generated-types.js.map +1 -0
- package/dist/destinations/nextdoor-capi/sendConversion/index.d.ts +5 -0
- package/dist/destinations/nextdoor-capi/sendConversion/index.js +459 -0
- package/dist/destinations/nextdoor-capi/sendConversion/index.js.map +1 -0
- package/dist/destinations/nextdoor-capi/sendConversion/types.d.ts +34 -0
- package/dist/destinations/nextdoor-capi/sendConversion/types.js.map +1 -0
- package/dist/destinations/nextdoor-capi/sendConversion/utils.d.ts +1 -0
- package/dist/destinations/nextdoor-capi/sendConversion/utils.js +9 -0
- package/dist/destinations/nextdoor-capi/sendConversion/utils.js.map +1 -0
- package/dist/destinations/reddit-conversions-api/customEvent/generated-types.d.ts +35 -0
- package/dist/destinations/reddit-conversions-api/customEvent/generated-types.js +3 -0
- package/dist/destinations/reddit-conversions-api/customEvent/generated-types.js.map +1 -0
- package/dist/destinations/reddit-conversions-api/customEvent/index.d.ts +5 -0
- package/dist/destinations/reddit-conversions-api/customEvent/index.js +27 -0
- package/dist/destinations/reddit-conversions-api/customEvent/index.js.map +1 -0
- package/dist/destinations/reddit-conversions-api/fields.d.ts +11 -0
- package/dist/destinations/reddit-conversions-api/fields.js +502 -0
- package/dist/destinations/reddit-conversions-api/fields.js.map +1 -0
- package/dist/destinations/reddit-conversions-api/generated-types.d.ts +5 -0
- package/dist/destinations/reddit-conversions-api/generated-types.js +3 -0
- package/dist/destinations/reddit-conversions-api/generated-types.js.map +1 -0
- package/dist/destinations/reddit-conversions-api/index.d.ts +4 -0
- package/dist/destinations/reddit-conversions-api/index.js +183 -0
- package/dist/destinations/reddit-conversions-api/index.js.map +1 -0
- package/dist/destinations/reddit-conversions-api/standardEvent/generated-types.d.ts +35 -0
- package/dist/destinations/reddit-conversions-api/standardEvent/generated-types.js +3 -0
- package/dist/destinations/reddit-conversions-api/standardEvent/generated-types.js.map +1 -0
- package/dist/destinations/reddit-conversions-api/standardEvent/index.d.ts +5 -0
- package/dist/destinations/reddit-conversions-api/standardEvent/index.js +27 -0
- package/dist/destinations/reddit-conversions-api/standardEvent/index.js.map +1 -0
- package/dist/destinations/reddit-conversions-api/types.d.ts +56 -0
- package/dist/destinations/reddit-conversions-api/types.js +8 -0
- package/dist/destinations/reddit-conversions-api/types.js.map +1 -0
- package/dist/destinations/reddit-conversions-api/utils.d.ts +5 -0
- package/dist/destinations/reddit-conversions-api/utils.js +120 -0
- package/dist/destinations/reddit-conversions-api/utils.js.map +1 -0
- package/dist/destinations/salesforce/sf-properties.js +1 -1
- package/dist/destinations/salesforce/sf-properties.js.map +1 -1
- package/dist/destinations/schematic/index.js +1 -1
- package/dist/destinations/schematic/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/destinations/contentstack/customAttributesSync/generated-types.d.ts +0 -7
- package/dist/destinations/contentstack/customAttributesSync/generated-types.js.map +0 -1
- package/dist/destinations/contentstack/customAttributesSync/index.js +0 -54
- package/dist/destinations/contentstack/customAttributesSync/index.js.map +0 -1
- package/dist/destinations/contentstack/customAttributesSync/types.d.ts +0 -14
- package/dist/destinations/contentstack/customAttributesSync/types.js.map +0 -1
- package/dist/destinations/contentstack/customAttributesSync/utils.d.ts +0 -4
- package/dist/destinations/contentstack/customAttributesSync/utils.js +0 -20
- package/dist/destinations/contentstack/customAttributesSync/utils.js.map +0 -1
- package/dist/destinations/contentstack/types.d.ts +0 -12
- package/dist/destinations/contentstack/types.js.map +0 -1
- /package/dist/destinations/contentstack/{customAttributesSync → audienceSync}/generated-types.js +0 -0
- /package/dist/destinations/contentstack/{customAttributesSync → audienceSync}/index.d.ts +0 -0
- /package/dist/destinations/{contentstack/customAttributesSync → nextdoor-capi/sendConversion}/types.js +0 -0
|
@@ -0,0 +1,459 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("./utils");
|
|
4
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Send Conversion',
|
|
7
|
+
description: 'Send Conversion Event to Nextdoor',
|
|
8
|
+
fields: {
|
|
9
|
+
event_name: {
|
|
10
|
+
label: 'Event Name',
|
|
11
|
+
description: 'The name of the event to track',
|
|
12
|
+
type: 'string',
|
|
13
|
+
required: true,
|
|
14
|
+
choices: [
|
|
15
|
+
{ label: 'Conversion', value: 'conversion' },
|
|
16
|
+
{ label: 'Custom Conversion 1', value: 'custom_conversion_1' },
|
|
17
|
+
{ label: 'Custom Conversion 2', value: 'custom_conversion_2' },
|
|
18
|
+
{ label: 'Custom Conversion 3', value: 'custom_conversion_3' },
|
|
19
|
+
{ label: 'Custom Conversion 4', value: 'custom_conversion_4' },
|
|
20
|
+
{ label: 'Custom Conversion 5', value: 'custom_conversion_5' },
|
|
21
|
+
{ label: 'Custom Conversion 6', value: 'custom_conversion_6' },
|
|
22
|
+
{ label: 'Custom Conversion 7', value: 'custom_conversion_7' },
|
|
23
|
+
{ label: 'Custom Conversion 8', value: 'custom_conversion_8' },
|
|
24
|
+
{ label: 'Custom Conversion 9', value: 'custom_conversion_9' },
|
|
25
|
+
{ label: 'Custom Conversion 10', value: 'custom_conversion_10' },
|
|
26
|
+
{ label: 'Lead', value: 'lead' },
|
|
27
|
+
{ label: 'Purchase', value: 'purchase' },
|
|
28
|
+
{ label: 'Sign Up', value: 'sign_up' }
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
event_id: {
|
|
32
|
+
label: 'Event ID',
|
|
33
|
+
description: 'A unique ID for the event. This is used to deduplicate events sent by the browser and server.',
|
|
34
|
+
type: 'string',
|
|
35
|
+
required: false
|
|
36
|
+
},
|
|
37
|
+
event_time: {
|
|
38
|
+
label: 'Event Time',
|
|
39
|
+
description: 'UCT Timestamp with ISO 8601 format. For example, 2022-11-23T03:30:52Z',
|
|
40
|
+
type: 'string',
|
|
41
|
+
required: true,
|
|
42
|
+
default: { '@path': '$.timestamp' }
|
|
43
|
+
},
|
|
44
|
+
event_timezone: {
|
|
45
|
+
label: 'Event Time Zone',
|
|
46
|
+
description: 'The timezone of the event. TODO: Add more information about this field.',
|
|
47
|
+
type: 'string',
|
|
48
|
+
required: false
|
|
49
|
+
},
|
|
50
|
+
action_source: {
|
|
51
|
+
label: 'Action Source',
|
|
52
|
+
description: 'Indicates the channel through which conversion happened.',
|
|
53
|
+
type: 'string',
|
|
54
|
+
required: true,
|
|
55
|
+
choices: [
|
|
56
|
+
{ label: 'email', value: 'email' },
|
|
57
|
+
{ label: 'website', value: 'website' },
|
|
58
|
+
{ label: 'app', value: 'app' },
|
|
59
|
+
{ label: 'phone_call', value: 'phone_call' },
|
|
60
|
+
{ label: 'chat', value: 'chat' },
|
|
61
|
+
{ label: 'physical_store', value: 'physical_store' },
|
|
62
|
+
{ label: 'system_generated', value: 'system_generated' },
|
|
63
|
+
{ label: 'other', value: 'custom_conversion_8' }
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
action_source_url: {
|
|
67
|
+
label: 'Action Source url',
|
|
68
|
+
description: 'The browser URL where the event happened (required for web events).',
|
|
69
|
+
type: 'string',
|
|
70
|
+
required: false,
|
|
71
|
+
default: { '@path': '$.context.page.url' }
|
|
72
|
+
},
|
|
73
|
+
delivery_optimization: {
|
|
74
|
+
label: 'Delivery Optimization',
|
|
75
|
+
description: 'True indicates data can be used for optimization. False indicates the data will only be used for attribution',
|
|
76
|
+
type: 'boolean',
|
|
77
|
+
required: true,
|
|
78
|
+
default: true
|
|
79
|
+
},
|
|
80
|
+
test_event: {
|
|
81
|
+
label: 'Test Event',
|
|
82
|
+
description: 'Flag to indicate if this is a test event.',
|
|
83
|
+
type: 'boolean',
|
|
84
|
+
required: true,
|
|
85
|
+
default: false
|
|
86
|
+
},
|
|
87
|
+
partner_id: {
|
|
88
|
+
label: 'Partner Id',
|
|
89
|
+
description: 'ID of partners like Segment',
|
|
90
|
+
unsafe_hidden: true,
|
|
91
|
+
type: 'string',
|
|
92
|
+
required: true,
|
|
93
|
+
choices: [{ label: 'Segment', value: 'segment' }],
|
|
94
|
+
default: 'segment'
|
|
95
|
+
},
|
|
96
|
+
customer: {
|
|
97
|
+
label: 'Customer Data',
|
|
98
|
+
description: 'Customer profile data used to match with Nextdoor users. At least one of the fields is required.',
|
|
99
|
+
type: 'object',
|
|
100
|
+
defaultObjectUI: 'keyvalue',
|
|
101
|
+
additionalProperties: false,
|
|
102
|
+
required: true,
|
|
103
|
+
properties: {
|
|
104
|
+
email: {
|
|
105
|
+
label: 'Email',
|
|
106
|
+
description: 'Customer email address',
|
|
107
|
+
type: 'string',
|
|
108
|
+
required: false
|
|
109
|
+
},
|
|
110
|
+
phone_number: {
|
|
111
|
+
label: 'Phone Number',
|
|
112
|
+
description: 'Phone number format should consist of exactly ten digits, devoid of any special characters or international country codes e.g. 4129614932',
|
|
113
|
+
type: 'string',
|
|
114
|
+
required: false
|
|
115
|
+
},
|
|
116
|
+
first_name: {
|
|
117
|
+
label: 'First Name',
|
|
118
|
+
description: 'Customer first name.',
|
|
119
|
+
type: 'string',
|
|
120
|
+
required: false
|
|
121
|
+
},
|
|
122
|
+
last_name: {
|
|
123
|
+
label: 'Last Name',
|
|
124
|
+
description: 'Customer last name.',
|
|
125
|
+
type: 'string',
|
|
126
|
+
required: false
|
|
127
|
+
},
|
|
128
|
+
date_of_birth: {
|
|
129
|
+
label: 'Date of Birth',
|
|
130
|
+
description: 'Customer date of birth in ISO 8601 format. For example, 1990-01-01',
|
|
131
|
+
type: 'string',
|
|
132
|
+
required: false
|
|
133
|
+
},
|
|
134
|
+
street_address: {
|
|
135
|
+
label: 'Street Address',
|
|
136
|
+
description: 'Customer street address.',
|
|
137
|
+
type: 'string',
|
|
138
|
+
required: false
|
|
139
|
+
},
|
|
140
|
+
city: {
|
|
141
|
+
label: 'City',
|
|
142
|
+
description: 'Customer city.',
|
|
143
|
+
type: 'string',
|
|
144
|
+
required: false
|
|
145
|
+
},
|
|
146
|
+
state: {
|
|
147
|
+
label: 'State',
|
|
148
|
+
description: 'Customer State.',
|
|
149
|
+
type: 'string',
|
|
150
|
+
required: false
|
|
151
|
+
},
|
|
152
|
+
country: {
|
|
153
|
+
label: 'Customer Country',
|
|
154
|
+
description: 'Customer Customer country code (2-letter country codes in ISO 3166-1 alpha-2).',
|
|
155
|
+
type: 'string',
|
|
156
|
+
required: false
|
|
157
|
+
},
|
|
158
|
+
zip_code: {
|
|
159
|
+
label: 'Zip Code',
|
|
160
|
+
description: 'Customer Zip code.',
|
|
161
|
+
type: 'string',
|
|
162
|
+
required: false
|
|
163
|
+
},
|
|
164
|
+
pixel_id: {
|
|
165
|
+
label: 'Nextdoor Pixel Id',
|
|
166
|
+
description: 'Nextdoor Pixel Id. Used for deduplication when events are sent via CAPI and front end Pixel.',
|
|
167
|
+
type: 'string',
|
|
168
|
+
required: false
|
|
169
|
+
},
|
|
170
|
+
click_id: {
|
|
171
|
+
label: 'Nextdoor Click ID',
|
|
172
|
+
description: 'Next Door Click ID - ndclid parameter from the URL',
|
|
173
|
+
type: 'string',
|
|
174
|
+
required: false
|
|
175
|
+
},
|
|
176
|
+
client_ip_address: {
|
|
177
|
+
label: 'Customer IP Address',
|
|
178
|
+
description: 'Customer IP Address Must be a valid IPV4 or IPV6 address.',
|
|
179
|
+
type: 'string',
|
|
180
|
+
required: false
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
default: {
|
|
184
|
+
email: {
|
|
185
|
+
'@if': {
|
|
186
|
+
exists: { '@path': '$.context.traits.email' },
|
|
187
|
+
then: { '@path': '$.context.traits.email' },
|
|
188
|
+
else: { '@path': '$.properties.email' }
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
phone_number: {
|
|
192
|
+
'@if': {
|
|
193
|
+
exists: { '@path': '$.context.traits.phone' },
|
|
194
|
+
then: { '@path': '$.context.traits.phone' },
|
|
195
|
+
else: { '@path': '$.properties.phone' }
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
first_name: {
|
|
199
|
+
'@if': {
|
|
200
|
+
exists: { '@path': '$.context.traits.first_name' },
|
|
201
|
+
then: { '@path': '$.context.traits.first_name' },
|
|
202
|
+
else: { '@path': '$.properties.first_name' }
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
last_name: {
|
|
206
|
+
'@if': {
|
|
207
|
+
exists: { '@path': '$.context.traits.last_name' },
|
|
208
|
+
then: { '@path': '$.context.traits.last_name' },
|
|
209
|
+
else: { '@path': '$.properties.last_name' }
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
date_of_birth: {
|
|
213
|
+
'@if': {
|
|
214
|
+
exists: { '@path': '$.context.traits.birthday' },
|
|
215
|
+
then: { '@path': '$.context.traits.birthday' },
|
|
216
|
+
else: { '@path': '$.properties.birthday' }
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
street_address: {
|
|
220
|
+
'@if': {
|
|
221
|
+
exists: { '@path': '$.context.traits.address.street' },
|
|
222
|
+
then: { '@path': '$.context.traits.address.street' },
|
|
223
|
+
else: { '@path': '$.properties.address.street' }
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
city: {
|
|
227
|
+
'@if': {
|
|
228
|
+
exists: { '@path': '$.context.traits.address.city' },
|
|
229
|
+
then: { '@path': '$.context.traits.address.city' },
|
|
230
|
+
else: { '@path': '$.properties.address.city' }
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
state: {
|
|
234
|
+
'@if': {
|
|
235
|
+
exists: { '@path': '$.context.traits.address.state' },
|
|
236
|
+
then: { '@path': '$.context.traits.address.state' },
|
|
237
|
+
else: { '@path': '$.properties.address.state' }
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
country: {
|
|
241
|
+
'@if': {
|
|
242
|
+
exists: { '@path': '$.context.traits.address.country' },
|
|
243
|
+
then: { '@path': '$.context.traits.address.country' },
|
|
244
|
+
else: { '@path': '$.properties.address.country' }
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
zip_code: {
|
|
248
|
+
'@if': {
|
|
249
|
+
exists: { '@path': '$.context.traits.address.postal_code' },
|
|
250
|
+
then: { '@path': '$.context.traits.address.postal_code' },
|
|
251
|
+
else: { '@path': '$.properties.address.postal_code' }
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
pixel_id: {
|
|
255
|
+
'@if': {
|
|
256
|
+
exists: { '@path': '$.context.traits.pixel_id' },
|
|
257
|
+
then: { '@path': '$.context.traits.pixel_id' },
|
|
258
|
+
else: { '@path': '$.properties.pixel_id' }
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
click_id: {
|
|
262
|
+
'@if': {
|
|
263
|
+
exists: { '@path': '$.context.integrations.Nextdoor Conversions API.traits.click_id' },
|
|
264
|
+
then: { '@path': '$.context.integrations.Nextdoor Conversions API.traits.click_id' },
|
|
265
|
+
else: { '@path': '$.properties.click_id' }
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
client_ip_address: { '@path': '$.context.ip' }
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
custom: {
|
|
272
|
+
label: 'Custom Data',
|
|
273
|
+
description: 'Custom objects contains fields specific to advertisers that are not already covered in standard fields.',
|
|
274
|
+
type: 'object',
|
|
275
|
+
defaultObjectUI: 'keyvalue',
|
|
276
|
+
required: false,
|
|
277
|
+
properties: {
|
|
278
|
+
order_value: {
|
|
279
|
+
label: 'Order Value',
|
|
280
|
+
description: 'Required for purchase events. Total numeric value associated with the event. E.g. 99.99 denotes $99.99 USD. Currency is specified in the Currency field.',
|
|
281
|
+
type: 'number',
|
|
282
|
+
required: false
|
|
283
|
+
},
|
|
284
|
+
currency: {
|
|
285
|
+
label: 'Currency',
|
|
286
|
+
description: 'Currency of the order value. Use the 3-letter currency code from ISO 4217 standard.',
|
|
287
|
+
type: 'string',
|
|
288
|
+
required: false
|
|
289
|
+
},
|
|
290
|
+
order_id: {
|
|
291
|
+
label: 'Order ID',
|
|
292
|
+
description: 'The order ID for this transaction. Required for offline events.',
|
|
293
|
+
type: 'string',
|
|
294
|
+
required: false
|
|
295
|
+
},
|
|
296
|
+
delivery_category: {
|
|
297
|
+
label: 'Delivery Category',
|
|
298
|
+
description: 'How a product is delivered',
|
|
299
|
+
type: 'string',
|
|
300
|
+
required: true,
|
|
301
|
+
choices: [
|
|
302
|
+
{ label: 'Not specified', value: 'not_specified' },
|
|
303
|
+
{ label: 'In store', value: 'in_store' },
|
|
304
|
+
{ label: 'Curbside', value: 'curbside' },
|
|
305
|
+
{ label: 'Home Delivery', value: 'home_delivery' }
|
|
306
|
+
]
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
default: {
|
|
310
|
+
order_value: { '@path': '$.properties.total' },
|
|
311
|
+
currency: { '@path': '$.properties.currency' },
|
|
312
|
+
order_id: { '@path': '$.properties.order_id' },
|
|
313
|
+
delivery_category: 'not_specified'
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
product_context: {
|
|
317
|
+
label: 'Product Context',
|
|
318
|
+
description: 'Product details associated with the event.',
|
|
319
|
+
type: 'object',
|
|
320
|
+
multiple: true,
|
|
321
|
+
required: false,
|
|
322
|
+
additionalProperties: true,
|
|
323
|
+
properties: {
|
|
324
|
+
id: {
|
|
325
|
+
label: 'Product ID',
|
|
326
|
+
description: 'Product ID',
|
|
327
|
+
type: 'string',
|
|
328
|
+
required: true
|
|
329
|
+
},
|
|
330
|
+
quantity: {
|
|
331
|
+
label: 'Product Quantity',
|
|
332
|
+
description: 'Product Quantity',
|
|
333
|
+
type: 'number',
|
|
334
|
+
required: false
|
|
335
|
+
},
|
|
336
|
+
item_price: {
|
|
337
|
+
label: 'Product Price',
|
|
338
|
+
description: 'Product Price',
|
|
339
|
+
type: 'number',
|
|
340
|
+
required: false
|
|
341
|
+
}
|
|
342
|
+
},
|
|
343
|
+
default: {
|
|
344
|
+
'@arrayPath': [
|
|
345
|
+
'$.properties.products',
|
|
346
|
+
{
|
|
347
|
+
id: {
|
|
348
|
+
'@path': '$.product_id'
|
|
349
|
+
},
|
|
350
|
+
quantity: {
|
|
351
|
+
'@path': '$.quantity'
|
|
352
|
+
},
|
|
353
|
+
item_price: {
|
|
354
|
+
'@path': '$.price'
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
]
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
app: {
|
|
361
|
+
label: 'Mobile App Event Parameters',
|
|
362
|
+
description: 'Data about the source Mobile app. Required for app events',
|
|
363
|
+
type: 'object',
|
|
364
|
+
defaultObjectUI: 'keyvalue',
|
|
365
|
+
required: false,
|
|
366
|
+
properties: {
|
|
367
|
+
app_id: {
|
|
368
|
+
label: 'App Id',
|
|
369
|
+
description: 'A unique ID for advertisers mobile app ID from App store and Google Play Store.',
|
|
370
|
+
type: 'string',
|
|
371
|
+
required: false
|
|
372
|
+
},
|
|
373
|
+
app_tracking_enabled: {
|
|
374
|
+
label: 'App Tracking Enabled',
|
|
375
|
+
description: 'Users opt out settings for ATT',
|
|
376
|
+
type: 'boolean',
|
|
377
|
+
required: false
|
|
378
|
+
},
|
|
379
|
+
platform: {
|
|
380
|
+
label: 'App Platfrom',
|
|
381
|
+
description: 'Mobile app platform',
|
|
382
|
+
type: 'string',
|
|
383
|
+
required: false,
|
|
384
|
+
choices: [
|
|
385
|
+
{ label: 'iOS', value: 'ios' },
|
|
386
|
+
{ label: 'Android', value: 'android' }
|
|
387
|
+
]
|
|
388
|
+
},
|
|
389
|
+
app_version: {
|
|
390
|
+
label: 'App Version',
|
|
391
|
+
description: 'Mobile app version',
|
|
392
|
+
type: 'string',
|
|
393
|
+
required: false
|
|
394
|
+
}
|
|
395
|
+
},
|
|
396
|
+
default: {
|
|
397
|
+
app_id: { '@path': '$.context.app.name' },
|
|
398
|
+
app_tracking_enabled: { '@path': '$.context.device.adTrackingEnabled' },
|
|
399
|
+
platform: { '@path': '$.context.app.type' },
|
|
400
|
+
app_version: { '@path': '$.context.app.version' }
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
},
|
|
404
|
+
perform: (request, { settings, payload }) => {
|
|
405
|
+
const apiKey = settings.apiKey;
|
|
406
|
+
const hashFields = actions_core_1.omit(payload.customer, ['click_id', 'pixel_id']);
|
|
407
|
+
for (const [key, value] of Object.entries(hashFields)) {
|
|
408
|
+
hashFields[key] = utils_1.hashAndEncode(value);
|
|
409
|
+
}
|
|
410
|
+
const custom = {
|
|
411
|
+
order_value: payload.custom?.order_value && payload.custom?.currency
|
|
412
|
+
? `${payload.custom.currency}${payload.custom.order_value}`
|
|
413
|
+
: undefined,
|
|
414
|
+
order_id: payload.custom?.order_id ?? undefined,
|
|
415
|
+
delivery_category: payload.custom?.delivery_category === 'not_specified' ? undefined : payload.custom?.delivery_category,
|
|
416
|
+
product_context: payload.product_context?.map((product) => ({
|
|
417
|
+
id: product.id ?? undefined,
|
|
418
|
+
item_price: typeof product.item_price === 'number' ? product.item_price : undefined,
|
|
419
|
+
quantity: product?.quantity
|
|
420
|
+
}))
|
|
421
|
+
};
|
|
422
|
+
const app = {
|
|
423
|
+
app_id: payload.app?.app_id ?? undefined,
|
|
424
|
+
app_tracking_enabled: payload.app?.app_tracking_enabled ?? undefined,
|
|
425
|
+
platform: payload.app?.platform ?? undefined,
|
|
426
|
+
app_version: payload.app?.app_version ?? undefined
|
|
427
|
+
};
|
|
428
|
+
const ndPayload = {
|
|
429
|
+
event_name: payload.event_name,
|
|
430
|
+
event_id: payload.event_id,
|
|
431
|
+
event_time: payload.event_time,
|
|
432
|
+
action_source: payload.action_source,
|
|
433
|
+
client_id: settings.client_id,
|
|
434
|
+
action_source_url: payload.action_source_url,
|
|
435
|
+
delivery_optimization: payload.delivery_optimization,
|
|
436
|
+
event_timezone: payload.event_timezone,
|
|
437
|
+
customer: {
|
|
438
|
+
click_id: payload.customer?.click_id ? payload.customer.click_id : undefined,
|
|
439
|
+
pixel_id: payload.customer?.pixel_id ? payload.customer.pixel_id : undefined,
|
|
440
|
+
...hashFields
|
|
441
|
+
},
|
|
442
|
+
custom,
|
|
443
|
+
app,
|
|
444
|
+
test_event: String(payload.test_event),
|
|
445
|
+
partner_id: payload.partner_id
|
|
446
|
+
};
|
|
447
|
+
return request('https://ads.nextdoor.com/v2/api/conversions/track', {
|
|
448
|
+
method: 'post',
|
|
449
|
+
headers: {
|
|
450
|
+
'Content-Type': 'application/json',
|
|
451
|
+
Accept: 'application/json',
|
|
452
|
+
Authorization: `Bearer ${apiKey}`
|
|
453
|
+
},
|
|
454
|
+
json: JSON.parse(JSON.stringify(ndPayload))
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
exports.default = action;
|
|
459
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/nextdoor-capi/sendConversion/index.ts"],"names":[],"mappings":";;AAGA,mCAAuC;AACvC,wDAA4C;AAG5C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,mCAAmC;IAChD,MAAM,EAAE;QACN,UAAU,EAAE;YACV,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,gCAAgC;YAC7C,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE;gBAC5C,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAE,qBAAqB,EAAE;gBAC9D,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAE,qBAAqB,EAAE;gBAC9D,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAE,qBAAqB,EAAE;gBAC9D,EAAE,KAAK,EAAE,qBAA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I,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;SAC5C,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface NDPayload {
|
|
2
|
+
event_name: string;
|
|
3
|
+
event_id?: string;
|
|
4
|
+
event_time: string;
|
|
5
|
+
action_source: string;
|
|
6
|
+
client_id: string;
|
|
7
|
+
action_source_url?: string;
|
|
8
|
+
delivery_optimization: boolean;
|
|
9
|
+
event_timezone?: string;
|
|
10
|
+
customer: {
|
|
11
|
+
[k: string]: string | undefined;
|
|
12
|
+
};
|
|
13
|
+
custom: Custom;
|
|
14
|
+
app: App;
|
|
15
|
+
test_event: string;
|
|
16
|
+
partner_id: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ProductContextItem {
|
|
19
|
+
id: string;
|
|
20
|
+
item_price?: number;
|
|
21
|
+
quantity?: number;
|
|
22
|
+
}
|
|
23
|
+
export interface Custom {
|
|
24
|
+
order_value?: string;
|
|
25
|
+
order_id?: string;
|
|
26
|
+
delivery_category?: string;
|
|
27
|
+
product_context?: Array<ProductContextItem>;
|
|
28
|
+
}
|
|
29
|
+
export interface App {
|
|
30
|
+
app_id?: string;
|
|
31
|
+
app_tracking_enabled?: boolean;
|
|
32
|
+
platform?: string;
|
|
33
|
+
app_version?: string;
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/destinations/nextdoor-capi/sendConversion/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function hashAndEncode(value: string): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hashAndEncode = void 0;
|
|
4
|
+
const crypto_1 = require("crypto");
|
|
5
|
+
function hashAndEncode(value) {
|
|
6
|
+
return crypto_1.createHash('sha256').update(value).digest('hex');
|
|
7
|
+
}
|
|
8
|
+
exports.hashAndEncode = hashAndEncode;
|
|
9
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/destinations/nextdoor-capi/sendConversion/utils.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AAEnC,SAAgB,aAAa,CAAC,KAAa;IACzC,OAAO,mBAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AACzD,CAAC;AAFD,sCAEC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
event_at: string | number;
|
|
3
|
+
custom_event_name: string;
|
|
4
|
+
click_id?: string;
|
|
5
|
+
products?: {
|
|
6
|
+
category: string;
|
|
7
|
+
id: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
}[];
|
|
10
|
+
user?: {
|
|
11
|
+
advertising_id?: string;
|
|
12
|
+
device_type?: string;
|
|
13
|
+
email?: string;
|
|
14
|
+
external_id?: string;
|
|
15
|
+
ip_address?: string;
|
|
16
|
+
opt_out?: boolean;
|
|
17
|
+
user_agent?: string;
|
|
18
|
+
uuid?: string;
|
|
19
|
+
};
|
|
20
|
+
data_processing_options?: {
|
|
21
|
+
country?: string;
|
|
22
|
+
modes?: string;
|
|
23
|
+
region?: string;
|
|
24
|
+
};
|
|
25
|
+
screen_dimensions?: {
|
|
26
|
+
height?: number;
|
|
27
|
+
width?: number;
|
|
28
|
+
};
|
|
29
|
+
event_metadata?: {
|
|
30
|
+
currency?: string;
|
|
31
|
+
item_count?: number;
|
|
32
|
+
value_decimal?: number;
|
|
33
|
+
};
|
|
34
|
+
conversion_id?: string;
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/reddit-conversions-api/customEvent/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("../utils");
|
|
4
|
+
const fields_1 = require("../fields");
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Send Custom Event',
|
|
7
|
+
description: 'Send a Custom Conversion Event to Reddit',
|
|
8
|
+
fields: {
|
|
9
|
+
event_at: fields_1.event_at,
|
|
10
|
+
custom_event_name: fields_1.custom_event_name,
|
|
11
|
+
click_id: fields_1.click_id,
|
|
12
|
+
products: fields_1.products,
|
|
13
|
+
user: fields_1.user,
|
|
14
|
+
data_processing_options: fields_1.data_processing_options,
|
|
15
|
+
screen_dimensions: fields_1.screen_dimensions,
|
|
16
|
+
event_metadata: fields_1.event_metadata,
|
|
17
|
+
conversion_id: fields_1.conversion_id
|
|
18
|
+
},
|
|
19
|
+
perform: async (request, { settings, payload }) => {
|
|
20
|
+
return await utils_1.send(request, settings, [payload]);
|
|
21
|
+
},
|
|
22
|
+
performBatch: async (request, { settings, payload }) => {
|
|
23
|
+
return await utils_1.send(request, settings, payload);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
exports.default = action;
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/reddit-conversions-api/customEvent/index.ts"],"names":[],"mappings":";;AAGA,oCAA+B;AAC/B,sCAUkB;AAElB,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EAAE,0CAA0C;IACvD,MAAM,EAAE;QACN,QAAQ,EAAR,iBAAQ;QACR,iBAAiB,EAAjB,0BAAiB;QACjB,QAAQ,EAAR,iBAAQ;QACR,QAAQ,EAAR,iBAAQ;QACR,IAAI,EAAJ,aAAI;QACJ,uBAAuB,EAAvB,gCAAuB;QACvB,iBAAiB,EAAjB,0BAAiB;QACjB,cAAc,EAAd,uBAAc;QACd,aAAa,EAAb,sBAAa;KACd;IACD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QAChD,OAAO,MAAM,YAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAA;IACjD,CAAC;IACD,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QACrD,OAAO,MAAM,YAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;IAC/C,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { InputField } from '@segment/actions-core/destination-kit/types';
|
|
2
|
+
export declare const event_at: InputField;
|
|
3
|
+
export declare const custom_event_name: InputField;
|
|
4
|
+
export declare const tracking_type: InputField;
|
|
5
|
+
export declare const click_id: InputField;
|
|
6
|
+
export declare const conversion_id: InputField;
|
|
7
|
+
export declare const event_metadata: InputField;
|
|
8
|
+
export declare const products: InputField;
|
|
9
|
+
export declare const user: InputField;
|
|
10
|
+
export declare const data_processing_options: InputField;
|
|
11
|
+
export declare const screen_dimensions: InputField;
|