@segment/action-destinations 3.331.7-staging → 3.331.7-staging.1
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/absmartly/segment.d.ts +11 -0
- package/dist/destinations/absmartly/segment.js +3 -0
- package/dist/destinations/absmartly/segment.js.map +1 -0
- package/dist/destinations/blackbaud-raisers-edge-nxt/utils/index.d.ts +1 -1
- package/dist/destinations/braze/updateUserProfile/__snapshots__/__snapshots__/snapshot.test.js.snap +208 -0
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.d.ts +1 -0
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js +184 -0
- package/dist/destinations/braze/updateUserProfile/__snapshots__/snapshot.test.js.map +1 -0
- package/dist/destinations/display-video-360/addToAudience/generated-types.d.ts +1 -1
- package/dist/destinations/display-video-360/addToAudience/index.js +2 -3
- package/dist/destinations/display-video-360/addToAudience/index.js.map +1 -1
- package/dist/destinations/display-video-360/index.js +3 -3
- package/dist/destinations/display-video-360/index.js.map +1 -1
- package/dist/destinations/display-video-360/properties.d.ts +1 -1
- package/dist/destinations/display-video-360/properties.js +17 -14
- package/dist/destinations/display-video-360/properties.js.map +1 -1
- package/dist/destinations/display-video-360/removeFromAudience/generated-types.d.ts +1 -1
- package/dist/destinations/display-video-360/removeFromAudience/index.js +2 -3
- package/dist/destinations/display-video-360/removeFromAudience/index.js.map +1 -1
- package/dist/destinations/display-video-360/shared.js +3 -3
- package/dist/destinations/display-video-360/shared.js.map +1 -1
- package/dist/destinations/engage/twilio/sendSms/SmsMessageSender.js +3 -0
- package/dist/destinations/engage/twilio/sendSms/SmsMessageSender.js.map +1 -1
- package/dist/destinations/gleap/generated-types.d.ts +3 -0
- package/dist/destinations/gleap/generated-types.js +3 -0
- package/dist/destinations/gleap/generated-types.js.map +1 -0
- package/dist/destinations/gleap/identifyContact/generated-types.d.ts +18 -0
- package/dist/destinations/gleap/identifyContact/generated-types.js +3 -0
- package/dist/destinations/gleap/identifyContact/generated-types.js.map +1 -0
- package/dist/destinations/gleap/identifyContact/index.d.ts +5 -0
- package/dist/destinations/gleap/identifyContact/index.js +155 -0
- package/dist/destinations/gleap/identifyContact/index.js.map +1 -0
- package/dist/destinations/gleap/index.d.ts +4 -0
- package/dist/destinations/gleap/index.js +52 -0
- package/dist/destinations/gleap/index.js.map +1 -0
- package/dist/destinations/gleap/trackEvent/generated-types.d.ts +10 -0
- package/dist/destinations/gleap/trackEvent/generated-types.js +3 -0
- package/dist/destinations/gleap/trackEvent/generated-types.js.map +1 -0
- package/dist/destinations/gleap/trackEvent/index.d.ts +5 -0
- package/dist/destinations/gleap/trackEvent/index.js +111 -0
- package/dist/destinations/gleap/trackEvent/index.js.map +1 -0
- package/dist/destinations/klaviyo/addProfileToList/generated-types.d.ts +2 -1
- package/dist/destinations/klaviyo/addProfileToList/index.js +7 -0
- package/dist/destinations/klaviyo/addProfileToList/index.js.map +1 -1
- package/dist/destinations/klaviyo/functions.d.ts +8 -0
- package/dist/destinations/klaviyo/functions.js +34 -1
- package/dist/destinations/klaviyo/functions.js.map +1 -1
- package/dist/destinations/klaviyo/properties.d.ts +2 -1
- package/dist/destinations/klaviyo/properties.js +8 -3
- package/dist/destinations/klaviyo/properties.js.map +1 -1
- package/dist/destinations/klaviyo/removeProfileFromList/generated-types.d.ts +1 -1
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.d.ts +4 -0
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js +3 -0
- package/dist/destinations/klaviyo/removeProfileToList/generated-types.js.map +1 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.d.ts +5 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.js +41 -0
- package/dist/destinations/klaviyo/removeProfileToList/index.js.map +1 -0
- package/dist/destinations/klaviyo/upsertProfile/generated-types.d.ts +1 -0
- package/dist/destinations/klaviyo/upsertProfile/index.js +26 -1
- package/dist/destinations/klaviyo/upsertProfile/index.js.map +1 -1
- package/dist/destinations/linkedin-conversions/api/index.d.ts +1 -1
- package/dist/destinations/linkedin-conversions/api/index.js +1 -1
- package/dist/destinations/linkedin-conversions/streamConversion/index.js +1 -1
- package/dist/destinations/linkedin-conversions/streamConversion/index.js.map +1 -1
- package/dist/destinations/mixpanel/utils.d.ts +13 -0
- package/dist/destinations/mixpanel/utils.js +117 -0
- package/dist/destinations/mixpanel/utils.js.map +1 -0
- package/dist/destinations/tiktok-audiences/properties.js +5 -4
- package/dist/destinations/tiktok-audiences/properties.js.map +1 -1
- package/dist/destinations/tiktok-conversions/index.js +92 -3
- package/dist/destinations/tiktok-conversions/index.js.map +1 -1
- package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.d.ts +3 -3
- package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.js +33 -24
- package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.js.map +1 -1
- package/dist/destinations/tiktok-conversions/reportWebEvent/generated-types.d.ts +12 -4
- package/dist/destinations/tiktok-conversions/reportWebEvent/index.js +113 -40
- package/dist/destinations/tiktok-conversions/reportWebEvent/index.js.map +1 -1
- package/dist/destinations/tiktok-offline-conversions/index.js +199 -48
- package/dist/destinations/tiktok-offline-conversions/index.js.map +1 -1
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.d.ts +3 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.js +43 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.js.map +1 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.d.ts +33 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.js +3 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.js.map +1 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.d.ts +5 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.js +317 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.js.map +1 -0
- package/dist/destinations/trackey/identifyUser/generated-types.d.ts +8 -0
- package/dist/destinations/trackey/identifyUser/generated-types.js +3 -0
- package/dist/destinations/trackey/identifyUser/generated-types.js.map +1 -0
- package/dist/destinations/trackey/identifyUser/index.d.ts +5 -0
- package/dist/destinations/trackey/identifyUser/index.js +52 -0
- package/dist/destinations/trackey/identifyUser/index.js.map +1 -0
- package/dist/destinations/trackey/identifyUser.types.d.ts +8 -0
- package/dist/destinations/trackey/identifyUser.types.js +3 -0
- package/dist/destinations/trackey/identifyUser.types.js.map +1 -0
- package/dist/destinations/trackey/registerCompany/generated-types.d.ts +9 -0
- package/dist/destinations/trackey/registerCompany/generated-types.js +3 -0
- package/dist/destinations/trackey/registerCompany/generated-types.js.map +1 -0
- package/dist/destinations/trackey/registerCompany/index.d.ts +5 -0
- package/dist/destinations/trackey/registerCompany/index.js +60 -0
- package/dist/destinations/trackey/registerCompany/index.js.map +1 -0
- package/dist/destinations/trackey/registerCompany.types.d.ts +9 -0
- package/dist/destinations/trackey/registerCompany.types.js +3 -0
- package/dist/destinations/trackey/registerCompany.types.js.map +1 -0
- package/dist/destinations/trackey/trackEvent/generated-types.d.ts +12 -0
- package/dist/destinations/trackey/trackEvent/generated-types.js +3 -0
- package/dist/destinations/trackey/trackEvent/generated-types.js.map +1 -0
- package/dist/destinations/trackey/trackEvent/index.d.ts +5 -0
- package/dist/destinations/trackey/trackEvent/index.js +68 -0
- package/dist/destinations/trackey/trackEvent/index.js.map +1 -0
- package/dist/destinations/trackey/trackEvent.types.d.ts +12 -0
- package/dist/destinations/trackey/trackEvent.types.js +3 -0
- package/dist/destinations/trackey/trackEvent.types.js.map +1 -0
- package/package.json +1 -1
- package/dist/destinations/display-video-360/listManagement.d.ts +0 -9
- package/dist/destinations/display-video-360/listManagement.js +0 -16
- package/dist/destinations/display-video-360/listManagement.js.map +0 -1
|
@@ -2,11 +2,13 @@ export interface Payload {
|
|
|
2
2
|
event: string;
|
|
3
3
|
event_id?: string;
|
|
4
4
|
timestamp?: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
phone_numbers?: string[];
|
|
6
|
+
emails?: string[];
|
|
7
|
+
external_ids?: string[];
|
|
8
8
|
ttclid?: string;
|
|
9
|
+
ttp?: string;
|
|
9
10
|
lead_id?: string;
|
|
11
|
+
locale?: string;
|
|
10
12
|
url?: string;
|
|
11
13
|
referrer?: string;
|
|
12
14
|
ip?: string;
|
|
@@ -14,12 +16,18 @@ export interface Payload {
|
|
|
14
16
|
contents?: {
|
|
15
17
|
price?: number;
|
|
16
18
|
quantity?: number;
|
|
17
|
-
|
|
19
|
+
content_category?: string;
|
|
18
20
|
content_id?: string;
|
|
21
|
+
content_name?: string;
|
|
22
|
+
brand?: string;
|
|
19
23
|
}[];
|
|
24
|
+
content_type?: string;
|
|
20
25
|
currency?: string;
|
|
21
26
|
value?: number;
|
|
22
27
|
description?: string;
|
|
23
28
|
query?: string;
|
|
29
|
+
order_id?: string;
|
|
30
|
+
shop_id?: string;
|
|
31
|
+
limited_data_use?: boolean;
|
|
24
32
|
test_event_code?: string;
|
|
25
33
|
}
|
|
@@ -27,10 +27,11 @@ const action = {
|
|
|
27
27
|
'@path': '$.timestamp'
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
|
-
|
|
30
|
+
phone_numbers: {
|
|
31
31
|
label: 'Phone Number',
|
|
32
32
|
description: 'Phone number of the user who triggered the conversion event, in E.164 standard format, e.g. +14150000000. Segment will hash this value before sending to TikTok.',
|
|
33
33
|
type: 'string',
|
|
34
|
+
multiple: true,
|
|
34
35
|
default: {
|
|
35
36
|
'@if': {
|
|
36
37
|
exists: { '@path': '$.properties.phone' },
|
|
@@ -39,11 +40,12 @@ const action = {
|
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
},
|
|
42
|
-
|
|
43
|
+
emails: {
|
|
43
44
|
label: 'Email',
|
|
44
45
|
description: 'Email address of the user who triggered the conversion event. Segment will hash this value before sending to TikTok.',
|
|
45
46
|
type: 'string',
|
|
46
47
|
format: 'email',
|
|
48
|
+
multiple: true,
|
|
47
49
|
default: {
|
|
48
50
|
'@if': {
|
|
49
51
|
exists: { '@path': '$.properties.email' },
|
|
@@ -52,10 +54,11 @@ const action = {
|
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
56
|
},
|
|
55
|
-
|
|
57
|
+
external_ids: {
|
|
56
58
|
label: 'External ID',
|
|
57
59
|
description: 'Uniquely identifies the user who triggered the conversion event. Segment will hash this value before sending to TikTok.',
|
|
58
60
|
type: 'string',
|
|
61
|
+
multiple: true,
|
|
59
62
|
default: {
|
|
60
63
|
'@if': {
|
|
61
64
|
exists: { '@path': '$.userId' },
|
|
@@ -76,6 +79,18 @@ const action = {
|
|
|
76
79
|
}
|
|
77
80
|
}
|
|
78
81
|
},
|
|
82
|
+
ttp: {
|
|
83
|
+
label: 'TikTok Cookie ID',
|
|
84
|
+
description: 'TikTok Cookie ID. If you also use Pixel SDK and have enabled cookies, Pixel SDK automatically saves a unique identifier in the `_ttp` cookie. The value of `_ttp` is used to match website visitor events with TikTok ads. You can extract the value of `_ttp` and attach the value here. To learn more about the `ttp` parameter, refer to [Events API 2.0 - Send TikTok Cookie](https://ads.tiktok.com/marketing_api/docs?id=%201771100936446977) (`_ttp`).',
|
|
85
|
+
type: 'string',
|
|
86
|
+
default: {
|
|
87
|
+
'@if': {
|
|
88
|
+
exists: { '@path': '$.properties.ttp' },
|
|
89
|
+
then: { '@path': '$.properties.ttp' },
|
|
90
|
+
else: { '@path': '$.integrations.TikTok Pixel.ttp' }
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
},
|
|
79
94
|
lead_id: {
|
|
80
95
|
label: 'TikTok Lead ID',
|
|
81
96
|
description: 'ID of TikTok leads. Every lead will have its own lead_id when exported from TikTok. This feature is in Beta. Please contact your TikTok representative to inquire regarding availability',
|
|
@@ -88,6 +103,14 @@ const action = {
|
|
|
88
103
|
}
|
|
89
104
|
}
|
|
90
105
|
},
|
|
106
|
+
locale: {
|
|
107
|
+
label: 'Locale',
|
|
108
|
+
description: 'The BCP 47 language identifier. For reference, refer to the [IETF BCP 47 standardized code](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).',
|
|
109
|
+
type: 'string',
|
|
110
|
+
default: {
|
|
111
|
+
'@path': '$.context.locale'
|
|
112
|
+
}
|
|
113
|
+
},
|
|
91
114
|
url: {
|
|
92
115
|
label: 'Page URL',
|
|
93
116
|
type: 'string',
|
|
@@ -136,18 +159,35 @@ const action = {
|
|
|
136
159
|
description: 'Number of items.',
|
|
137
160
|
type: 'number'
|
|
138
161
|
},
|
|
139
|
-
|
|
140
|
-
label: 'Content
|
|
141
|
-
description: '
|
|
162
|
+
content_category: {
|
|
163
|
+
label: 'Content Category',
|
|
164
|
+
description: 'Category of the product item.',
|
|
142
165
|
type: 'string'
|
|
143
166
|
},
|
|
144
167
|
content_id: {
|
|
145
168
|
label: 'Content ID',
|
|
146
169
|
description: 'ID of the product item.',
|
|
147
170
|
type: 'string'
|
|
171
|
+
},
|
|
172
|
+
content_name: {
|
|
173
|
+
label: 'Content Name',
|
|
174
|
+
description: 'Name of the product item.',
|
|
175
|
+
type: 'string'
|
|
176
|
+
},
|
|
177
|
+
brand: {
|
|
178
|
+
label: 'Brand',
|
|
179
|
+
description: 'Brand name of the product item.',
|
|
180
|
+
type: 'string'
|
|
148
181
|
}
|
|
149
182
|
}
|
|
150
183
|
},
|
|
184
|
+
content_type: {
|
|
185
|
+
label: 'Content Type',
|
|
186
|
+
description: 'Type of the product item. When the `content_id` in the `contents` parameter is specified as `sku_id`, set this field to `product`. When the `content_id` in the `contents` parameter is specified as `item_group_id`, set this field to `product_group`.',
|
|
187
|
+
type: 'string',
|
|
188
|
+
choices: ['product', 'product_group'],
|
|
189
|
+
default: 'product'
|
|
190
|
+
},
|
|
151
191
|
currency: {
|
|
152
192
|
label: 'Currency',
|
|
153
193
|
type: 'string',
|
|
@@ -181,6 +221,30 @@ const action = {
|
|
|
181
221
|
'@path': '$.properties.query'
|
|
182
222
|
}
|
|
183
223
|
},
|
|
224
|
+
order_id: {
|
|
225
|
+
label: 'Order ID',
|
|
226
|
+
type: 'string',
|
|
227
|
+
description: 'Order ID of the transaction.',
|
|
228
|
+
default: {
|
|
229
|
+
'@path': '$.properties.order_id'
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
shop_id: {
|
|
233
|
+
label: 'Shop ID',
|
|
234
|
+
type: 'string',
|
|
235
|
+
description: 'Shop ID of the transaction.',
|
|
236
|
+
default: {
|
|
237
|
+
'@path': '$.properties.shop_id'
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
limited_data_use: {
|
|
241
|
+
label: 'Limited Data Use',
|
|
242
|
+
type: 'boolean',
|
|
243
|
+
description: 'Use this field to flag an event for limited data processing. TikTok will recognize this parameter as a request for limited data processing, and will limit its processing activities accordingly if the event shared occurred in an eligible location. To learn more about the Limited Data Use feature, refer to [Events API 2.0 - Limited Data Use](https://ads.tiktok.com/marketing_api/docs?id=1771101204435970).',
|
|
244
|
+
default: {
|
|
245
|
+
'@path': '$.properties.limited_data_use'
|
|
246
|
+
}
|
|
247
|
+
},
|
|
184
248
|
test_event_code: {
|
|
185
249
|
label: 'Test Event Code',
|
|
186
250
|
type: 'string',
|
|
@@ -189,9 +253,9 @@ const action = {
|
|
|
189
253
|
},
|
|
190
254
|
perform: (request, { payload, settings }) => {
|
|
191
255
|
const userData = {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
256
|
+
hashedExternalIds: formatter_1.formatUserIds(payload.external_ids),
|
|
257
|
+
hashedEmails: formatter_1.formatEmails(payload.emails),
|
|
258
|
+
hashedPhoneNumbers: formatter_1.formatPhones(payload.phone_numbers)
|
|
195
259
|
};
|
|
196
260
|
let payloadUrl, urlTtclid;
|
|
197
261
|
if (payload.url) {
|
|
@@ -203,39 +267,48 @@ const action = {
|
|
|
203
267
|
}
|
|
204
268
|
if (payloadUrl)
|
|
205
269
|
urlTtclid = payloadUrl.searchParams.get('ttclid');
|
|
206
|
-
return request('https://business-api.tiktok.com/open_api/v1.3/
|
|
270
|
+
return request('https://business-api.tiktok.com/open_api/v1.3/event/track/', {
|
|
207
271
|
method: 'post',
|
|
208
272
|
json: {
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
273
|
+
event_source: 'web',
|
|
274
|
+
event_source_id: settings.pixelCode,
|
|
275
|
+
partner_name: 'Segment',
|
|
276
|
+
data: [
|
|
277
|
+
{
|
|
278
|
+
event: payload.event,
|
|
279
|
+
event_time: payload.timestamp
|
|
280
|
+
? Math.floor(new Date(payload.timestamp).getTime() / 1000)
|
|
281
|
+
: Math.floor(new Date().getTime() / 1000),
|
|
282
|
+
event_id: payload.event_id ? `${payload.event_id}` : undefined,
|
|
283
|
+
user: {
|
|
284
|
+
ttclid: payload.ttclid ? payload.ttclid : urlTtclid ? urlTtclid : undefined,
|
|
285
|
+
external_id: userData.hashedExternalIds,
|
|
286
|
+
phone_number: userData.hashedPhoneNumbers,
|
|
287
|
+
email: userData.hashedEmails,
|
|
288
|
+
lead_id: payload.lead_id ? payload.lead_id : undefined,
|
|
289
|
+
ttp: payload.ttp ? payload.ttp : undefined,
|
|
290
|
+
ip: payload.ip ? payload.ip : undefined,
|
|
291
|
+
user_agent: payload.user_agent ? payload.user_agent : undefined,
|
|
292
|
+
locale: payload.locale ? payload.locale : undefined
|
|
293
|
+
},
|
|
294
|
+
properties: {
|
|
295
|
+
contents: payload.contents ? payload.contents : [],
|
|
296
|
+
content_type: payload.content_type ? payload.content_type : undefined,
|
|
297
|
+
currency: payload.currency ? payload.currency : undefined,
|
|
298
|
+
value: payload.value ? payload.value : undefined,
|
|
299
|
+
query: payload.query ? payload.query : undefined,
|
|
300
|
+
description: payload.description ? payload.description : undefined,
|
|
301
|
+
order_id: payload.order_id ? payload.order_id : undefined,
|
|
302
|
+
shop_id: payload.shop_id ? payload.shop_id : undefined
|
|
303
|
+
},
|
|
304
|
+
page: {
|
|
305
|
+
url: payload.url ? payload.url : undefined,
|
|
306
|
+
referrer: payload.referrer ? payload.referrer : undefined
|
|
307
|
+
},
|
|
308
|
+
limited_data_use: payload.limited_data_use ? payload.limited_data_use : false,
|
|
309
|
+
test_event_code: payload.test_event_code ? payload.test_event_code : undefined
|
|
310
|
+
}
|
|
311
|
+
]
|
|
239
312
|
}
|
|
240
313
|
});
|
|
241
314
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/tiktok-conversions/reportWebEvent/index.ts"],"names":[],"mappings":";;AAGA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/tiktok-conversions/reportWebEvent/index.ts"],"names":[],"mappings":";;AAGA,2CAAuE;AAEvE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kBAAkB;IACzB,WAAW,EACT,6JAA6J;IAC/J,MAAM,EAAE;QACN,KAAK,EAAE;YACL,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EACT,8MAA8M;SACjN;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,UAAU;YACjB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,wDAAwD;YACrE,OAAO,EAAE;gBACP,OAAO,EAAE,aAAa;aACvB;SACF;QACD,SAAS,EAAE;YACT,KAAK,EAAE,iBA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AW,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS;4BAClE,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;4BACzD,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;yBACvD;wBACD,IAAI,EAAE;4BACJ,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS;4BAC1C,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;yBAC1D;wBACD,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,KAAK;wBAC7E,eAAe,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS;qBAC/E;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -4,8 +4,201 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const actions_core_1 = require("@segment/actions-core");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const reportOfflineEvent_1 = __importDefault(require("./reportOfflineEvent"));
|
|
8
|
+
const productProperties = {
|
|
9
|
+
price: {
|
|
10
|
+
'@path': '$.price'
|
|
11
|
+
},
|
|
12
|
+
quantity: {
|
|
13
|
+
'@path': '$.quantity'
|
|
14
|
+
},
|
|
15
|
+
content_category: {
|
|
16
|
+
'@path': '$.category'
|
|
17
|
+
},
|
|
18
|
+
content_id: {
|
|
19
|
+
'@path': '$.product_id'
|
|
20
|
+
},
|
|
21
|
+
content_name: {
|
|
22
|
+
'@path': '$.name'
|
|
23
|
+
},
|
|
24
|
+
brand: {
|
|
25
|
+
'@path': '$.brand'
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const singleProductContents = {
|
|
29
|
+
...actions_core_1.defaultValues(reportOfflineEvent_1.default.fields),
|
|
30
|
+
contents: {
|
|
31
|
+
'@arrayPath': [
|
|
32
|
+
'$.properties',
|
|
33
|
+
{
|
|
34
|
+
...productProperties
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const multiProductContents = {
|
|
40
|
+
...actions_core_1.defaultValues(reportOfflineEvent_1.default.fields),
|
|
41
|
+
contents: {
|
|
42
|
+
'@arrayPath': [
|
|
43
|
+
'$.properties.products',
|
|
44
|
+
{
|
|
45
|
+
...productProperties
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const presets = [
|
|
51
|
+
{
|
|
52
|
+
name: 'Page View',
|
|
53
|
+
subscribe: 'type="page"',
|
|
54
|
+
partnerAction: 'reportWebEvent',
|
|
55
|
+
mapping: {
|
|
56
|
+
...multiProductContents,
|
|
57
|
+
event: 'PageView'
|
|
58
|
+
},
|
|
59
|
+
type: 'automatic'
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: 'View Content',
|
|
63
|
+
subscribe: 'event = "Product Viewed"',
|
|
64
|
+
partnerAction: 'reportWebEvent',
|
|
65
|
+
mapping: {
|
|
66
|
+
...singleProductContents,
|
|
67
|
+
event: 'ViewContent'
|
|
68
|
+
},
|
|
69
|
+
type: 'automatic'
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'Click Button',
|
|
73
|
+
subscribe: 'event = "Product Clicked"',
|
|
74
|
+
partnerAction: 'reportWebEvent',
|
|
75
|
+
mapping: {
|
|
76
|
+
...singleProductContents,
|
|
77
|
+
event: 'ClickButton'
|
|
78
|
+
},
|
|
79
|
+
type: 'automatic'
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: 'Search',
|
|
83
|
+
subscribe: 'event = "Products Searched"',
|
|
84
|
+
partnerAction: 'reportWebEvent',
|
|
85
|
+
mapping: {
|
|
86
|
+
...singleProductContents,
|
|
87
|
+
event: 'Search'
|
|
88
|
+
},
|
|
89
|
+
type: 'automatic'
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: 'Add to Wishlist',
|
|
93
|
+
subscribe: 'event = "Product Added to Wishlist"',
|
|
94
|
+
partnerAction: 'reportWebEvent',
|
|
95
|
+
mapping: {
|
|
96
|
+
...singleProductContents,
|
|
97
|
+
event: 'AddToWishlist'
|
|
98
|
+
},
|
|
99
|
+
type: 'automatic'
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: 'Add to Cart',
|
|
103
|
+
subscribe: 'event = "Product Added"',
|
|
104
|
+
partnerAction: 'reportWebEvent',
|
|
105
|
+
mapping: {
|
|
106
|
+
...singleProductContents,
|
|
107
|
+
event: 'AddToCart'
|
|
108
|
+
},
|
|
109
|
+
type: 'automatic'
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
name: 'Initiate Checkout',
|
|
113
|
+
subscribe: 'event = "Checkout Started"',
|
|
114
|
+
partnerAction: 'reportWebEvent',
|
|
115
|
+
mapping: {
|
|
116
|
+
...multiProductContents,
|
|
117
|
+
event: 'InitiateCheckout'
|
|
118
|
+
},
|
|
119
|
+
type: 'automatic'
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: 'Add Payment Info',
|
|
123
|
+
subscribe: 'event = "Payment Info Entered"',
|
|
124
|
+
partnerAction: 'reportWebEvent',
|
|
125
|
+
mapping: {
|
|
126
|
+
...multiProductContents,
|
|
127
|
+
event: 'AddPaymentInfo'
|
|
128
|
+
},
|
|
129
|
+
type: 'automatic'
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: 'Place an Order',
|
|
133
|
+
subscribe: 'event = "Order Completed"',
|
|
134
|
+
partnerAction: 'reportWebEvent',
|
|
135
|
+
mapping: {
|
|
136
|
+
...multiProductContents,
|
|
137
|
+
event: 'PlaceAnOrder'
|
|
138
|
+
},
|
|
139
|
+
type: 'automatic'
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: 'Complete Payment',
|
|
143
|
+
subscribe: 'event = "Payment Completed"',
|
|
144
|
+
partnerAction: 'reportWebEvent',
|
|
145
|
+
mapping: {
|
|
146
|
+
...multiProductContents,
|
|
147
|
+
event: 'CompletePayment'
|
|
148
|
+
},
|
|
149
|
+
type: 'automatic'
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: 'Contact',
|
|
153
|
+
subscribe: 'event = "Callback Started"',
|
|
154
|
+
partnerAction: 'reportWebEvent',
|
|
155
|
+
mapping: {
|
|
156
|
+
...actions_core_1.defaultValues(reportOfflineEvent_1.default.fields),
|
|
157
|
+
event: 'Contact'
|
|
158
|
+
},
|
|
159
|
+
type: 'automatic'
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: 'Download',
|
|
163
|
+
subscribe: 'event = "Download Link Clicked"',
|
|
164
|
+
partnerAction: 'reportWebEvent',
|
|
165
|
+
mapping: {
|
|
166
|
+
...actions_core_1.defaultValues(reportOfflineEvent_1.default.fields),
|
|
167
|
+
event: 'Download'
|
|
168
|
+
},
|
|
169
|
+
type: 'automatic'
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: 'Submit Form',
|
|
173
|
+
subscribe: 'event = "Form Submitted"',
|
|
174
|
+
partnerAction: 'reportWebEvent',
|
|
175
|
+
mapping: {
|
|
176
|
+
...actions_core_1.defaultValues(reportOfflineEvent_1.default.fields),
|
|
177
|
+
event: 'SubmitForm'
|
|
178
|
+
},
|
|
179
|
+
type: 'automatic'
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
name: 'Complete Registration',
|
|
183
|
+
subscribe: 'event = "Signed Up"',
|
|
184
|
+
partnerAction: 'reportWebEvent',
|
|
185
|
+
mapping: {
|
|
186
|
+
...actions_core_1.defaultValues(reportOfflineEvent_1.default.fields),
|
|
187
|
+
event: 'CompleteRegistration'
|
|
188
|
+
},
|
|
189
|
+
type: 'automatic'
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
name: 'Subscribe',
|
|
193
|
+
subscribe: 'event = "Subscription Created"',
|
|
194
|
+
partnerAction: 'reportWebEvent',
|
|
195
|
+
mapping: {
|
|
196
|
+
...actions_core_1.defaultValues(reportOfflineEvent_1.default.fields),
|
|
197
|
+
event: 'Subscribe'
|
|
198
|
+
},
|
|
199
|
+
type: 'automatic'
|
|
200
|
+
}
|
|
201
|
+
];
|
|
9
202
|
const destination = {
|
|
10
203
|
name: 'TikTok Offline Conversions',
|
|
11
204
|
slug: 'actions-tiktok-offline-conversions',
|
|
@@ -15,14 +208,14 @@ const destination = {
|
|
|
15
208
|
fields: {
|
|
16
209
|
accessToken: {
|
|
17
210
|
label: 'Access Token',
|
|
18
|
-
description: 'Your TikTok Access Token. Please see TikTok’s [Events API documentation](https://
|
|
211
|
+
description: 'Your TikTok Access Token. Please see TikTok’s [Events API 2.0 documentation](https://business-api.tiktok.com/portal/docs?id=1771101130925058) for information on how to generate an access token via the TikTok Ads Manager or API.',
|
|
19
212
|
type: 'string',
|
|
20
213
|
required: true
|
|
21
214
|
},
|
|
22
215
|
eventSetID: {
|
|
23
216
|
label: 'Event Set ID',
|
|
24
217
|
type: 'string',
|
|
25
|
-
description: 'Your TikTok Offline Event Set ID. Please see TikTok’s [Events API documentation](https://
|
|
218
|
+
description: 'Your TikTok Offline Event Set ID. Please see TikTok’s [Events API 2.0 documentation](https://business-api.tiktok.com/portal/docs?id=1771101027431425) for information on how to find this value.',
|
|
26
219
|
required: true
|
|
27
220
|
}
|
|
28
221
|
},
|
|
@@ -46,51 +239,9 @@ const destination = {
|
|
|
46
239
|
}
|
|
47
240
|
};
|
|
48
241
|
},
|
|
49
|
-
presets
|
|
50
|
-
{
|
|
51
|
-
name: 'Complete Payment',
|
|
52
|
-
subscribe: 'type = "track" and event = "Order Completed"',
|
|
53
|
-
partnerAction: 'trackPaymentOfflineConversion',
|
|
54
|
-
mapping: {
|
|
55
|
-
...actions_core_1.defaultValues(trackPaymentOfflineConversion_1.default.fields),
|
|
56
|
-
event: 'CompletePayment'
|
|
57
|
-
},
|
|
58
|
-
type: 'automatic'
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: 'Contact',
|
|
62
|
-
subscribe: 'type = "track" and event = "User Contacted Call Center"',
|
|
63
|
-
partnerAction: 'trackNonPaymentOfflineConversion',
|
|
64
|
-
mapping: {
|
|
65
|
-
...actions_core_1.defaultValues(trackNonPaymentOfflineConversion_1.default.fields),
|
|
66
|
-
event: 'Contact'
|
|
67
|
-
},
|
|
68
|
-
type: 'automatic'
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
name: 'Subscribe',
|
|
72
|
-
subscribe: 'type = "track" and event = "User Subscribed In Store"',
|
|
73
|
-
partnerAction: 'trackNonPaymentOfflineConversion',
|
|
74
|
-
mapping: {
|
|
75
|
-
...actions_core_1.defaultValues(trackNonPaymentOfflineConversion_1.default.fields),
|
|
76
|
-
event: 'Subscribe'
|
|
77
|
-
},
|
|
78
|
-
type: 'automatic'
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
name: 'Submit Form',
|
|
82
|
-
subscribe: 'type = "track" and event = "Form Submitted"',
|
|
83
|
-
partnerAction: 'trackNonPaymentOfflineConversion',
|
|
84
|
-
mapping: {
|
|
85
|
-
...actions_core_1.defaultValues(trackNonPaymentOfflineConversion_1.default.fields),
|
|
86
|
-
event: 'SubmitForm'
|
|
87
|
-
},
|
|
88
|
-
type: 'automatic'
|
|
89
|
-
}
|
|
90
|
-
],
|
|
242
|
+
presets,
|
|
91
243
|
actions: {
|
|
92
|
-
|
|
93
|
-
trackNonPaymentOfflineConversion: trackNonPaymentOfflineConversion_1.default
|
|
244
|
+
reportOfflineEvent: reportOfflineEvent_1.default
|
|
94
245
|
}
|
|
95
246
|
};
|
|
96
247
|
exports.default = destination;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/tiktok-offline-conversions/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4E;AAE5E,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/tiktok-offline-conversions/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4E;AAE5E,8EAAqD;AAErD,MAAM,iBAAiB,GAAG;IACxB,KAAK,EAAE;QACL,OAAO,EAAE,SAAS;KACnB;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,YAAY;KACtB;IACD,gBAAgB,EAAE;QAChB,OAAO,EAAE,YAAY;KACtB;IACD,UAAU,EAAE;QACV,OAAO,EAAE,cAAc;KACxB;IACD,YAAY,EAAE;QACZ,OAAO,EAAE,QAAQ;KAClB;IACD,KAAK,EAAE;QACL,OAAO,EAAE,SAAS;KACnB;CACF,CAAA;AAED,MAAM,qBAAqB,GAAG;IAC5B,GAAG,4BAAa,CAAC,4BAAkB,CAAC,MAAM,CAAC;IAC3C,QAAQ,EAAE;QACR,YAAY,EAAE;YACZ,cAAc;YACd;gBACE,GAAG,iBAAiB;aACrB;SACF;KACF;CACF,CAAA;AAED,MAAM,oBAAoB,GAAG;IAC3B,GAAG,4BAAa,CAAC,4BAAkB,CAAC,MAAM,CAAC;IAC3C,QAAQ,EAAE;QACR,YAAY,EAAE;YACZ,uBAAuB;YACvB;gBACE,GAAG,iBAAiB;aACrB;SACF;KACF;CACF,CAAA;AAED,MAAM,OAAO,GAAqC;IAChD;QACE,IAAI,EAAE,WAAW;QACjB,SAAS,EAAE,aAAa;QACxB,aAAa,EAAE,gBAAgB;QAC/B,OAAO,EAAE;YACP,GAAG,oBA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;KACnB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatPhones = exports.formatUserIds = exports.formatEmails = void 0;
|
|
4
|
+
const crypto_1 = require("crypto");
|
|
5
|
+
const formatEmails = (email_addresses) => {
|
|
6
|
+
const result = [];
|
|
7
|
+
if (email_addresses) {
|
|
8
|
+
email_addresses.forEach((email) => {
|
|
9
|
+
result.push(hashAndEncode(email.toLowerCase()));
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
return result;
|
|
13
|
+
};
|
|
14
|
+
exports.formatEmails = formatEmails;
|
|
15
|
+
function formatUserIds(userIds) {
|
|
16
|
+
const result = [];
|
|
17
|
+
if (userIds) {
|
|
18
|
+
userIds.forEach((userId) => {
|
|
19
|
+
result.push(hashAndEncode(userId.toLowerCase()));
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
exports.formatUserIds = formatUserIds;
|
|
25
|
+
const formatPhones = (phone_numbers) => {
|
|
26
|
+
const result = [];
|
|
27
|
+
if (!phone_numbers)
|
|
28
|
+
return result;
|
|
29
|
+
phone_numbers.forEach((phone) => {
|
|
30
|
+
const validatedPhone = phone.match(/[0-9]{0,14}/g);
|
|
31
|
+
if (validatedPhone === null) {
|
|
32
|
+
throw new Error(`${phone} is not a valid E.164 phone number.`);
|
|
33
|
+
}
|
|
34
|
+
const formattedPhone = `+${phone.replace(/[^0-9]/g, '')}`;
|
|
35
|
+
result.push(hashAndEncode(formattedPhone.substring(0, 15)));
|
|
36
|
+
});
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
exports.formatPhones = formatPhones;
|
|
40
|
+
function hashAndEncode(property) {
|
|
41
|
+
return crypto_1.createHash('sha256').update(property).digest('hex');
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=formatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.js","sourceRoot":"","sources":["../../../../src/destinations/tiktok-offline-conversions/reportOfflineEvent/formatter.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AAK5B,MAAM,YAAY,GAAG,CAAC,eAAqC,EAAY,EAAE;IAC9E,MAAM,MAAM,GAAa,EAAE,CAAA;IAC3B,IAAI,eAAe,EAAE;QACnB,eAAe,CAAC,OAAO,CAAC,CAAC,KAAa,EAAE,EAAE;YACxC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAA;QACjD,CAAC,CAAC,CAAA;KACH;IACD,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AARY,QAAA,YAAY,gBAQxB;AAOD,SAAgB,aAAa,CAAC,OAA6B;IACzD,MAAM,MAAM,GAAa,EAAE,CAAA;IAC3B,IAAI,OAAO,EAAE;QACX,OAAO,CAAC,OAAO,CAAC,CAAC,MAAc,EAAE,EAAE;YACjC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAA;QAClD,CAAC,CAAC,CAAA;KACH;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AARD,sCAQC;AAOM,MAAM,YAAY,GAAG,CAAC,aAAmC,EAAY,EAAE;IAC5E,MAAM,MAAM,GAAa,EAAE,CAAA;IAC3B,IAAI,CAAC,aAAa;QAAE,OAAO,MAAM,CAAA;IAEjC,aAAa,CAAC,OAAO,CAAC,CAAC,KAAa,EAAE,EAAE;QACtC,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;QAClD,IAAI,cAAc,KAAK,IAAI,EAAE;YAC3B,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,qCAAqC,CAAC,CAAA;SAC/D;QAED,MAAM,cAAc,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,E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