@segment/action-destinations 3.239.0 → 3.239.4
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/aggregations-io/index.js +7 -17
- package/dist/destinations/aggregations-io/index.js.map +1 -1
- package/dist/destinations/braze/trackEvent/generated-types.d.ts +0 -1
- package/dist/destinations/braze/trackEvent/index.js +0 -8
- package/dist/destinations/braze/trackEvent/index.js.map +1 -1
- package/dist/destinations/braze/trackPurchase/generated-types.d.ts +0 -1
- package/dist/destinations/braze/trackPurchase/index.js +0 -8
- package/dist/destinations/braze/trackPurchase/index.js.map +1 -1
- package/dist/destinations/braze/utils.js +11 -15
- package/dist/destinations/braze/utils.js.map +1 -1
- package/dist/destinations/criteo-audiences/criteo-audiences.js +6 -11
- package/dist/destinations/criteo-audiences/criteo-audiences.js.map +1 -1
- package/dist/destinations/display-video-360/index.js +1 -1
- package/dist/destinations/display-video-360/index.js.map +1 -1
- package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.js +1 -3
- package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.js.map +1 -1
- package/dist/destinations/engage/twilio/utils/TwilioMessageSender.js +1 -1
- package/dist/destinations/engage/twilio/utils/TwilioMessageSender.js.map +1 -1
- package/dist/destinations/hubspot/sendCustomBehavioralEvent/index.js +0 -26
- package/dist/destinations/hubspot/sendCustomBehavioralEvent/index.js.map +1 -1
- package/dist/destinations/hubspot/utils.d.ts +0 -10
- package/dist/destinations/index.js +0 -1
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/linkedin-conversions/api/api.test.js +24 -42
- package/dist/destinations/linkedin-conversions/api/api.test.js.map +1 -1
- package/dist/destinations/linkedin-conversions/api/index.js +10 -6
- package/dist/destinations/linkedin-conversions/api/index.js.map +1 -1
- package/dist/destinations/linkedin-conversions/types.d.ts +7 -4
- package/dist/destinations/tiktok-offline-conversions/common_fields.js +179 -20
- package/dist/destinations/tiktok-offline-conversions/common_fields.js.map +1 -1
- package/dist/destinations/tiktok-offline-conversions/formatter.d.ts +1 -0
- package/dist/destinations/tiktok-offline-conversions/formatter.js +11 -1
- package/dist/destinations/tiktok-offline-conversions/formatter.js.map +1 -1
- package/dist/destinations/tiktok-offline-conversions/index.js +169 -15
- package/dist/destinations/tiktok-offline-conversions/index.js.map +1 -1
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.d.ts +33 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.js.map +1 -0
- package/dist/destinations/{amazon-ads/syncAudiences → tiktok-offline-conversions/reportOfflineEvent}/index.d.ts +1 -1
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.js +16 -0
- package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/index.js.map +1 -0
- package/dist/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/generated-types.d.ts +25 -2
- package/dist/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/index.js +4 -29
- package/dist/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/index.js.map +1 -1
- package/dist/destinations/tiktok-offline-conversions/trackPaymentOfflineConversion/generated-types.d.ts +18 -5
- package/dist/destinations/tiktok-offline-conversions/trackPaymentOfflineConversion/index.js +5 -126
- package/dist/destinations/tiktok-offline-conversions/trackPaymentOfflineConversion/index.js.map +1 -1
- package/dist/destinations/tiktok-offline-conversions/utils.d.ts +8 -0
- package/dist/destinations/tiktok-offline-conversions/utils.js +67 -0
- package/dist/destinations/tiktok-offline-conversions/utils.js.map +1 -0
- package/package.json +2 -2
- package/dist/destinations/aggregations-io/types.d.ts +0 -8
- package/dist/destinations/aggregations-io/types.js +0 -8
- package/dist/destinations/aggregations-io/types.js.map +0 -1
- package/dist/destinations/amazon-ads/generated-types.d.ts +0 -3
- package/dist/destinations/amazon-ads/generated-types.js.map +0 -1
- package/dist/destinations/amazon-ads/index.d.ts +0 -4
- package/dist/destinations/amazon-ads/index.js +0 -87
- package/dist/destinations/amazon-ads/index.js.map +0 -1
- package/dist/destinations/amazon-ads/syncAudiences/generated-types.d.ts +0 -2
- package/dist/destinations/amazon-ads/syncAudiences/generated-types.js +0 -3
- package/dist/destinations/amazon-ads/syncAudiences/generated-types.js.map +0 -1
- package/dist/destinations/amazon-ads/syncAudiences/index.js +0 -15
- package/dist/destinations/amazon-ads/syncAudiences/index.js.map +0 -1
- package/dist/destinations/amazon-ads/types.d.ts +0 -22
- package/dist/destinations/amazon-ads/types.js +0 -11
- package/dist/destinations/amazon-ads/types.js.map +0 -1
- /package/dist/destinations/{amazon-ads → tiktok-offline-conversions/reportOfflineEvent}/generated-types.js +0 -0
|
@@ -6,6 +6,49 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const actions_core_1 = require("@segment/actions-core");
|
|
7
7
|
const trackPaymentOfflineConversion_1 = __importDefault(require("./trackPaymentOfflineConversion"));
|
|
8
8
|
const trackNonPaymentOfflineConversion_1 = __importDefault(require("./trackNonPaymentOfflineConversion"));
|
|
9
|
+
const reportOfflineEvent_1 = __importDefault(require("./reportOfflineEvent"));
|
|
10
|
+
const productProperties = {
|
|
11
|
+
price: {
|
|
12
|
+
'@path': '$.price'
|
|
13
|
+
},
|
|
14
|
+
quantity: {
|
|
15
|
+
'@path': '$.quantity'
|
|
16
|
+
},
|
|
17
|
+
content_category: {
|
|
18
|
+
'@path': '$.category'
|
|
19
|
+
},
|
|
20
|
+
content_id: {
|
|
21
|
+
'@path': '$.product_id'
|
|
22
|
+
},
|
|
23
|
+
content_name: {
|
|
24
|
+
'@path': '$.name'
|
|
25
|
+
},
|
|
26
|
+
brand: {
|
|
27
|
+
'@path': '$.brand'
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const singleProductContents = {
|
|
31
|
+
...actions_core_1.defaultValues(reportOfflineEvent_1.default.fields),
|
|
32
|
+
contents: {
|
|
33
|
+
'@arrayPath': [
|
|
34
|
+
'$.properties',
|
|
35
|
+
{
|
|
36
|
+
...productProperties
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const multiProductContents = {
|
|
42
|
+
...actions_core_1.defaultValues(reportOfflineEvent_1.default.fields),
|
|
43
|
+
contents: {
|
|
44
|
+
'@arrayPath': [
|
|
45
|
+
'$.properties.products',
|
|
46
|
+
{
|
|
47
|
+
...productProperties
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
};
|
|
9
52
|
const destination = {
|
|
10
53
|
name: 'TikTok Offline Conversions',
|
|
11
54
|
slug: 'actions-tiktok-offline-conversions',
|
|
@@ -15,14 +58,14 @@ const destination = {
|
|
|
15
58
|
fields: {
|
|
16
59
|
accessToken: {
|
|
17
60
|
label: 'Access Token',
|
|
18
|
-
description: 'Your TikTok Access Token. Please see TikTok’s [Events API documentation](https://
|
|
61
|
+
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
62
|
type: 'string',
|
|
20
63
|
required: true
|
|
21
64
|
},
|
|
22
65
|
eventSetID: {
|
|
23
66
|
label: 'Event Set ID',
|
|
24
67
|
type: 'string',
|
|
25
|
-
description: 'Your TikTok Offline Event Set ID. Please see TikTok’s [Events API documentation](https://
|
|
68
|
+
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
69
|
required: true
|
|
27
70
|
}
|
|
28
71
|
},
|
|
@@ -49,48 +92,159 @@ const destination = {
|
|
|
49
92
|
presets: [
|
|
50
93
|
{
|
|
51
94
|
name: 'Complete Payment',
|
|
52
|
-
subscribe: '
|
|
53
|
-
partnerAction: '
|
|
95
|
+
subscribe: 'event = "Payment Completed"',
|
|
96
|
+
partnerAction: 'reportWebEvent',
|
|
54
97
|
mapping: {
|
|
55
|
-
...
|
|
98
|
+
...multiProductContents,
|
|
56
99
|
event: 'CompletePayment'
|
|
57
100
|
},
|
|
58
101
|
type: 'automatic'
|
|
59
102
|
},
|
|
60
103
|
{
|
|
61
104
|
name: 'Contact',
|
|
62
|
-
subscribe: '
|
|
63
|
-
partnerAction: '
|
|
105
|
+
subscribe: 'event = "Callback Started"',
|
|
106
|
+
partnerAction: 'reportWebEvent',
|
|
64
107
|
mapping: {
|
|
65
|
-
...actions_core_1.defaultValues(
|
|
108
|
+
...actions_core_1.defaultValues(reportOfflineEvent_1.default.fields),
|
|
66
109
|
event: 'Contact'
|
|
67
110
|
},
|
|
68
111
|
type: 'automatic'
|
|
69
112
|
},
|
|
70
113
|
{
|
|
71
114
|
name: 'Subscribe',
|
|
72
|
-
subscribe: '
|
|
73
|
-
partnerAction: '
|
|
115
|
+
subscribe: 'event = "Subscription Created"',
|
|
116
|
+
partnerAction: 'reportWebEvent',
|
|
74
117
|
mapping: {
|
|
75
|
-
...actions_core_1.defaultValues(
|
|
118
|
+
...actions_core_1.defaultValues(reportOfflineEvent_1.default.fields),
|
|
76
119
|
event: 'Subscribe'
|
|
77
120
|
},
|
|
78
121
|
type: 'automatic'
|
|
79
122
|
},
|
|
80
123
|
{
|
|
81
124
|
name: 'Submit Form',
|
|
82
|
-
subscribe: '
|
|
83
|
-
partnerAction: '
|
|
125
|
+
subscribe: 'event = "Form Submitted"',
|
|
126
|
+
partnerAction: 'reportWebEvent',
|
|
84
127
|
mapping: {
|
|
85
|
-
...actions_core_1.defaultValues(
|
|
128
|
+
...actions_core_1.defaultValues(reportOfflineEvent_1.default.fields),
|
|
86
129
|
event: 'SubmitForm'
|
|
87
130
|
},
|
|
88
131
|
type: 'automatic'
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: 'Page View',
|
|
135
|
+
subscribe: 'type="page"',
|
|
136
|
+
partnerAction: 'reportWebEvent',
|
|
137
|
+
mapping: {
|
|
138
|
+
...multiProductContents,
|
|
139
|
+
event: 'PageView'
|
|
140
|
+
},
|
|
141
|
+
type: 'automatic'
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: 'View Content',
|
|
145
|
+
subscribe: 'event = "Product Viewed"',
|
|
146
|
+
partnerAction: 'reportWebEvent',
|
|
147
|
+
mapping: {
|
|
148
|
+
...singleProductContents,
|
|
149
|
+
event: 'ViewContent'
|
|
150
|
+
},
|
|
151
|
+
type: 'automatic'
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: 'Click Button',
|
|
155
|
+
subscribe: 'event = "Product Clicked"',
|
|
156
|
+
partnerAction: 'reportWebEvent',
|
|
157
|
+
mapping: {
|
|
158
|
+
...singleProductContents,
|
|
159
|
+
event: 'ClickButton'
|
|
160
|
+
},
|
|
161
|
+
type: 'automatic'
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
name: 'Search',
|
|
165
|
+
subscribe: 'event = "Products Searched"',
|
|
166
|
+
partnerAction: 'reportWebEvent',
|
|
167
|
+
mapping: {
|
|
168
|
+
...singleProductContents,
|
|
169
|
+
event: 'Search'
|
|
170
|
+
},
|
|
171
|
+
type: 'automatic'
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: 'Add to Wishlist',
|
|
175
|
+
subscribe: 'event = "Product Added to Wishlist"',
|
|
176
|
+
partnerAction: 'reportWebEvent',
|
|
177
|
+
mapping: {
|
|
178
|
+
...singleProductContents,
|
|
179
|
+
event: 'AddToWishlist'
|
|
180
|
+
},
|
|
181
|
+
type: 'automatic'
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: 'Add to Cart',
|
|
185
|
+
subscribe: 'event = "Product Added"',
|
|
186
|
+
partnerAction: 'reportWebEvent',
|
|
187
|
+
mapping: {
|
|
188
|
+
...singleProductContents,
|
|
189
|
+
event: 'AddToCart'
|
|
190
|
+
},
|
|
191
|
+
type: 'automatic'
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
name: 'Initiate Checkout',
|
|
195
|
+
subscribe: 'event = "Checkout Started"',
|
|
196
|
+
partnerAction: 'reportWebEvent',
|
|
197
|
+
mapping: {
|
|
198
|
+
...multiProductContents,
|
|
199
|
+
event: 'InitiateCheckout'
|
|
200
|
+
},
|
|
201
|
+
type: 'automatic'
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
name: 'Add Payment Info',
|
|
205
|
+
subscribe: 'event = "Payment Info Entered"',
|
|
206
|
+
partnerAction: 'reportWebEvent',
|
|
207
|
+
mapping: {
|
|
208
|
+
...multiProductContents,
|
|
209
|
+
event: 'AddPaymentInfo'
|
|
210
|
+
},
|
|
211
|
+
type: 'automatic'
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
name: 'Place an Order',
|
|
215
|
+
subscribe: 'event = "Order Completed"',
|
|
216
|
+
partnerAction: 'reportWebEvent',
|
|
217
|
+
mapping: {
|
|
218
|
+
...multiProductContents,
|
|
219
|
+
event: 'PlaceAnOrder'
|
|
220
|
+
},
|
|
221
|
+
type: 'automatic'
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
name: 'Download',
|
|
225
|
+
subscribe: 'event = "Download Link Clicked"',
|
|
226
|
+
partnerAction: 'reportWebEvent',
|
|
227
|
+
mapping: {
|
|
228
|
+
...actions_core_1.defaultValues(reportOfflineEvent_1.default.fields),
|
|
229
|
+
event: 'Download'
|
|
230
|
+
},
|
|
231
|
+
type: 'automatic'
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
name: 'Complete Registration',
|
|
235
|
+
subscribe: 'event = "Signed Up"',
|
|
236
|
+
partnerAction: 'reportWebEvent',
|
|
237
|
+
mapping: {
|
|
238
|
+
...actions_core_1.defaultValues(reportOfflineEvent_1.default.fields),
|
|
239
|
+
event: 'CompleteRegistration'
|
|
240
|
+
},
|
|
241
|
+
type: 'automatic'
|
|
89
242
|
}
|
|
90
243
|
],
|
|
91
244
|
actions: {
|
|
92
245
|
trackPaymentOfflineConversion: trackPaymentOfflineConversion_1.default,
|
|
93
|
-
trackNonPaymentOfflineConversion: trackNonPaymentOfflineConversion_1.default
|
|
246
|
+
trackNonPaymentOfflineConversion: trackNonPaymentOfflineConversion_1.default,
|
|
247
|
+
reportOfflineEvent: reportOfflineEvent_1.default
|
|
94
248
|
}
|
|
95
249
|
};
|
|
96
250
|
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,oGAA2E;AAC3E,0GAAiF;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/tiktok-offline-conversions/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA4E;AAE5E,oGAA2E;AAC3E,0GAAiF;AACjF,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,M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,4BAAkB,CAAC,MAAM,CAAC;gBAC3C,KAAK,EAAE,sBAAsB;aAC9B;YACD,IAAI,EAAE,WAAW;SAClB;KACF;IACD,OAAO,EAAE;QACP,6BAA6B,EAA7B,uCAA6B;QAC7B,gCAAgC,EAAhC,0CAAgC;QAChC,kBAAkB,EAAlB,4BAAkB;KACnB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
event: string;
|
|
3
|
+
event_id?: string;
|
|
4
|
+
timestamp?: string;
|
|
5
|
+
phone_numbers?: string[];
|
|
6
|
+
email_addresses?: string[];
|
|
7
|
+
order_id?: string;
|
|
8
|
+
shop_id?: string;
|
|
9
|
+
external_ids?: string[];
|
|
10
|
+
ttclid?: string;
|
|
11
|
+
ttp?: string;
|
|
12
|
+
lead_id?: string;
|
|
13
|
+
locale?: string;
|
|
14
|
+
url?: string;
|
|
15
|
+
referrer?: string;
|
|
16
|
+
ip?: string;
|
|
17
|
+
user_agent?: string;
|
|
18
|
+
contents?: {
|
|
19
|
+
price?: number;
|
|
20
|
+
quantity?: number;
|
|
21
|
+
content_category?: string;
|
|
22
|
+
content_id?: string;
|
|
23
|
+
content_name?: string;
|
|
24
|
+
brand?: string;
|
|
25
|
+
}[];
|
|
26
|
+
content_type?: string;
|
|
27
|
+
currency?: string;
|
|
28
|
+
value?: number;
|
|
29
|
+
description?: string;
|
|
30
|
+
query?: string;
|
|
31
|
+
limited_data_use?: boolean;
|
|
32
|
+
test_event_code?: string;
|
|
33
|
+
}
|
package/dist/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/tiktok-offline-conversions/reportOfflineEvent/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ActionDefinition } from '@segment/actions-core';
|
|
2
2
|
import type { Settings } from '../generated-types';
|
|
3
3
|
import type { Payload } from './generated-types';
|
|
4
4
|
declare const action: ActionDefinition<Settings, Payload>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const common_fields_1 = require("../common_fields");
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Track Payment Offline Conversion',
|
|
7
|
+
description: 'Send details of an in-store purchase or console purchase to the Tiktok Offline Events API',
|
|
8
|
+
fields: {
|
|
9
|
+
...common_fields_1.commonFields
|
|
10
|
+
},
|
|
11
|
+
perform: (request, { payload, settings }) => {
|
|
12
|
+
return utils_1.performOfflineEvent(request, settings, payload);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
exports.default = action;
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/tiktok-offline-conversions/reportOfflineEvent/index.ts"],"names":[],"mappings":";;AAGA,oDAA+C;AAC/C,oCAA8C;AAE9C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,kCAAkC;IACzC,WAAW,EAAE,2FAA2F;IACxG,MAAM,EAAE;QACN,GAAG,4BAAY;KAChB;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,OAAO,2BAAmB,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;IACxD,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,10 +1,33 @@
|
|
|
1
1
|
export interface Payload {
|
|
2
2
|
event: string;
|
|
3
3
|
event_id?: string;
|
|
4
|
-
timestamp
|
|
4
|
+
timestamp?: string;
|
|
5
5
|
phone_numbers?: string[];
|
|
6
6
|
email_addresses?: string[];
|
|
7
7
|
order_id?: string;
|
|
8
8
|
shop_id?: string;
|
|
9
|
-
|
|
9
|
+
external_ids?: string[];
|
|
10
|
+
ttclid?: string;
|
|
11
|
+
ttp?: string;
|
|
12
|
+
lead_id?: string;
|
|
13
|
+
locale?: string;
|
|
14
|
+
url?: string;
|
|
15
|
+
referrer?: string;
|
|
16
|
+
ip?: string;
|
|
17
|
+
user_agent?: string;
|
|
18
|
+
contents?: {
|
|
19
|
+
price?: number;
|
|
20
|
+
quantity?: number;
|
|
21
|
+
content_category?: string;
|
|
22
|
+
content_id?: string;
|
|
23
|
+
content_name?: string;
|
|
24
|
+
brand?: string;
|
|
25
|
+
}[];
|
|
26
|
+
content_type?: string;
|
|
27
|
+
currency?: string;
|
|
28
|
+
value?: number;
|
|
29
|
+
description?: string;
|
|
30
|
+
query?: string;
|
|
31
|
+
limited_data_use?: boolean;
|
|
32
|
+
test_event_code?: string;
|
|
10
33
|
}
|
package/dist/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/index.js
CHANGED
|
@@ -1,40 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
4
3
|
const common_fields_1 = require("../common_fields");
|
|
5
|
-
const
|
|
4
|
+
const utils_1 = require("../utils");
|
|
6
5
|
const action = {
|
|
7
|
-
title: 'Track Non Payment Offline Conversion',
|
|
8
|
-
description:
|
|
6
|
+
title: '[Deprecated] Track Non Payment Offline Conversion',
|
|
7
|
+
description: "[Deprecated] Send a non payment related event to the TikTok Offline Conversions API. This Action has been Deprecated. Please use the 'Track Payment Offline Conversion' Action instead",
|
|
9
8
|
fields: {
|
|
10
9
|
...common_fields_1.commonFields
|
|
11
10
|
},
|
|
12
11
|
perform: (request, { payload, settings }) => {
|
|
13
|
-
|
|
14
|
-
const emails = formatter_1.formatEmails(payload.email_addresses);
|
|
15
|
-
if (phone_numbers.length < 1 && emails.length < 1)
|
|
16
|
-
throw new actions_core_1.PayloadValidationError('TikTok Offline Conversions API requires an email address and/or phone number');
|
|
17
|
-
return request('https://business-api.tiktok.com/open_api/v1.3/offline/track/', {
|
|
18
|
-
method: 'post',
|
|
19
|
-
json: {
|
|
20
|
-
event_set_id: settings.eventSetID,
|
|
21
|
-
event: payload.event,
|
|
22
|
-
event_id: payload.event_id ? `${payload.event_id}` : undefined,
|
|
23
|
-
timestamp: payload.timestamp,
|
|
24
|
-
context: {
|
|
25
|
-
user: {
|
|
26
|
-
phone_numbers,
|
|
27
|
-
emails
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
properties: {
|
|
31
|
-
order_id: payload.order_id,
|
|
32
|
-
shop_id: payload.shop_id,
|
|
33
|
-
event_channel: payload.event_channel
|
|
34
|
-
},
|
|
35
|
-
partner_name: 'Segment'
|
|
36
|
-
}
|
|
37
|
-
});
|
|
12
|
+
return utils_1.performOfflineEvent(request, settings, payload);
|
|
38
13
|
}
|
|
39
14
|
};
|
|
40
15
|
exports.default = action;
|
package/dist/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/tiktok-offline-conversions/trackNonPaymentOfflineConversion/index.ts"],"names":[],"mappings":";;AAGA,oDAA+C;AAC/C,oCAA8C;AAE9C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,mDAAmD;IAC1D,WAAW,EACT,wLAAwL;IAC1L,MAAM,EAAE;QACN,GAAG,4BAAY;KAChB;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,OAAO,2BAAmB,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;IACxD,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -6,15 +6,28 @@ export interface Payload {
|
|
|
6
6
|
email_addresses?: string[];
|
|
7
7
|
order_id?: string;
|
|
8
8
|
shop_id?: string;
|
|
9
|
-
|
|
9
|
+
external_ids?: string[];
|
|
10
|
+
ttclid?: string;
|
|
11
|
+
ttp?: string;
|
|
12
|
+
lead_id?: string;
|
|
13
|
+
locale?: string;
|
|
14
|
+
url?: string;
|
|
15
|
+
referrer?: string;
|
|
16
|
+
ip?: string;
|
|
17
|
+
user_agent?: string;
|
|
10
18
|
contents?: {
|
|
11
19
|
price?: number;
|
|
12
20
|
quantity?: number;
|
|
13
|
-
|
|
21
|
+
content_category?: string;
|
|
14
22
|
content_id?: string;
|
|
15
23
|
content_name?: string;
|
|
16
|
-
|
|
24
|
+
brand?: string;
|
|
17
25
|
}[];
|
|
18
|
-
|
|
19
|
-
|
|
26
|
+
content_type?: string;
|
|
27
|
+
currency?: string;
|
|
28
|
+
value?: number;
|
|
29
|
+
description?: string;
|
|
30
|
+
query?: string;
|
|
31
|
+
limited_data_use?: boolean;
|
|
32
|
+
test_event_code?: string;
|
|
20
33
|
}
|
|
@@ -1,136 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
4
3
|
const common_fields_1 = require("../common_fields");
|
|
5
|
-
const
|
|
4
|
+
const utils_1 = require("../utils");
|
|
6
5
|
const action = {
|
|
7
|
-
title: 'Track Payment Offline Conversion',
|
|
8
|
-
description:
|
|
6
|
+
title: '[Deprecated] Track Payment Offline Conversion',
|
|
7
|
+
description: "[Deprecated] Send details of an in-store purchase or console purchase to the Tiktok Offline Events API. This Action has been Deprecated. Please use the 'Track Payment Offline Conversion' Action instead",
|
|
9
8
|
fields: {
|
|
10
|
-
...common_fields_1.commonFields
|
|
11
|
-
timestamp: {
|
|
12
|
-
label: 'Event Timestamp',
|
|
13
|
-
type: 'string',
|
|
14
|
-
description: 'Timestamp that the event took place, in ISO 8601 format. e.g. 2019-06-12T19:11:01.152Z',
|
|
15
|
-
default: {
|
|
16
|
-
'@path': '$.timestamp'
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
contents: {
|
|
20
|
-
label: 'Contents',
|
|
21
|
-
type: 'object',
|
|
22
|
-
multiple: true,
|
|
23
|
-
description: 'Array of product or content items for the offline event.',
|
|
24
|
-
properties: {
|
|
25
|
-
price: {
|
|
26
|
-
label: 'Price',
|
|
27
|
-
description: 'Price of the product or content item. Price is a required field for all content items.',
|
|
28
|
-
type: 'number'
|
|
29
|
-
},
|
|
30
|
-
quantity: {
|
|
31
|
-
label: 'Quantity',
|
|
32
|
-
description: 'Quantity of this product ot item in the offline event. Quantity is a required field for all content items.',
|
|
33
|
-
type: 'number'
|
|
34
|
-
},
|
|
35
|
-
content_type: {
|
|
36
|
-
label: 'Content Type',
|
|
37
|
-
description: 'Product type',
|
|
38
|
-
type: 'string'
|
|
39
|
-
},
|
|
40
|
-
content_id: {
|
|
41
|
-
label: 'Content ID',
|
|
42
|
-
description: 'Product or content item identifier. Content ID is a required field for all product or content items.',
|
|
43
|
-
type: 'string'
|
|
44
|
-
},
|
|
45
|
-
content_name: {
|
|
46
|
-
label: 'Content Name',
|
|
47
|
-
description: 'Name of the product or content item.',
|
|
48
|
-
type: 'string'
|
|
49
|
-
},
|
|
50
|
-
content_category: {
|
|
51
|
-
label: 'Content Category',
|
|
52
|
-
description: 'Category of the product or content item.',
|
|
53
|
-
type: 'string'
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
default: {
|
|
57
|
-
'@arrayPath': [
|
|
58
|
-
'$.properties.products',
|
|
59
|
-
{
|
|
60
|
-
price: {
|
|
61
|
-
'@path': 'price'
|
|
62
|
-
},
|
|
63
|
-
quantity: {
|
|
64
|
-
'@path': 'quantity'
|
|
65
|
-
},
|
|
66
|
-
content_type: {
|
|
67
|
-
'@path': 'type'
|
|
68
|
-
},
|
|
69
|
-
content_id: {
|
|
70
|
-
'@path': 'product_id'
|
|
71
|
-
},
|
|
72
|
-
content_name: {
|
|
73
|
-
'@path': 'name'
|
|
74
|
-
},
|
|
75
|
-
content_category: {
|
|
76
|
-
'@path': 'category'
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
]
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
currency: {
|
|
83
|
-
label: 'Currency',
|
|
84
|
-
type: 'string',
|
|
85
|
-
required: true,
|
|
86
|
-
description: 'ISO 4217 code. Required for revenue reporting. Example: "USD".List of currencies currently supported: AED, ARS, AUD, BDT, BHD, BIF, BOB, BRL, CAD, CHF, CLP, CNY, COP, CRC, CZK, DKK, DZD, EGP, EUR, GBP, GTQ, HKD, HNL, HUF, IDR, ILS, INR, ISK, JPY, KES, KHR, KRW, KWD, KZT, MAD, MOP, MXN, MYR, NGN, NIO, NOK, NZD, OMR, PEN, PHP, PHP, PKR, PLN, PYG, QAR, RON, RUB, SAR, SEK, SGD, THB, TRY, TWD, UAH, USD, VES, VND, ZAR.',
|
|
87
|
-
default: {
|
|
88
|
-
'@path': '$.properties.currency'
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
value: {
|
|
92
|
-
label: 'Value',
|
|
93
|
-
type: 'number',
|
|
94
|
-
required: true,
|
|
95
|
-
description: 'Revenue of total products or content items. Required for revenue reporting. Must be a number. e.g. 101.99 and not "101.99 USD"',
|
|
96
|
-
default: {
|
|
97
|
-
'@if': {
|
|
98
|
-
exists: { '@path': '$.properties.value' },
|
|
99
|
-
then: { '@path': '$.properties.value' },
|
|
100
|
-
else: { '@path': '$.properties.revenue' }
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
9
|
+
...common_fields_1.commonFields
|
|
104
10
|
},
|
|
105
11
|
perform: (request, { payload, settings }) => {
|
|
106
|
-
|
|
107
|
-
const emails = formatter_1.formatEmails(payload.email_addresses);
|
|
108
|
-
if (phone_numbers.length < 1 && emails.length < 1)
|
|
109
|
-
throw new actions_core_1.PayloadValidationError('TikTok Offline Conversions API requires an email address and/or phone number');
|
|
110
|
-
return request('https://business-api.tiktok.com/open_api/v1.3/offline/track/', {
|
|
111
|
-
method: 'post',
|
|
112
|
-
json: {
|
|
113
|
-
event_set_id: settings.eventSetID,
|
|
114
|
-
event: payload.event,
|
|
115
|
-
event_id: payload.event_id ? `${payload.event_id}` : undefined,
|
|
116
|
-
timestamp: payload.timestamp,
|
|
117
|
-
context: {
|
|
118
|
-
user: {
|
|
119
|
-
phone_numbers,
|
|
120
|
-
emails
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
properties: {
|
|
124
|
-
order_id: payload.order_id,
|
|
125
|
-
shop_id: payload.shop_id,
|
|
126
|
-
contents: payload.contents,
|
|
127
|
-
currency: payload.currency,
|
|
128
|
-
value: payload.value,
|
|
129
|
-
event_channel: payload.event_channel
|
|
130
|
-
},
|
|
131
|
-
partner_name: 'Segment'
|
|
132
|
-
}
|
|
133
|
-
});
|
|
12
|
+
return utils_1.performOfflineEvent(request, settings, payload);
|
|
134
13
|
}
|
|
135
14
|
};
|
|
136
15
|
exports.default = action;
|
package/dist/destinations/tiktok-offline-conversions/trackPaymentOfflineConversion/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/tiktok-offline-conversions/trackPaymentOfflineConversion/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/tiktok-offline-conversions/trackPaymentOfflineConversion/index.ts"],"names":[],"mappings":";;AAGA,oDAA+C;AAC/C,oCAA8C;AAE9C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,+CAA+C;IACtD,WAAW,EACT,2MAA2M;IAC7M,MAAM,EAAE;QACN,GAAG,4BAAY;KAChB;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,OAAO,2BAAmB,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAA;IACxD,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RequestClient } from '@segment/actions-core';
|
|
2
|
+
import { Settings } from './generated-types';
|
|
3
|
+
import { Payload as ReportOfflineEventPayload } from './reportOfflineEvent/generated-types';
|
|
4
|
+
import { Payload as TrackNonPaymentOfflineConversionPayload } from './trackNonPaymentOfflineConversion/generated-types';
|
|
5
|
+
import { Payload as TrackPaymentOfflineConversionPayload } from './trackPaymentOfflineConversion/generated-types';
|
|
6
|
+
declare type OfflineEventPayload = ReportOfflineEventPayload | TrackNonPaymentOfflineConversionPayload | TrackPaymentOfflineConversionPayload;
|
|
7
|
+
export declare function performOfflineEvent(request: RequestClient, settings: Settings, payload: OfflineEventPayload): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
8
|
+
export {};
|