@segment/action-destinations 3.341.0-staging.0 → 3.341.1-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/README.md +1 -1
- package/dist/destinations/acoustic-s3tc/receiveEvents/eventprocessing.js +6 -2
- package/dist/destinations/acoustic-s3tc/receiveEvents/eventprocessing.js.map +1 -1
- package/dist/destinations/acoustic-s3tc/receiveEvents/preCheck.js +7 -1
- package/dist/destinations/acoustic-s3tc/receiveEvents/preCheck.js.map +1 -1
- package/dist/destinations/aggregations-io/generated-types.d.ts +4 -0
- package/dist/destinations/aggregations-io/generated-types.js +3 -0
- package/dist/destinations/aggregations-io/generated-types.js.map +1 -0
- package/dist/destinations/aggregations-io/index.d.ts +4 -0
- package/dist/destinations/aggregations-io/index.js +48 -0
- package/dist/destinations/aggregations-io/index.js.map +1 -0
- package/dist/destinations/aggregations-io/send/generated-types.d.ts +7 -0
- package/dist/destinations/aggregations-io/send/generated-types.js +3 -0
- package/dist/destinations/aggregations-io/send/generated-types.js.map +1 -0
- package/dist/destinations/aggregations-io/send/index.d.ts +5 -0
- package/dist/destinations/aggregations-io/send/index.js +44 -0
- package/dist/destinations/aggregations-io/send/index.js.map +1 -0
- package/dist/destinations/airship/registerAndAssociate/generated-types.d.ts +3 -0
- package/dist/destinations/airship/registerAndAssociate/index.js +35 -7
- package/dist/destinations/airship/registerAndAssociate/index.js.map +1 -1
- package/dist/destinations/airship/utilities.d.ts +3 -1
- package/dist/destinations/airship/utilities.js +76 -41
- package/dist/destinations/airship/utilities.js.map +1 -1
- package/dist/destinations/algolia-insights/conversionEvents/generated-types.d.ts +2 -2
- package/dist/destinations/algolia-insights/conversionEvents/index.js +2 -2
- package/dist/destinations/algolia-insights/conversionEvents/index.js.map +1 -1
- package/dist/destinations/algolia-insights/productAddedEvents/generated-types.d.ts +2 -2
- package/dist/destinations/algolia-insights/productAddedEvents/index.js +2 -2
- package/dist/destinations/algolia-insights/productAddedEvents/index.js.map +1 -1
- package/dist/destinations/algolia-insights/productClickedEvents/generated-types.d.ts +2 -2
- package/dist/destinations/algolia-insights/productClickedEvents/index.js +2 -2
- package/dist/destinations/algolia-insights/productClickedEvents/index.js.map +1 -1
- package/dist/destinations/algolia-insights/productListFilteredEvents/generated-types.d.ts +2 -2
- package/dist/destinations/algolia-insights/productListFilteredEvents/index.js +2 -2
- package/dist/destinations/algolia-insights/productListFilteredEvents/index.js.map +1 -1
- package/dist/destinations/algolia-insights/productViewedEvents/generated-types.d.ts +2 -2
- package/dist/destinations/algolia-insights/productViewedEvents/index.js +2 -2
- package/dist/destinations/algolia-insights/productViewedEvents/index.js.map +1 -1
- package/dist/destinations/braze/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/addUserToAudience/index.js +5 -5
- package/dist/destinations/criteo-audiences/addUserToAudience/index.js.map +1 -1
- package/dist/destinations/criteo-audiences/criteo-audiences.js +10 -4
- package/dist/destinations/criteo-audiences/criteo-audiences.js.map +1 -1
- package/dist/destinations/criteo-audiences/removeUserFromAudience/index.js +5 -5
- package/dist/destinations/criteo-audiences/removeUserFromAudience/index.js.map +1 -1
- package/dist/destinations/devrev/createRevUser/index.js +9 -6
- package/dist/destinations/devrev/createRevUser/index.js.map +1 -1
- package/dist/destinations/devrev/utils/types.d.ts +9 -0
- package/dist/destinations/display-video-360/properties.js +4 -4
- package/dist/destinations/display-video-360/properties.js.map +1 -1
- package/dist/destinations/display-video-360/proto/protofile.d.ts +1 -0
- package/dist/destinations/display-video-360/proto/protofile.js +1 -0
- package/dist/destinations/display-video-360/proto/protofile.js.map +1 -1
- package/dist/destinations/display-video-360/shared.js +1 -0
- package/dist/destinations/display-video-360/shared.js.map +1 -1
- package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.js +0 -2
- package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.js.map +1 -1
- package/dist/destinations/engage/twilio/sendSms/SmsMessageSender.js +0 -3
- package/dist/destinations/engage/twilio/sendSms/SmsMessageSender.js.map +1 -1
- package/dist/destinations/engage/utils/EngageStats.js +0 -4
- package/dist/destinations/engage/utils/EngageStats.js.map +1 -1
- package/dist/destinations/equals/generated-types.d.ts +3 -0
- package/dist/destinations/equals/generated-types.js +3 -0
- package/dist/destinations/equals/generated-types.js.map +1 -0
- package/dist/destinations/equals/index.d.ts +4 -0
- package/dist/destinations/equals/index.js +38 -0
- package/dist/destinations/equals/index.js.map +1 -0
- package/dist/destinations/equals/send/generated-types.d.ts +5 -0
- package/dist/destinations/equals/send/generated-types.js +3 -0
- package/dist/destinations/equals/send/generated-types.js.map +1 -0
- package/dist/destinations/equals/send/index.d.ts +5 -0
- package/dist/destinations/equals/send/index.js +38 -0
- package/dist/destinations/equals/send/index.js.map +1 -0
- package/dist/destinations/facebook-conversions-api/fb-capi-app-data.js +1 -1
- package/dist/destinations/google-enhanced-conversions/functions.d.ts +1 -1
- package/dist/destinations/google-enhanced-conversions/functions.js +1 -1
- package/dist/destinations/google-enhanced-conversions/uploadCallConversion/index.js +1 -5
- package/dist/destinations/google-enhanced-conversions/uploadCallConversion/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js +1 -5
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js.map +1 -1
- package/dist/destinations/hubspot/sendCustomBehavioralEvent/index.js +0 -27
- package/dist/destinations/hubspot/sendCustomBehavioralEvent/index.js.map +1 -1
- package/dist/destinations/hubspot/utils.d.ts +0 -10
- package/dist/destinations/index.js +3 -1
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/kevel/generated-types.d.ts +4 -0
- package/dist/destinations/kevel/generated-types.js +3 -0
- package/dist/destinations/kevel/generated-types.js.map +1 -0
- package/dist/destinations/kevel/index.d.ts +4 -0
- package/dist/destinations/kevel/index.js +45 -0
- package/dist/destinations/kevel/index.js.map +1 -0
- package/dist/destinations/kevel/syncAudience/generated-types.d.ts +8 -0
- package/dist/destinations/kevel/syncAudience/generated-types.js +3 -0
- package/dist/destinations/kevel/syncAudience/generated-types.js.map +1 -0
- package/dist/destinations/kevel/syncAudience/index.d.ts +5 -0
- package/dist/destinations/kevel/syncAudience/index.js +64 -0
- package/dist/destinations/kevel/syncAudience/index.js.map +1 -0
- package/dist/destinations/kevel/syncTraits/generated-types.d.ts +6 -0
- package/dist/destinations/kevel/syncTraits/generated-types.js +3 -0
- package/dist/destinations/kevel/syncTraits/generated-types.js.map +1 -0
- package/dist/destinations/kevel/syncTraits/index.d.ts +5 -0
- package/dist/destinations/kevel/syncTraits/index.js +39 -0
- package/dist/destinations/kevel/syncTraits/index.js.map +1 -0
- package/dist/destinations/linkedin-conversions/streamConversion/index.js.map +1 -1
- package/dist/destinations/marketo-static-lists/addToList/index.js +2 -2
- package/dist/destinations/marketo-static-lists/addToList/index.js.map +1 -1
- package/dist/destinations/marketo-static-lists/functions.js +7 -7
- package/dist/destinations/marketo-static-lists/functions.js.map +1 -1
- package/dist/destinations/marketo-static-lists/removeFromList/index.js +2 -2
- package/dist/destinations/marketo-static-lists/removeFromList/index.js.map +1 -1
- package/dist/destinations/mixpanel/incrementProperties/__test__/index.test.d.ts +1 -0
- package/dist/destinations/mixpanel/incrementProperties/__test__/index.test.js +129 -0
- package/dist/destinations/mixpanel/incrementProperties/__test__/index.test.js.map +1 -0
- package/dist/destinations/mixpanel/incrementProperties/__test__/snapshot.test.d.ts +1 -0
- package/dist/destinations/mixpanel/incrementProperties/__test__/snapshot.test.js +69 -0
- package/dist/destinations/mixpanel/incrementProperties/__test__/snapshot.test.js.map +1 -0
- package/dist/destinations/mixpanel/incrementProperties/generated-types.d.ts +8 -0
- package/dist/destinations/mixpanel/incrementProperties/generated-types.js +3 -0
- package/dist/destinations/mixpanel/incrementProperties/generated-types.js.map +1 -0
- package/dist/destinations/mixpanel/incrementProperties/index.d.ts +5 -0
- package/dist/destinations/mixpanel/incrementProperties/index.js +84 -0
- package/dist/destinations/mixpanel/incrementProperties/index.js.map +1 -0
- package/dist/destinations/mixpanel/index.js +3 -1
- package/dist/destinations/mixpanel/index.js.map +1 -1
- package/dist/destinations/mixpanel/mixpanel-types.d.ts +4 -0
- package/dist/destinations/moengage/trackEvent/generated-types.d.ts +1 -0
- package/dist/destinations/moengage/trackEvent/index.js +10 -2
- package/dist/destinations/moengage/trackEvent/index.js.map +1 -1
- package/dist/destinations/segment/generated-types.d.ts +0 -1
- package/dist/destinations/segment/index.js +3 -13
- package/dist/destinations/segment/index.js.map +1 -1
- package/dist/destinations/segment/properties.d.ts +1 -1
- package/dist/destinations/segment/properties.js +3 -3
- package/dist/destinations/segment/properties.js.map +1 -1
- package/dist/destinations/segment/sendGroup/index.js +5 -16
- package/dist/destinations/segment/sendGroup/index.js.map +1 -1
- package/dist/destinations/segment/sendIdentify/index.js +5 -16
- package/dist/destinations/segment/sendIdentify/index.js.map +1 -1
- package/dist/destinations/segment/sendPage/index.js +5 -16
- package/dist/destinations/segment/sendPage/index.js.map +1 -1
- package/dist/destinations/segment/sendScreen/index.js +5 -16
- package/dist/destinations/segment/sendScreen/index.js.map +1 -1
- package/dist/destinations/segment/sendTrack/index.js +5 -16
- package/dist/destinations/segment/sendTrack/index.js.map +1 -1
- package/dist/destinations/segment-profiles/index.js +1 -3
- package/dist/destinations/segment-profiles/index.js.map +1 -1
- package/dist/destinations/segment-profiles/segment-properties.d.ts +0 -2
- package/dist/destinations/segment-profiles/segment-properties.js +1 -14
- package/dist/destinations/segment-profiles/segment-properties.js.map +1 -1
- package/dist/destinations/tiktok-conversions/index.js +3 -92
- 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 +24 -33
- package/dist/destinations/tiktok-conversions/reportWebEvent/formatter.js.map +1 -1
- package/dist/destinations/tiktok-conversions/reportWebEvent/generated-types.d.ts +4 -12
- package/dist/destinations/tiktok-conversions/reportWebEvent/index.js +40 -113
- package/dist/destinations/tiktok-conversions/reportWebEvent/index.js.map +1 -1
- package/dist/destinations/tiktok-offline-conversions/index.js +48 -199
- package/dist/destinations/tiktok-offline-conversions/index.js.map +1 -1
- package/dist/destinations/webhook-audiences/index.js +1 -3
- package/dist/destinations/webhook-audiences/index.js.map +1 -1
- package/dist/destinations/yahoo-audiences/index.js +9 -1
- package/dist/destinations/yahoo-audiences/index.js.map +1 -1
- package/dist/destinations/yahoo-audiences/updateSegment/generated-types.d.ts +6 -2
- package/dist/destinations/yahoo-audiences/updateSegment/index.js +36 -11
- package/dist/destinations/yahoo-audiences/updateSegment/index.js.map +1 -1
- package/dist/destinations/yahoo-audiences/utils-rt.js +3 -3
- package/dist/destinations/yahoo-audiences/utils-rt.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const segment_properties_1 = require("../segment-properties");
|
|
4
|
-
const properties_1 = require("../properties");
|
|
5
4
|
const errors_1 = require("../errors");
|
|
6
5
|
const action = {
|
|
7
6
|
title: 'Send Track',
|
|
@@ -28,7 +27,7 @@ const action = {
|
|
|
28
27
|
properties: segment_properties_1.properties,
|
|
29
28
|
traits: segment_properties_1.traits
|
|
30
29
|
},
|
|
31
|
-
perform: (
|
|
30
|
+
perform: (_request, { payload, statsContext }) => {
|
|
32
31
|
if (!payload.anonymous_id && !payload.user_id) {
|
|
33
32
|
throw errors_1.MissingUserOrAnonymousIdThrowableError;
|
|
34
33
|
}
|
|
@@ -57,21 +56,11 @@ const action = {
|
|
|
57
56
|
},
|
|
58
57
|
properties: {
|
|
59
58
|
...payload?.properties
|
|
60
|
-
}
|
|
59
|
+
},
|
|
60
|
+
type: 'track'
|
|
61
61
|
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
if (features && features['actions-segment-tapi-internal-enabled']) {
|
|
66
|
-
statsContext?.statsClient?.incr('tapi_internal', 1, [...statsContext.tags, 'action:sendTrack']);
|
|
67
|
-
const payload = { ...trackPayload, type: 'track' };
|
|
68
|
-
return { batch: [payload] };
|
|
69
|
-
}
|
|
70
|
-
const selectedSegmentEndpoint = properties_1.SEGMENT_ENDPOINTS[settings.endpoint].url;
|
|
71
|
-
return request(`${selectedSegmentEndpoint}/track`, {
|
|
72
|
-
method: 'POST',
|
|
73
|
-
json: trackPayload
|
|
74
|
-
});
|
|
62
|
+
statsContext?.statsClient?.incr('tapi_internal', 1, [...statsContext.tags, 'action:sendTrack']);
|
|
63
|
+
return { batch: [trackPayload] };
|
|
75
64
|
}
|
|
76
65
|
};
|
|
77
66
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment/sendTrack/index.ts"],"names":[],"mappings":";;AAGA,8DAoB8B;AAC9B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/segment/sendTrack/index.ts"],"names":[],"mappings":";;AAGA,8DAoB8B;AAC9B,sCAAkE;AAElE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,iGAAiG;IAC9G,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,OAAO,EAAP,4BAAO;QACP,YAAY,EAAZ,iCAAY;QACZ,SAAS,EAAT,8BAAS;QACT,UAAU,EAAV,+BAAU;QACV,WAAW,EAAX,gCAAW;QACX,mBAAmB,EAAnB,wCAAmB;QACnB,MAAM,EAAN,2BAAM;QACN,UAAU,EAAV,+BAAU;QACV,MAAM,EAAN,2BAAM;QACN,QAAQ,EAAR,6BAAQ;QACR,OAAO,EAAP,4BAAO;QACP,gBAAgB,EAAhB,qCAAgB;QAChB,IAAI,EAAJ,yBAAI;QACJ,MAAM,EAAN,2BAAM;QACN,UAAU,EAAV,+BAAU;QACV,QAAQ,EAAR,6BAAQ;QACR,QAAQ,EAAR,6BAAQ;QACR,UAAU,EAAV,+BAAU;QACV,MAAM,EAAN,2BAAM;KACP;IACD,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE;QAC/C,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;YAC7C,MAAM,+CAAsC,CAAA;SAC7C;QAED,MAAM,YAAY,GAAW;YAC3B,MAAM,EAAE,OAAO,EAAE,OAAO;YACxB,WAAW,EAAE,OAAO,EAAE,YAAY;YAClC,SAAS,EAAE,OAAO,EAAE,SAAS;YAC7B,KAAK,EAAE,OAAO,EAAE,UAAU;YAC1B,OAAO,EAAE;gBACP,MAAM,EAAE;oBACN,GAAG,OAAO,EAAE,MAAM;iBACnB;gBACD,GAAG,EAAE,OAAO,EAAE,WAAW;gBACzB,QAAQ,EAAE,OAAO,EAAE,mBAAmB;gBACtC,MAAM,EAAE,OAAO,EAAE,MAAM;gBACvB,EAAE,EAAE,OAAO,EAAE,UAAU;gBACvB,MAAM,EAAE,OAAO,EAAE,MAAM;gBACvB,QAAQ,EAAE,OAAO,EAAE,QAAQ;gBAC3B,OAAO,EAAE,OAAO,EAAE,OAAO;gBACzB,EAAE,EAAE,OAAO,EAAE,gBAAgB;gBAC7B,IAAI,EAAE,OAAO,EAAE,IAAI;gBACnB,MAAM,EAAE,OAAO,EAAE,MAAM;gBACvB,SAAS,EAAE,OAAO,EAAE,UAAU;gBAC9B,QAAQ,EAAE,OAAO,EAAE,QAAQ;gBAC3B,OAAO,EAAE,OAAO,EAAE,QAAQ;aAC3B;YACD,UAAU,EAAE;gBACV,GAAG,OAAO,EAAE,UAAU;aACvB;YACD,IAAI,EAAE,OAAO;SACd,CAAA;QAED,YAAY,EAAE,WAAW,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAA;QAC/F,OAAO,EAAE,KAAK,EAAE,CAAC,YAAY,CAAC,EAAE,CAAA;IAClC,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const sendGroup_1 = __importDefault(require("./sendGroup"));
|
|
7
7
|
const sendIdentify_1 = __importDefault(require("./sendIdentify"));
|
|
8
8
|
const sendSubscription_1 = __importDefault(require("./sendSubscription"));
|
|
9
|
-
const sendTrack_1 = __importDefault(require("./sendTrack"));
|
|
10
9
|
const destination = {
|
|
11
10
|
name: 'Segment Profiles',
|
|
12
11
|
slug: 'actions-segment-profiles',
|
|
@@ -14,8 +13,7 @@ const destination = {
|
|
|
14
13
|
actions: {
|
|
15
14
|
sendGroup: sendGroup_1.default,
|
|
16
15
|
sendIdentify: sendIdentify_1.default,
|
|
17
|
-
sendSubscription: sendSubscription_1.default
|
|
18
|
-
sendTrack: sendTrack_1.default
|
|
16
|
+
sendSubscription: sendSubscription_1.default
|
|
19
17
|
}
|
|
20
18
|
};
|
|
21
19
|
exports.default = destination;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/segment-profiles/index.ts"],"names":[],"mappings":";;;;;AAGA,4DAAmC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/segment-profiles/index.ts"],"names":[],"mappings":";;;;;AAGA,4DAAmC;AAEnC,kEAAyC;AAEzC,0EAAiD;AAEjD,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,0BAA0B;IAChC,IAAI,EAAE,OAAO;IACb,OAAO,EAAE;QACP,SAAS,EAAT,mBAAS;QACT,YAAY,EAAZ,sBAAY;QACZ,gBAAgB,EAAhB,0BAAgB;KACjB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -5,5 +5,3 @@ export declare const group_id: InputField;
|
|
|
5
5
|
export declare const traits: InputField;
|
|
6
6
|
export declare const engage_space: InputField;
|
|
7
7
|
export declare const timestamp: InputField;
|
|
8
|
-
export declare const event_name: InputField;
|
|
9
|
-
export declare const properties: InputField;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.timestamp = exports.engage_space = exports.traits = exports.group_id = exports.anonymous_id = exports.user_id = void 0;
|
|
4
4
|
exports.user_id = {
|
|
5
5
|
label: 'User ID',
|
|
6
6
|
description: 'Unique identifier for the user in your database. A userId or an anonymousId is required.',
|
|
@@ -38,17 +38,4 @@ exports.timestamp = {
|
|
|
38
38
|
'@path': '$.timestamp'
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
-
exports.event_name = {
|
|
42
|
-
label: 'Event Name',
|
|
43
|
-
description: 'Name of the action that a user has performed.',
|
|
44
|
-
type: 'string',
|
|
45
|
-
required: true
|
|
46
|
-
};
|
|
47
|
-
exports.properties = {
|
|
48
|
-
label: 'Properties',
|
|
49
|
-
description: 'Free-form dictionary of properties that describe the screen.',
|
|
50
|
-
type: 'object',
|
|
51
|
-
defaultObjectUI: 'keyvalue',
|
|
52
|
-
additionalProperties: true
|
|
53
|
-
};
|
|
54
41
|
//# sourceMappingURL=segment-properties.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segment-properties.js","sourceRoot":"","sources":["../../../src/destinations/segment-profiles/segment-properties.ts"],"names":[],"mappings":";;;AAEa,QAAA,OAAO,GAAe;IACjC,KAAK,EAAE,SAAS;IAChB,WAAW,EAAE,0FAA0F;IACvG,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,YAAY,GAAe;IACtC,KAAK,EAAE,cAAc;IACrB,WAAW,EACT,kJAAkJ;IACpJ,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,QAAQ,GAAe;IAClC,KAAK,EAAE,UAAU;IACjB,WAAW,EAAE,oDAAoD;IACjE,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,MAAM,GAAe;IAChC,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,0EAA0E;IACvF,IAAI,EAAE,QAAQ;IACd,eAAe,EAAE,UAAU;IAC3B,oBAAoB,EAAE,IAAI;CAC3B,CAAA;AAEY,QAAA,YAAY,GAAe;IACtC,KAAK,EAAE,eAAe;IACtB,WAAW,EACT,sSAAsS;IACxS,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,IAAI;CACd,CAAA;AAEY,QAAA,SAAS,GAAe;IACnC,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,6BAA6B;IAC1C,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE;QACP,OAAO,EAAE,aAAa;KACvB;CACF,CAAA
|
|
1
|
+
{"version":3,"file":"segment-properties.js","sourceRoot":"","sources":["../../../src/destinations/segment-profiles/segment-properties.ts"],"names":[],"mappings":";;;AAEa,QAAA,OAAO,GAAe;IACjC,KAAK,EAAE,SAAS;IAChB,WAAW,EAAE,0FAA0F;IACvG,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,YAAY,GAAe;IACtC,KAAK,EAAE,cAAc;IACrB,WAAW,EACT,kJAAkJ;IACpJ,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,QAAQ,GAAe;IAClC,KAAK,EAAE,UAAU;IACjB,WAAW,EAAE,oDAAoD;IACjE,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,MAAM,GAAe;IAChC,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,0EAA0E;IACvF,IAAI,EAAE,QAAQ;IACd,eAAe,EAAE,UAAU;IAC3B,oBAAoB,EAAE,IAAI;CAC3B,CAAA;AAEY,QAAA,YAAY,GAAe;IACtC,KAAK,EAAE,eAAe;IACtB,WAAW,EACT,sSAAsS;IACxS,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,IAAI;CACd,CAAA;AAEY,QAAA,SAAS,GAAe;IACnC,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,6BAA6B;IAC1C,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE;QACP,OAAO,EAAE,aAAa;KACvB;CACF,CAAA"}
|
|
@@ -12,17 +12,11 @@ const productProperties = {
|
|
|
12
12
|
quantity: {
|
|
13
13
|
'@path': '$.quantity'
|
|
14
14
|
},
|
|
15
|
-
|
|
15
|
+
content_type: {
|
|
16
16
|
'@path': '$.category'
|
|
17
17
|
},
|
|
18
18
|
content_id: {
|
|
19
19
|
'@path': '$.product_id'
|
|
20
|
-
},
|
|
21
|
-
content_name: {
|
|
22
|
-
'@path': '$.name'
|
|
23
|
-
},
|
|
24
|
-
brand: {
|
|
25
|
-
'@path': '$.brand'
|
|
26
20
|
}
|
|
27
21
|
};
|
|
28
22
|
const singleProductContents = {
|
|
@@ -48,19 +42,9 @@ const multiProductContents = {
|
|
|
48
42
|
}
|
|
49
43
|
};
|
|
50
44
|
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
45
|
{
|
|
62
46
|
name: 'View Content',
|
|
63
|
-
subscribe: '
|
|
47
|
+
subscribe: 'type="page"',
|
|
64
48
|
partnerAction: 'reportWebEvent',
|
|
65
49
|
mapping: {
|
|
66
50
|
...singleProductContents,
|
|
@@ -68,16 +52,6 @@ const presets = [
|
|
|
68
52
|
},
|
|
69
53
|
type: 'automatic'
|
|
70
54
|
},
|
|
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
55
|
{
|
|
82
56
|
name: 'Search',
|
|
83
57
|
subscribe: 'event = "Products Searched"',
|
|
@@ -137,66 +111,6 @@ const presets = [
|
|
|
137
111
|
event: 'PlaceAnOrder'
|
|
138
112
|
},
|
|
139
113
|
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(reportWebEvent_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(reportWebEvent_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(reportWebEvent_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(reportWebEvent_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(reportWebEvent_1.default.fields),
|
|
197
|
-
event: 'Subscribe'
|
|
198
|
-
},
|
|
199
|
-
type: 'automatic'
|
|
200
114
|
}
|
|
201
115
|
];
|
|
202
116
|
const destination = {
|
|
@@ -233,10 +147,7 @@ const destination = {
|
|
|
233
147
|
},
|
|
234
148
|
extendRequest({ settings }) {
|
|
235
149
|
return {
|
|
236
|
-
headers: {
|
|
237
|
-
'Access-Token': settings.accessToken,
|
|
238
|
-
'Content-Type': 'application/json'
|
|
239
|
-
}
|
|
150
|
+
headers: { 'Access-Token': settings.accessToken }
|
|
240
151
|
};
|
|
241
152
|
},
|
|
242
153
|
presets,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/tiktok-conversions/index.ts"],"names":[],"mappings":";;;;;AACA,wDAAqD;AAGrD,sEAA6C;AAE7C,MAAM,iBAAiB,GAAG;IACxB,KAAK,EAAE;QACL,OAAO,EAAE,SAAS;KACnB;IACD,QAAQ,EAAE;QACR,OAAO,EAAE,YAAY;KACtB;IACD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/tiktok-conversions/index.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
export declare function
|
|
3
|
-
export declare
|
|
1
|
+
export declare function formatEmail(email: string | undefined): string | undefined;
|
|
2
|
+
export declare function formatUserId(userId: string | undefined): string | undefined;
|
|
3
|
+
export declare function formatPhone(phone: string | undefined): string | undefined;
|
|
@@ -1,42 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.formatPhone = exports.formatUserId = exports.formatEmail = void 0;
|
|
4
4
|
const crypto_1 = require("crypto");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
email_addresses.forEach((email) => {
|
|
9
|
-
result.push(hashAndEncode(email.toLowerCase()));
|
|
10
|
-
});
|
|
5
|
+
function formatEmail(email) {
|
|
6
|
+
if (email) {
|
|
7
|
+
return hashAndEncode(email.toLowerCase());
|
|
11
8
|
}
|
|
12
|
-
return
|
|
13
|
-
}
|
|
14
|
-
exports.
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
exports.formatEmail = formatEmail;
|
|
12
|
+
function formatUserId(userId) {
|
|
13
|
+
if (userId) {
|
|
14
|
+
return hashAndEncode(userId.toLowerCase().trim());
|
|
15
|
+
}
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
exports.formatUserId = formatUserId;
|
|
19
|
+
function formatPhone(phone) {
|
|
20
|
+
if (!phone)
|
|
21
|
+
return undefined;
|
|
22
|
+
const validatedPhone = phone.match(/[0-9]{0,14}/g);
|
|
23
|
+
if (validatedPhone === null) {
|
|
24
|
+
throw new Error(`${phone} is not a valid E.164 phone number.`);
|
|
21
25
|
}
|
|
22
|
-
|
|
26
|
+
let formattedPhone = `+${phone.replace(/[^0-9]/g, '')}`;
|
|
27
|
+
formattedPhone = formattedPhone.substring(0, 15);
|
|
28
|
+
return hashAndEncode(formattedPhone);
|
|
23
29
|
}
|
|
24
|
-
exports.
|
|
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;
|
|
30
|
+
exports.formatPhone = formatPhone;
|
|
40
31
|
function hashAndEncode(property) {
|
|
41
32
|
return crypto_1.createHash('sha256').update(property).digest('hex');
|
|
42
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatter.js","sourceRoot":"","sources":["../../../../src/destinations/tiktok-conversions/reportWebEvent/formatter.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;
|
|
1
|
+
{"version":3,"file":"formatter.js","sourceRoot":"","sources":["../../../../src/destinations/tiktok-conversions/reportWebEvent/formatter.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AAKnC,SAAgB,WAAW,CAAC,KAAyB;IACnD,IAAI,KAAK,EAAE;QACT,OAAO,aAAa,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAA;KAC1C;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AALD,kCAKC;AAOD,SAAgB,YAAY,CAAC,MAA0B;IACrD,IAAI,MAAM,EAAE;QACV,OAAO,aAAa,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,CAAA;KAClD;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AALD,oCAKC;AAOD,SAAgB,WAAW,CAAC,KAAyB;IACnD,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAA;IAE5B,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;IAClD,IAAI,cAAc,KAAK,IAAI,EAAE;QAC3B,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,qCAAqC,CAAC,CAAA;KAC/D;IAED,IAAI,cAAc,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAA;IAEvD,cAAc,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IAChD,OAAO,aAAa,CAAC,cAAc,CAAC,CAAA;AACtC,CAAC;AAZD,kCAYC;AAED,SAAS,aAAa,CAAC,QAAgB;IACrC,OAAO,mBAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC5D,CAAC"}
|
|
@@ -2,13 +2,11 @@ export interface Payload {
|
|
|
2
2
|
event: string;
|
|
3
3
|
event_id?: string;
|
|
4
4
|
timestamp?: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
phone_number?: string;
|
|
6
|
+
email?: string;
|
|
7
|
+
external_id?: string;
|
|
8
8
|
ttclid?: string;
|
|
9
|
-
ttp?: string;
|
|
10
9
|
lead_id?: string;
|
|
11
|
-
locale?: string;
|
|
12
10
|
url?: string;
|
|
13
11
|
referrer?: string;
|
|
14
12
|
ip?: string;
|
|
@@ -16,18 +14,12 @@ export interface Payload {
|
|
|
16
14
|
contents?: {
|
|
17
15
|
price?: number;
|
|
18
16
|
quantity?: number;
|
|
19
|
-
|
|
17
|
+
content_type?: string;
|
|
20
18
|
content_id?: string;
|
|
21
|
-
content_name?: string;
|
|
22
|
-
brand?: string;
|
|
23
19
|
}[];
|
|
24
|
-
content_type?: string;
|
|
25
20
|
currency?: string;
|
|
26
21
|
value?: number;
|
|
27
22
|
description?: string;
|
|
28
23
|
query?: string;
|
|
29
|
-
order_id?: string;
|
|
30
|
-
shop_id?: string;
|
|
31
|
-
limited_data_use?: boolean;
|
|
32
24
|
test_event_code?: string;
|
|
33
25
|
}
|
|
@@ -27,11 +27,10 @@ const action = {
|
|
|
27
27
|
'@path': '$.timestamp'
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
|
-
|
|
30
|
+
phone_number: {
|
|
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,
|
|
35
34
|
default: {
|
|
36
35
|
'@if': {
|
|
37
36
|
exists: { '@path': '$.properties.phone' },
|
|
@@ -40,12 +39,11 @@ const action = {
|
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
41
|
},
|
|
43
|
-
|
|
42
|
+
email: {
|
|
44
43
|
label: 'Email',
|
|
45
44
|
description: 'Email address of the user who triggered the conversion event. Segment will hash this value before sending to TikTok.',
|
|
46
45
|
type: 'string',
|
|
47
46
|
format: 'email',
|
|
48
|
-
multiple: true,
|
|
49
47
|
default: {
|
|
50
48
|
'@if': {
|
|
51
49
|
exists: { '@path': '$.properties.email' },
|
|
@@ -54,11 +52,10 @@ const action = {
|
|
|
54
52
|
}
|
|
55
53
|
}
|
|
56
54
|
},
|
|
57
|
-
|
|
55
|
+
external_id: {
|
|
58
56
|
label: 'External ID',
|
|
59
57
|
description: 'Uniquely identifies the user who triggered the conversion event. Segment will hash this value before sending to TikTok.',
|
|
60
58
|
type: 'string',
|
|
61
|
-
multiple: true,
|
|
62
59
|
default: {
|
|
63
60
|
'@if': {
|
|
64
61
|
exists: { '@path': '$.userId' },
|
|
@@ -79,18 +76,6 @@ const action = {
|
|
|
79
76
|
}
|
|
80
77
|
}
|
|
81
78
|
},
|
|
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
|
-
},
|
|
94
79
|
lead_id: {
|
|
95
80
|
label: 'TikTok Lead ID',
|
|
96
81
|
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',
|
|
@@ -103,14 +88,6 @@ const action = {
|
|
|
103
88
|
}
|
|
104
89
|
}
|
|
105
90
|
},
|
|
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
|
-
},
|
|
114
91
|
url: {
|
|
115
92
|
label: 'Page URL',
|
|
116
93
|
type: 'string',
|
|
@@ -159,35 +136,18 @@ const action = {
|
|
|
159
136
|
description: 'Number of items.',
|
|
160
137
|
type: 'number'
|
|
161
138
|
},
|
|
162
|
-
|
|
163
|
-
label: 'Content
|
|
164
|
-
description: '
|
|
139
|
+
content_type: {
|
|
140
|
+
label: 'Content Type',
|
|
141
|
+
description: 'Type of the product item.',
|
|
165
142
|
type: 'string'
|
|
166
143
|
},
|
|
167
144
|
content_id: {
|
|
168
145
|
label: 'Content ID',
|
|
169
146
|
description: 'ID of the product item.',
|
|
170
147
|
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'
|
|
181
148
|
}
|
|
182
149
|
}
|
|
183
150
|
},
|
|
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
|
-
},
|
|
191
151
|
currency: {
|
|
192
152
|
label: 'Currency',
|
|
193
153
|
type: 'string',
|
|
@@ -221,30 +181,6 @@ const action = {
|
|
|
221
181
|
'@path': '$.properties.query'
|
|
222
182
|
}
|
|
223
183
|
},
|
|
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
|
-
},
|
|
248
184
|
test_event_code: {
|
|
249
185
|
label: 'Test Event Code',
|
|
250
186
|
type: 'string',
|
|
@@ -253,9 +189,9 @@ const action = {
|
|
|
253
189
|
},
|
|
254
190
|
perform: (request, { payload, settings }) => {
|
|
255
191
|
const userData = {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
192
|
+
hashedExternalId: formatter_1.formatUserId(payload.external_id),
|
|
193
|
+
hashedEmail: formatter_1.formatEmail(payload.email),
|
|
194
|
+
hashedPhoneNumber: formatter_1.formatPhone(payload.phone_number)
|
|
259
195
|
};
|
|
260
196
|
let payloadUrl, urlTtclid;
|
|
261
197
|
if (payload.url) {
|
|
@@ -267,48 +203,39 @@ const action = {
|
|
|
267
203
|
}
|
|
268
204
|
if (payloadUrl)
|
|
269
205
|
urlTtclid = payloadUrl.searchParams.get('ttclid');
|
|
270
|
-
return request('https://business-api.tiktok.com/open_api/v1.3/
|
|
206
|
+
return request('https://business-api.tiktok.com/open_api/v1.3/pixel/track/', {
|
|
271
207
|
method: 'post',
|
|
272
208
|
json: {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
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
|
-
]
|
|
209
|
+
pixel_code: settings.pixelCode,
|
|
210
|
+
event: payload.event,
|
|
211
|
+
event_id: payload.event_id ? `${payload.event_id}` : undefined,
|
|
212
|
+
timestamp: payload.timestamp,
|
|
213
|
+
test_event_code: payload.test_event_code,
|
|
214
|
+
context: {
|
|
215
|
+
user: {
|
|
216
|
+
external_id: userData.hashedExternalId,
|
|
217
|
+
phone_number: userData.hashedPhoneNumber,
|
|
218
|
+
email: userData.hashedEmail,
|
|
219
|
+
lead_id: payload.lead_id
|
|
220
|
+
},
|
|
221
|
+
ad: {
|
|
222
|
+
callback: payload.ttclid ? payload.ttclid : urlTtclid ? urlTtclid : undefined
|
|
223
|
+
},
|
|
224
|
+
page: {
|
|
225
|
+
url: payload.url,
|
|
226
|
+
referrer: payload.referrer
|
|
227
|
+
},
|
|
228
|
+
ip: payload.ip,
|
|
229
|
+
user_agent: payload.user_agent
|
|
230
|
+
},
|
|
231
|
+
properties: {
|
|
232
|
+
contents: payload.contents,
|
|
233
|
+
currency: payload.currency,
|
|
234
|
+
value: payload.value,
|
|
235
|
+
description: payload.description,
|
|
236
|
+
query: payload.query
|
|
237
|
+
},
|
|
238
|
+
partner_name: 'Segment'
|
|
312
239
|
}
|
|
313
240
|
});
|
|
314
241
|
}
|