@segment/action-destinations 3.438.0 → 3.440.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/destinations/aws-kinesis/generated-types.d.ts +2 -0
- package/dist/destinations/aws-kinesis/generated-types.js.map +1 -0
- package/dist/destinations/aws-kinesis/index.d.ts +4 -0
- package/dist/destinations/aws-kinesis/index.js +24 -0
- package/dist/destinations/aws-kinesis/index.js.map +1 -0
- package/dist/destinations/aws-kinesis/send/generated-types.d.ts +8 -0
- package/dist/destinations/aws-kinesis/send/generated-types.js.map +1 -0
- package/dist/destinations/{yonoma/sendEvent → aws-kinesis/send}/index.d.ts +1 -1
- package/dist/destinations/aws-kinesis/send/index.js +41 -0
- package/dist/destinations/aws-kinesis/send/index.js.map +1 -0
- package/dist/destinations/criteo-audiences/addUserToAudience/generated-types.d.ts +1 -0
- package/dist/destinations/criteo-audiences/addUserToAudience/index.js +7 -0
- package/dist/destinations/criteo-audiences/addUserToAudience/index.js.map +1 -1
- package/dist/destinations/criteo-audiences/removeUserFromAudience/generated-types.d.ts +1 -0
- package/dist/destinations/criteo-audiences/removeUserFromAudience/index.js +7 -0
- package/dist/destinations/criteo-audiences/removeUserFromAudience/index.js.map +1 -1
- package/dist/destinations/first-party-dv360/index.js +1 -1
- package/dist/destinations/first-party-dv360/index.js.map +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 +2 -2
- package/dist/destinations/google-enhanced-conversions/uploadCallConversion2/index.js +2 -2
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion/index.js +2 -2
- package/dist/destinations/google-enhanced-conversions/uploadClickConversion2/index.js +2 -2
- package/dist/destinations/google-enhanced-conversions/userList/index.js +3 -3
- package/dist/destinations/google-enhanced-conversions/userList/index.js.map +1 -1
- package/dist/destinations/linkedin-audiences/{api/index.d.ts → api.d.ts} +3 -3
- package/dist/destinations/linkedin-audiences/{api/index.js → api.js} +2 -2
- package/dist/destinations/linkedin-audiences/api.js.map +1 -0
- package/dist/destinations/linkedin-audiences/updateAudience/fields.d.ts +2 -0
- package/dist/destinations/linkedin-audiences/updateAudience/fields.js +126 -0
- package/dist/destinations/linkedin-audiences/updateAudience/fields.js.map +1 -0
- package/dist/destinations/linkedin-audiences/updateAudience/functions.d.ts +5 -0
- package/dist/destinations/linkedin-audiences/updateAudience/functions.js +112 -0
- package/dist/destinations/linkedin-audiences/updateAudience/functions.js.map +1 -0
- package/dist/destinations/linkedin-audiences/updateAudience/index.js +5 -232
- package/dist/destinations/linkedin-audiences/updateAudience/index.js.map +1 -1
- package/dist/destinations/ms-bing-ads-audiences/index.js +1 -1
- package/dist/destinations/ms-bing-ads-audiences/index.js.map +1 -1
- package/dist/destinations/ms-bing-ads-audiences/syncAudiences/fields.js +13 -17
- package/dist/destinations/ms-bing-ads-audiences/syncAudiences/fields.js.map +1 -1
- package/dist/destinations/snap-audiences/constants.d.ts +2 -0
- package/dist/destinations/snap-audiences/constants.js +6 -0
- package/dist/destinations/snap-audiences/constants.js.map +1 -0
- package/dist/destinations/snap-audiences/index.js +24 -40
- package/dist/destinations/snap-audiences/index.js.map +1 -1
- package/dist/destinations/snap-audiences/syncAudience/constants.d.ts +5 -0
- package/dist/destinations/snap-audiences/syncAudience/constants.js +9 -0
- package/dist/destinations/snap-audiences/syncAudience/constants.js.map +1 -0
- package/dist/destinations/snap-audiences/syncAudience/fields.d.ts +2 -0
- package/dist/destinations/snap-audiences/syncAudience/fields.js +90 -0
- package/dist/destinations/snap-audiences/syncAudience/fields.js.map +1 -0
- package/dist/destinations/snap-audiences/syncAudience/functions.d.ts +5 -0
- package/dist/destinations/snap-audiences/syncAudience/functions.js +119 -0
- package/dist/destinations/snap-audiences/syncAudience/functions.js.map +1 -0
- package/dist/destinations/snap-audiences/syncAudience/generated-types.d.ts +2 -1
- package/dist/destinations/snap-audiences/syncAudience/index.js +6 -146
- package/dist/destinations/snap-audiences/syncAudience/index.js.map +1 -1
- package/dist/destinations/snap-audiences/syncAudience/types.d.ts +18 -0
- package/dist/destinations/snap-audiences/syncAudience/types.js.map +1 -0
- package/dist/destinations/snap-audiences/types.d.ts +19 -0
- package/dist/destinations/snap-audiences/types.js.map +1 -0
- package/dist/destinations/stackadapt-audiences/common-constants.d.ts +2 -0
- package/dist/destinations/stackadapt-audiences/common-constants.js +6 -0
- package/dist/destinations/stackadapt-audiences/common-constants.js.map +1 -0
- package/dist/destinations/stackadapt-audiences/common-functions.d.ts +0 -7
- package/dist/destinations/stackadapt-audiences/common-functions.js +0 -193
- package/dist/destinations/stackadapt-audiences/common-functions.js.map +1 -1
- package/dist/destinations/stackadapt-audiences/common-types.d.ts +15 -0
- package/dist/destinations/stackadapt-audiences/common-types.js +3 -0
- package/dist/destinations/stackadapt-audiences/common-types.js.map +1 -0
- package/dist/destinations/stackadapt-audiences/{constants.js → forwardAudienceEvent/constants.js} +1 -22
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/constants.js.map +1 -0
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/fields.d.ts +1 -0
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/fields.js +184 -1
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/fields.js.map +1 -1
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/functions.d.ts +6 -0
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/functions.js +184 -0
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/functions.js.map +1 -0
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/generated-types.d.ts +0 -3
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/index.js +4 -5
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/index.js.map +1 -1
- package/dist/destinations/stackadapt-audiences/{types.d.ts → forwardAudienceEvent/types.d.ts} +0 -15
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/types.js +3 -0
- package/dist/destinations/stackadapt-audiences/forwardAudienceEvent/types.js.map +1 -0
- package/dist/destinations/stackadapt-audiences/index.d.ts +1 -1
- package/dist/destinations/stackadapt-audiences/index.js +5 -7
- package/dist/destinations/stackadapt-audiences/index.js.map +1 -1
- package/dist/destinations/yonoma/index.js +0 -2
- package/dist/destinations/yonoma/index.js.map +1 -1
- package/dist/destinations/yonoma/trackEvent/generated-types.d.ts +24 -3
- package/dist/destinations/yonoma/trackEvent/index.js +140 -16
- package/dist/destinations/yonoma/trackEvent/index.js.map +1 -1
- package/dist/destinations/yonoma/trackEvent/types.d.ts +24 -3
- package/dist/destinations/yonoma/trackPageView/generated-types.d.ts +23 -7
- package/dist/destinations/yonoma/trackPageView/index.js +133 -50
- package/dist/destinations/yonoma/trackPageView/index.js.map +1 -1
- package/dist/destinations/yonoma/trackPageView/types.d.ts +22 -4
- package/dist/destinations/yonoma/upsertContact/generated-types.d.ts +25 -3
- package/dist/destinations/yonoma/upsertContact/index.js +153 -21
- package/dist/destinations/yonoma/upsertContact/index.js.map +1 -1
- package/dist/destinations/yonoma/upsertContact/types.d.ts +26 -4
- package/package.json +2 -2
- package/dist/destinations/linkedin-audiences/api/index.js.map +0 -1
- package/dist/destinations/snap-audiences/syncAudience/utils.d.ts +0 -8
- package/dist/destinations/snap-audiences/syncAudience/utils.js +0 -61
- package/dist/destinations/snap-audiences/syncAudience/utils.js.map +0 -1
- package/dist/destinations/stackadapt-audiences/common-fields.d.ts +0 -2
- package/dist/destinations/stackadapt-audiences/common-fields.js +0 -227
- package/dist/destinations/stackadapt-audiences/common-fields.js.map +0 -1
- package/dist/destinations/stackadapt-audiences/constants.js.map +0 -1
- package/dist/destinations/stackadapt-audiences/forwardProfile/generated-types.d.ts +0 -26
- package/dist/destinations/stackadapt-audiences/forwardProfile/generated-types.js.map +0 -1
- package/dist/destinations/stackadapt-audiences/forwardProfile/index.d.ts +0 -5
- package/dist/destinations/stackadapt-audiences/forwardProfile/index.js +0 -140
- package/dist/destinations/stackadapt-audiences/forwardProfile/index.js.map +0 -1
- package/dist/destinations/stackadapt-audiences/types.js.map +0 -1
- package/dist/destinations/yonoma/sendEvent/constants.d.ts +0 -1
- package/dist/destinations/yonoma/sendEvent/constants.js +0 -5
- package/dist/destinations/yonoma/sendEvent/constants.js.map +0 -1
- package/dist/destinations/yonoma/sendEvent/functions.d.ts +0 -1
- package/dist/destinations/yonoma/sendEvent/functions.js +0 -19
- package/dist/destinations/yonoma/sendEvent/functions.js.map +0 -1
- package/dist/destinations/yonoma/sendEvent/generated-types.d.ts +0 -13
- package/dist/destinations/yonoma/sendEvent/generated-types.js.map +0 -1
- package/dist/destinations/yonoma/sendEvent/index.js +0 -103
- package/dist/destinations/yonoma/sendEvent/index.js.map +0 -1
- package/dist/destinations/yonoma/sendEvent/types.d.ts +0 -10
- package/dist/destinations/yonoma/sendEvent/types.js.map +0 -1
- /package/dist/destinations/{stackadapt-audiences/forwardProfile → aws-kinesis}/generated-types.js +0 -0
- /package/dist/destinations/{yonoma/sendEvent → aws-kinesis/send}/generated-types.js +0 -0
- /package/dist/destinations/{stackadapt-audiences → snap-audiences/syncAudience}/types.js +0 -0
- /package/dist/destinations/{yonoma/sendEvent → snap-audiences}/types.js +0 -0
- /package/dist/destinations/stackadapt-audiences/{constants.d.ts → forwardAudienceEvent/constants.d.ts} +0 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processPayload = processPayload;
|
|
4
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
5
|
+
const api_1 = require("../api");
|
|
6
|
+
const hashing_utils_1 = require("../../../lib/hashing-utils");
|
|
7
|
+
async function processPayload(request, settings, payloads, statsContext) {
|
|
8
|
+
validate(settings, payloads);
|
|
9
|
+
const linkedinApiClient = new api_1.LinkedInAudiences(request);
|
|
10
|
+
const dmpSegmentId = await getDmpSegmentId(linkedinApiClient, settings, payloads[0], statsContext);
|
|
11
|
+
const elements = extractUsers(settings, payloads);
|
|
12
|
+
if (elements.length < 1) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
statsContext?.statsClient?.incr('oauth_app_api_call', 1, [
|
|
16
|
+
...statsContext?.tags,
|
|
17
|
+
`endpoint:add-or-remove-users-from-dmpSegment`
|
|
18
|
+
]);
|
|
19
|
+
const res = await linkedinApiClient.batchUpdate(dmpSegmentId, elements);
|
|
20
|
+
if (res.status !== 200) {
|
|
21
|
+
throw new actions_core_1.RetryableError('Error while attempting to update LinkedIn DMP Segment. This batch will be retried.');
|
|
22
|
+
}
|
|
23
|
+
return res;
|
|
24
|
+
}
|
|
25
|
+
function validate(settings, payloads) {
|
|
26
|
+
const isAutoOrUndefined = ['AUTO', undefined].includes(payloads[0]?.dmp_user_action);
|
|
27
|
+
if (isAutoOrUndefined && payloads[0].source_segment_id !== payloads[0].personas_audience_key) {
|
|
28
|
+
throw new actions_core_1.IntegrationError('The value of `source_segment_id` and `personas_audience_key` must match.', 'INVALID_SETTINGS', 400);
|
|
29
|
+
}
|
|
30
|
+
if (!settings.send_google_advertising_id && !settings.send_email) {
|
|
31
|
+
throw new actions_core_1.IntegrationError('At least one of `Send Email` or `Send Google Advertising ID` must be set to `true`.', 'INVALID_SETTINGS', 400);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async function getDmpSegmentId(linkedinApiClient, settings, payload, statsContext) {
|
|
35
|
+
statsContext?.statsClient?.incr('oauth_app_api_call', 1, [...statsContext?.tags, `endpoint:get-dmpSegment`]);
|
|
36
|
+
const res = await linkedinApiClient.getDmpSegment(settings, payload);
|
|
37
|
+
const body = await res.json();
|
|
38
|
+
if (body.elements?.length > 0) {
|
|
39
|
+
return body.elements[0].id;
|
|
40
|
+
}
|
|
41
|
+
return createDmpSegment(linkedinApiClient, settings, payload, statsContext);
|
|
42
|
+
}
|
|
43
|
+
async function createDmpSegment(linkedinApiClient, settings, payload, statsContext) {
|
|
44
|
+
statsContext?.statsClient?.incr('oauth_app_api_call', 1, [...statsContext?.tags, `endpoint:create-dmpSegment`]);
|
|
45
|
+
const res = await linkedinApiClient.createDmpSegment(settings, payload);
|
|
46
|
+
const headers = res.headers.toJSON();
|
|
47
|
+
return headers['x-linkedin-id'];
|
|
48
|
+
}
|
|
49
|
+
function extractUsers(settings, payloads) {
|
|
50
|
+
const elements = [];
|
|
51
|
+
payloads.forEach((payload) => {
|
|
52
|
+
if (!payload.email && !payload.google_advertising_id) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const linkedinAudiencePayload = {
|
|
56
|
+
action: getAction(payload),
|
|
57
|
+
userIds: getUserIds(settings, payload)
|
|
58
|
+
};
|
|
59
|
+
if (payload.first_name) {
|
|
60
|
+
linkedinAudiencePayload.firstName = payload.first_name;
|
|
61
|
+
}
|
|
62
|
+
if (payload.last_name) {
|
|
63
|
+
linkedinAudiencePayload.lastName = payload.last_name;
|
|
64
|
+
}
|
|
65
|
+
if (payload.title) {
|
|
66
|
+
linkedinAudiencePayload.title = payload.title;
|
|
67
|
+
}
|
|
68
|
+
if (payload.company) {
|
|
69
|
+
linkedinAudiencePayload.company = payload.company;
|
|
70
|
+
}
|
|
71
|
+
if (payload.country) {
|
|
72
|
+
linkedinAudiencePayload.country = payload.country;
|
|
73
|
+
}
|
|
74
|
+
elements.push(linkedinAudiencePayload);
|
|
75
|
+
});
|
|
76
|
+
return elements;
|
|
77
|
+
}
|
|
78
|
+
function getAction(payload) {
|
|
79
|
+
const { dmp_user_action = 'AUTO' } = payload;
|
|
80
|
+
if (dmp_user_action === 'ADD') {
|
|
81
|
+
return 'ADD';
|
|
82
|
+
}
|
|
83
|
+
if (dmp_user_action === 'REMOVE') {
|
|
84
|
+
return 'REMOVE';
|
|
85
|
+
}
|
|
86
|
+
if (dmp_user_action === 'AUTO' || !dmp_user_action) {
|
|
87
|
+
if (payload.event_name === 'Audience Entered') {
|
|
88
|
+
return 'ADD';
|
|
89
|
+
}
|
|
90
|
+
if (payload.event_name === 'Audience Exited') {
|
|
91
|
+
return 'REMOVE';
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return 'ADD';
|
|
95
|
+
}
|
|
96
|
+
function getUserIds(settings, payload) {
|
|
97
|
+
const userIds = [];
|
|
98
|
+
if (payload.email && settings.send_email === true) {
|
|
99
|
+
userIds.push({
|
|
100
|
+
idType: 'SHA256_EMAIL',
|
|
101
|
+
idValue: (0, hashing_utils_1.processHashing)(payload.email, 'sha256', 'hex')
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
if (payload.google_advertising_id && settings.send_google_advertising_id === true) {
|
|
105
|
+
userIds.push({
|
|
106
|
+
idType: 'GOOGLE_AID',
|
|
107
|
+
idValue: payload.google_advertising_id
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
return userIds;
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=functions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../../src/destinations/linkedin-audiences/updateAudience/functions.ts"],"names":[],"mappings":";;AAQA,wCAuCC;AA9CD,wDAAuF;AAGvF,gCAA0C;AAE1C,8DAA2D;AAEpD,KAAK,UAAU,cAAc,CAClC,OAAsB,EACtB,QAAkB,EAClB,QAAmB,EACnB,YAAsC;IAEtC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAE5B,MAAM,iBAAiB,GAAsB,IAAI,uBAAiB,CAAC,OAAO,CAAC,CAAA;IAE3E,MAAM,YAAY,GAAG,MAAM,eAAe,CAAC,iBAAiB,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAA;IAClG,MAAM,QAAQ,GAAG,YAAY,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAQjD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxB,OAA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,UAAU,KAAK,IAAI,EAAE,CAAC;QAClD,OAAO,CAAC,IAAI,CAAC;YACX,MAAM,EAAE,cAAc;YACtB,OAAO,EAAE,IAAA,8BAAc,EAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC;SACxD,CAAC,CAAA;IACJ,CAAC;IAED,IAAI,OAAO,CAAC,qBAAqB,IAAI,QAAQ,CAAC,0BAA0B,KAAK,IAAI,EAAE,CAAC;QAClF,OAAO,CAAC,IAAI,CAAC;YACX,MAAM,EAAE,YAAY;YACpB,OAAO,EAAE,OAAO,CAAC,qBAAqB;SACvC,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
|
@@ -1,245 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const hashing_utils_1 = require("../../../lib/hashing-utils");
|
|
3
|
+
const functions_1 = require("./functions");
|
|
4
|
+
const fields_1 = require("./fields");
|
|
6
5
|
const action = {
|
|
7
6
|
title: 'Sync To LinkedIn DMP Segment',
|
|
8
7
|
description: 'Syncs contacts from a Personas Audience to a LinkedIn DMP Segment.',
|
|
9
8
|
defaultSubscription: 'event = "Audience Entered" or event = "Audience Exited"',
|
|
10
|
-
fields:
|
|
11
|
-
dmp_segment_name: {
|
|
12
|
-
label: 'DMP Segment Display Name',
|
|
13
|
-
description: 'The display name of the LinkedIn DMP Segment. This field is set only when Segment creates a new audience. Updating this field after Segment has created an audience will not update the audience name in LinkedIn.',
|
|
14
|
-
type: 'string',
|
|
15
|
-
default: {
|
|
16
|
-
'@if': {
|
|
17
|
-
exists: { '@path': '$.properties.audience_key' },
|
|
18
|
-
then: { '@path': '$.properties.audience_key' },
|
|
19
|
-
else: { '@path': '$.context.personas.computation_key' }
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
enable_batching: {
|
|
24
|
-
label: 'Enable Batching',
|
|
25
|
-
description: 'Enable batching of requests to the LinkedIn DMP Segment.',
|
|
26
|
-
type: 'boolean',
|
|
27
|
-
default: true,
|
|
28
|
-
unsafe_hidden: true
|
|
29
|
-
},
|
|
30
|
-
email: {
|
|
31
|
-
label: 'User Email',
|
|
32
|
-
description: "The user's email address to send to LinkedIn.",
|
|
33
|
-
type: 'string',
|
|
34
|
-
default: {
|
|
35
|
-
'@if': {
|
|
36
|
-
exists: { '@path': '$.context.traits.email' },
|
|
37
|
-
then: { '@path': '$.context.traits.email' },
|
|
38
|
-
else: { '@path': '$.traits.email' }
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
category: 'hashedPII'
|
|
42
|
-
},
|
|
43
|
-
first_name: {
|
|
44
|
-
label: 'User First Name',
|
|
45
|
-
description: "The user's first name to send to LinkedIn.",
|
|
46
|
-
type: 'string',
|
|
47
|
-
default: {
|
|
48
|
-
'@path': '$.traits.firstName'
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
last_name: {
|
|
52
|
-
label: 'User Last Name',
|
|
53
|
-
description: "The user's last name to send to LinkedIn.",
|
|
54
|
-
type: 'string',
|
|
55
|
-
default: {
|
|
56
|
-
'@path': '$.traits.lastName'
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
title: {
|
|
60
|
-
label: 'User Title',
|
|
61
|
-
description: "The user's title to send to LinkedIn.",
|
|
62
|
-
type: 'string',
|
|
63
|
-
default: {
|
|
64
|
-
'@path': '$.traits.title'
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
company: {
|
|
68
|
-
label: 'User Company',
|
|
69
|
-
description: "The user's company to send to LinkedIn.",
|
|
70
|
-
type: 'string',
|
|
71
|
-
default: {
|
|
72
|
-
'@path': '$.traits.company'
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
country: {
|
|
76
|
-
label: 'User Country',
|
|
77
|
-
description: "The user's country to send to LinkedIn. This field accepts an ISO standardized two letter country code e.g. US.",
|
|
78
|
-
type: 'string',
|
|
79
|
-
default: {
|
|
80
|
-
'@path': '$.traits.country'
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
google_advertising_id: {
|
|
84
|
-
label: 'User Google Advertising ID',
|
|
85
|
-
description: "The user's Google Advertising ID to send to LinkedIn.",
|
|
86
|
-
type: 'string',
|
|
87
|
-
unsafe_hidden: true,
|
|
88
|
-
default: {
|
|
89
|
-
'@path': '$.context.device.advertisingId'
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
source_segment_id: {
|
|
93
|
-
label: 'LinkedIn Source Segment ID',
|
|
94
|
-
description: "A Segment-specific key associated with the LinkedIn DMP Segment. This is the lookup key Segment uses to fetch the DMP Segment from LinkedIn's API.",
|
|
95
|
-
type: 'string',
|
|
96
|
-
unsafe_hidden: true,
|
|
97
|
-
default: {
|
|
98
|
-
'@if': {
|
|
99
|
-
exists: { '@path': '$.properties.audience_key' },
|
|
100
|
-
then: { '@path': '$.properties.audience_key' },
|
|
101
|
-
else: { '@path': '$.context.personas.computation_key' }
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
personas_audience_key: {
|
|
106
|
-
label: 'Segment Engage Audience Key',
|
|
107
|
-
description: 'The `audience_key` of the Engage audience you want to sync to LinkedIn. This value must be a hard-coded string variable, e.g. `personas_test_audience`, in order for batching to work properly.',
|
|
108
|
-
type: 'string',
|
|
109
|
-
required: true
|
|
110
|
-
},
|
|
111
|
-
event_name: {
|
|
112
|
-
label: 'Event Name',
|
|
113
|
-
description: 'The name of the current Segment event.',
|
|
114
|
-
type: 'string',
|
|
115
|
-
unsafe_hidden: true,
|
|
116
|
-
default: {
|
|
117
|
-
'@path': '$.event'
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
dmp_user_action: {
|
|
121
|
-
label: 'DMP User Action',
|
|
122
|
-
description: 'A Segment specific key used to define action type.',
|
|
123
|
-
type: 'string',
|
|
124
|
-
choices: [
|
|
125
|
-
{ label: `Auto Detect`, value: 'AUTO' },
|
|
126
|
-
{ label: `Add`, value: 'ADD' },
|
|
127
|
-
{ label: 'Remove', value: 'REMOVE' }
|
|
128
|
-
],
|
|
129
|
-
default: 'AUTO'
|
|
130
|
-
}
|
|
131
|
-
},
|
|
9
|
+
fields: fields_1.fields,
|
|
132
10
|
perform: async (request, { settings, payload, statsContext }) => {
|
|
133
|
-
return processPayload(request, settings, [payload], statsContext);
|
|
11
|
+
return (0, functions_1.processPayload)(request, settings, [payload], statsContext);
|
|
134
12
|
},
|
|
135
13
|
performBatch: async (request, { settings, payload, statsContext }) => {
|
|
136
|
-
return processPayload(request, settings, payload, statsContext);
|
|
14
|
+
return (0, functions_1.processPayload)(request, settings, payload, statsContext);
|
|
137
15
|
}
|
|
138
16
|
};
|
|
139
|
-
async function processPayload(request, settings, payloads, statsContext) {
|
|
140
|
-
validate(settings, payloads);
|
|
141
|
-
const linkedinApiClient = new api_1.LinkedInAudiences(request);
|
|
142
|
-
const dmpSegmentId = await getDmpSegmentId(linkedinApiClient, settings, payloads[0], statsContext);
|
|
143
|
-
const elements = extractUsers(settings, payloads);
|
|
144
|
-
if (elements.length < 1) {
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
statsContext?.statsClient?.incr('oauth_app_api_call', 1, [
|
|
148
|
-
...statsContext?.tags,
|
|
149
|
-
`endpoint:add-or-remove-users-from-dmpSegment`
|
|
150
|
-
]);
|
|
151
|
-
const res = await linkedinApiClient.batchUpdate(dmpSegmentId, elements);
|
|
152
|
-
if (res.status !== 200) {
|
|
153
|
-
throw new actions_core_1.RetryableError('Error while attempting to update LinkedIn DMP Segment. This batch will be retried.');
|
|
154
|
-
}
|
|
155
|
-
return res;
|
|
156
|
-
}
|
|
157
|
-
function validate(settings, payloads) {
|
|
158
|
-
const isAutoOrUndefined = ['AUTO', undefined].includes(payloads[0]?.dmp_user_action);
|
|
159
|
-
if (isAutoOrUndefined && payloads[0].source_segment_id !== payloads[0].personas_audience_key) {
|
|
160
|
-
throw new actions_core_1.IntegrationError('The value of `source_segment_id` and `personas_audience_key` must match.', 'INVALID_SETTINGS', 400);
|
|
161
|
-
}
|
|
162
|
-
if (!settings.send_google_advertising_id && !settings.send_email) {
|
|
163
|
-
throw new actions_core_1.IntegrationError('At least one of `Send Email` or `Send Google Advertising ID` must be set to `true`.', 'INVALID_SETTINGS', 400);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
async function getDmpSegmentId(linkedinApiClient, settings, payload, statsContext) {
|
|
167
|
-
statsContext?.statsClient?.incr('oauth_app_api_call', 1, [...statsContext?.tags, `endpoint:get-dmpSegment`]);
|
|
168
|
-
const res = await linkedinApiClient.getDmpSegment(settings, payload);
|
|
169
|
-
const body = await res.json();
|
|
170
|
-
if (body.elements?.length > 0) {
|
|
171
|
-
return body.elements[0].id;
|
|
172
|
-
}
|
|
173
|
-
return createDmpSegment(linkedinApiClient, settings, payload, statsContext);
|
|
174
|
-
}
|
|
175
|
-
async function createDmpSegment(linkedinApiClient, settings, payload, statsContext) {
|
|
176
|
-
statsContext?.statsClient?.incr('oauth_app_api_call', 1, [...statsContext?.tags, `endpoint:create-dmpSegment`]);
|
|
177
|
-
const res = await linkedinApiClient.createDmpSegment(settings, payload);
|
|
178
|
-
const headers = res.headers.toJSON();
|
|
179
|
-
return headers['x-linkedin-id'];
|
|
180
|
-
}
|
|
181
|
-
function extractUsers(settings, payloads) {
|
|
182
|
-
const elements = [];
|
|
183
|
-
payloads.forEach((payload) => {
|
|
184
|
-
if (!payload.email && !payload.google_advertising_id) {
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
const linkedinAudiencePayload = {
|
|
188
|
-
action: getAction(payload),
|
|
189
|
-
userIds: getUserIds(settings, payload)
|
|
190
|
-
};
|
|
191
|
-
if (payload.first_name) {
|
|
192
|
-
linkedinAudiencePayload.firstName = payload.first_name;
|
|
193
|
-
}
|
|
194
|
-
if (payload.last_name) {
|
|
195
|
-
linkedinAudiencePayload.lastName = payload.last_name;
|
|
196
|
-
}
|
|
197
|
-
if (payload.title) {
|
|
198
|
-
linkedinAudiencePayload.title = payload.title;
|
|
199
|
-
}
|
|
200
|
-
if (payload.company) {
|
|
201
|
-
linkedinAudiencePayload.company = payload.company;
|
|
202
|
-
}
|
|
203
|
-
if (payload.country) {
|
|
204
|
-
linkedinAudiencePayload.country = payload.country;
|
|
205
|
-
}
|
|
206
|
-
elements.push(linkedinAudiencePayload);
|
|
207
|
-
});
|
|
208
|
-
return elements;
|
|
209
|
-
}
|
|
210
|
-
function getAction(payload) {
|
|
211
|
-
const { dmp_user_action = 'AUTO' } = payload;
|
|
212
|
-
if (dmp_user_action === 'ADD') {
|
|
213
|
-
return 'ADD';
|
|
214
|
-
}
|
|
215
|
-
if (dmp_user_action === 'REMOVE') {
|
|
216
|
-
return 'REMOVE';
|
|
217
|
-
}
|
|
218
|
-
if (dmp_user_action === 'AUTO' || !dmp_user_action) {
|
|
219
|
-
if (payload.event_name === 'Audience Entered') {
|
|
220
|
-
return 'ADD';
|
|
221
|
-
}
|
|
222
|
-
if (payload.event_name === 'Audience Exited') {
|
|
223
|
-
return 'REMOVE';
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
return 'ADD';
|
|
227
|
-
}
|
|
228
|
-
function getUserIds(settings, payload) {
|
|
229
|
-
const userIds = [];
|
|
230
|
-
if (payload.email && settings.send_email === true) {
|
|
231
|
-
userIds.push({
|
|
232
|
-
idType: 'SHA256_EMAIL',
|
|
233
|
-
idValue: (0, hashing_utils_1.processHashing)(payload.email, 'sha256', 'hex')
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
if (payload.google_advertising_id && settings.send_google_advertising_id === true) {
|
|
237
|
-
userIds.push({
|
|
238
|
-
idType: 'GOOGLE_AID',
|
|
239
|
-
idValue: payload.google_advertising_id
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
return userIds;
|
|
243
|
-
}
|
|
244
17
|
exports.default = action;
|
|
245
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/linkedin-audiences/updateAudience/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/linkedin-audiences/updateAudience/index.ts"],"names":[],"mappings":";;AAGA,2CAA4C;AAC5C,qCAAiC;AAEjC,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,8BAA8B;IACrC,WAAW,EAAE,oEAAoE;IACjF,mBAAmB,EAAE,yDAAyD;IAC9E,MAAM,EAAN,eAAM;IACN,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE;QAC9D,OAAO,IAAA,0BAAc,EAAC,OAAO,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC,CAAA;IACnE,CAAC;IACD,YAAY,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE;QACnE,OAAO,IAAA,0BAAc,EAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,YAAY,CAAC,CAAA;IACjE,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -15,7 +15,7 @@ const destination = {
|
|
|
15
15
|
fields: {
|
|
16
16
|
customerAccountId: {
|
|
17
17
|
label: 'Customer Account ID',
|
|
18
|
-
description: 'The account ID of the Microsoft Advertising account you want to manage. You can find it in the URL when viewing the account in the Microsoft Ads User Interface.',
|
|
18
|
+
description: 'The account ID of the Microsoft Advertising account you want to manage. You can find it in the URL when viewing the account in the Microsoft Ads User Interface. Not to be confused with Account Number.',
|
|
19
19
|
type: 'string',
|
|
20
20
|
required: true
|
|
21
21
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/ms-bing-ads-audiences/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAM8B;AAE9B,oEAA2C;AAE3C,2CAAiD;AAEjD,MAAM,WAAW,GAA4C;IAC3D,IAAI,EAAE,uBAAuB;IAC7B,IAAI,EAAE,+BAA+B;IACrC,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,iBAAiB,EAAE;gBACjB,KAAK,EAAE,qBAAqB;gBAC5B,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/ms-bing-ads-audiences/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAM8B;AAE9B,oEAA2C;AAE3C,2CAAiD;AAEjD,MAAM,WAAW,GAA4C;IAC3D,IAAI,EAAE,uBAAuB;IAC7B,IAAI,EAAE,+BAA+B;IACrC,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,iBAAiB,EAAE;gBACjB,KAAK,EAAE,qBAAqB;gBAC5B,WAAW,EACT,0MAA0M;gBAC5M,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,UAAU,EAAE;gBACV,KAAK,EAAE,aAAa;gBACpB,WAAW,EACT,0KAA0K;gBAC5K,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YAG9C,MAAM,GAAG,GAAG,MAAM,OAAO,CAAuB,qBAAS,EAAE;gBACzD,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,IAAI,eAAe,CAAC;oBACxB,aAAa,EAAE,IAAI,CAAC,YAAY;oBAChC,SAAS,EAAE,IAAI,CAAC,QAAQ;oBACxB,aAAa,EAAE,IAAI,CAAC,YAAY;o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
|
|
51
51
|
'@if': {
|
|
52
|
-
exists: { '@path': '$.traits.email' },
|
|
53
|
-
then: { '@path': '$.traits.email' },
|
|
52
|
+
exists: { '@path': '$.context.traits.email' },
|
|
53
|
+
then: { '@path': '$.context.traits.email' },
|
|
54
54
|
else: { '@path': '$.properties.email' }
|
|
55
55
|
}
|
|
56
56
|
},
|
|
@@ -71,22 +71,16 @@ exports.crm_id = {
|
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
73
|
exports.traits_or_props = {
|
|
74
|
-
label: 'Traits or Properties',
|
|
75
|
-
description: 'Hidden
|
|
74
|
+
label: '[Hidden] Traits or Properties',
|
|
75
|
+
description: '[Hidden] properties object from track() payloads. Note: identify calls are not handled and are disabled in the Partner Portal.',
|
|
76
76
|
type: 'object',
|
|
77
77
|
required: true,
|
|
78
78
|
unsafe_hidden: true,
|
|
79
|
-
default: {
|
|
80
|
-
'@if': {
|
|
81
|
-
exists: { '@path': '$.traits' },
|
|
82
|
-
then: { '@path': '$.traits' },
|
|
83
|
-
else: { '@path': '$.properties' }
|
|
84
|
-
}
|
|
85
|
-
}
|
|
79
|
+
default: { '@path': '$.properties' }
|
|
86
80
|
};
|
|
87
81
|
exports.audience_key = {
|
|
88
|
-
label: 'Audience Key',
|
|
89
|
-
description: 'Hidden
|
|
82
|
+
label: '[Hidden] Audience Key',
|
|
83
|
+
description: '[Hidden]: The Engage Audience Key / Slug.',
|
|
90
84
|
type: 'string',
|
|
91
85
|
required: true,
|
|
92
86
|
unsafe_hidden: true,
|
|
@@ -103,16 +97,18 @@ exports.enable_batching = {
|
|
|
103
97
|
readOnly: true
|
|
104
98
|
};
|
|
105
99
|
exports.batch_size = {
|
|
106
|
-
label: 'Batch Size',
|
|
107
|
-
description: 'The number of user syncs to include in each batch when batching is enabled. Must be between 1 and 1000.',
|
|
100
|
+
label: '[Hidden] Batch Size',
|
|
101
|
+
description: '[Hidden] The number of user syncs to include in each batch when batching is enabled. Must be between 1 and 1000.',
|
|
108
102
|
type: 'number',
|
|
109
103
|
required: true,
|
|
110
104
|
default: 1000,
|
|
105
|
+
minimum: 1,
|
|
106
|
+
maximum: 1000,
|
|
111
107
|
unsafe_hidden: true
|
|
112
108
|
};
|
|
113
109
|
exports.batch_keys = {
|
|
114
|
-
label: 'Batch Keys',
|
|
115
|
-
description: 'The keys to use for batching user syncs. Users with the same values for these keys will be grouped together in the same batch.',
|
|
110
|
+
label: '[Hidden] Batch Keys',
|
|
111
|
+
description: '[Hidden] The keys to use for batching user syncs. Users with the same values for these keys will be grouped together in the same batch.',
|
|
116
112
|
type: 'string',
|
|
117
113
|
required: false,
|
|
118
114
|
default: ['identifier_type', 'audience_id'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../src/destinations/ms-bing-ads-audiences/syncAudiences/fields.ts"],"names":[],"mappings":";;;AACA,4CAA6D;AAEhD,QAAA,WAAW,GAAe;IACrC,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,kEAAkE;IAC/E,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE;QACP,OAAO,EAAE,yCAAyC;KACnD;IACD,aAAa,EAAE,IAAI;CACpB,CAAA;AAEY,QAAA,iBAAiB,GAAe;IAC3C,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EAAE,uDAAuD;IACpE,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE;QACP,OAAO,EAAE,sCAAsC;KAChD;IACD,OAAO,EAAE;QACP,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;QACxC,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE;KACjD;IACD,aAAa,EAAE,IAAI;CACpB,CAAA;AAEY,QAAA,eAAe,GAAe;IACzC,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,qDAAqD;IAClE,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE;QACP,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;QAClC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE;KAClC;CACF,CAAA;AAEY,QAAA,KAAK,GAAe;IAC/B,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,mEAAmE;IAChF,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE;QACR,GAAG,2BAAe;KACnB;IACD,UAAU,EAAE;QACV,GAAG,2BAAe;KACnB;IACD,OAAO,EAAE;QACP,KAAK,EAAE;YACL,MAAM,EAAE,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../src/destinations/ms-bing-ads-audiences/syncAudiences/fields.ts"],"names":[],"mappings":";;;AACA,4CAA6D;AAEhD,QAAA,WAAW,GAAe;IACrC,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,kEAAkE;IAC/E,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE;QACP,OAAO,EAAE,yCAAyC;KACnD;IACD,aAAa,EAAE,IAAI;CACpB,CAAA;AAEY,QAAA,iBAAiB,GAAe;IAC3C,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EAAE,uDAAuD;IACpE,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE;QACP,OAAO,EAAE,sCAAsC;KAChD;IACD,OAAO,EAAE;QACP,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;QACxC,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE;KACjD;IACD,aAAa,EAAE,IAAI;CACpB,CAAA;AAEY,QAAA,eAAe,GAAe;IACzC,KAAK,EAAE,iBAAiB;IACxB,WAAW,EAAE,qDAAqD;IAClE,IAAI,EAAE,QA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,EAAE;QACP,OAAO,EAAE,oCAAoC;KAC9C;CACF,CAAA;AAEY,QAAA,eAAe,GAAe;IACzC,KAAK,EAAE,iBAAiB;IACxB,WAAW,EACT,4IAA4I;IAC9I,IAAI,EAAE,SAAS;IACf,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,IAAI;IACb,QAAQ,EAAE,IAAI;CACf,CAAA;AAEY,QAAA,UAAU,GAAe;IACpC,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EACT,kHAAkH;IACpH,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,IAAI;IACb,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,IAAI;IACb,aAAa,EAAE,IAAI;CACpB,CAAA;AAEY,QAAA,UAAU,GAAe;IACpC,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EACT,yIAAyI;IAC3I,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,KAAK;IACf,OAAO,EAAE,CAAC,iBAAiB,EAAE,aAAa,CAAC;IAC3C,aAAa,EAAE,IAAI;IACnB,QAAQ,EAAE,IAAI;CACf,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_RETENTION_DAYS = exports.ACCESS_TOKEN_URL = void 0;
|
|
4
|
+
exports.ACCESS_TOKEN_URL = 'https://accounts.snapchat.com/login/oauth2/access_token';
|
|
5
|
+
exports.DEFAULT_RETENTION_DAYS = 9999;
|
|
6
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/destinations/snap-audiences/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG,yDAAyD,CAAA;AAE5E,QAAA,sBAAsB,GAAG,IAAI,CAAA"}
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const actions_core_1 = require("@segment/actions-core");
|
|
7
7
|
const syncAudience_1 = __importDefault(require("./syncAudience"));
|
|
8
|
-
const
|
|
8
|
+
const constants_1 = require("./constants");
|
|
9
9
|
const destination = {
|
|
10
10
|
name: 'Snap Audiences (Actions)',
|
|
11
11
|
slug: 'actions-snap-audiences',
|
|
@@ -21,7 +21,7 @@ const destination = {
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
refreshAccessToken: async (request, { auth }) => {
|
|
24
|
-
const res = await request(ACCESS_TOKEN_URL, {
|
|
24
|
+
const res = await request(constants_1.ACCESS_TOKEN_URL, {
|
|
25
25
|
method: 'POST',
|
|
26
26
|
body: new URLSearchParams({
|
|
27
27
|
refresh_token: auth.refreshToken,
|
|
@@ -73,24 +73,10 @@ const destination = {
|
|
|
73
73
|
eventSlug: 'journeys_step_entered_track'
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
|
-
name: 'Sync Audience
|
|
77
|
-
subscribe: 'type = "track"
|
|
76
|
+
name: 'Sync Engage Audience',
|
|
77
|
+
subscribe: 'type = "track" or type = "identify"',
|
|
78
78
|
partnerAction: 'syncAudience',
|
|
79
|
-
mapping: { ...(0, actions_core_1.defaultValues)(syncAudience_1.default.fields)
|
|
80
|
-
type: 'automatic'
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
name: 'Sync Audience with Phone',
|
|
84
|
-
subscribe: 'type = "track" and properties.phone exists',
|
|
85
|
-
partnerAction: 'syncAudience',
|
|
86
|
-
mapping: { ...(0, actions_core_1.defaultValues)(syncAudience_1.default.fields), schema_type: 'PHONE_SHA256' },
|
|
87
|
-
type: 'automatic'
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
name: 'Sync Audience with Mobile AD ID',
|
|
91
|
-
subscribe: 'type = "track" and context.device.advertisingId exists',
|
|
92
|
-
partnerAction: 'syncAudience',
|
|
93
|
-
mapping: { ...(0, actions_core_1.defaultValues)(syncAudience_1.default.fields), schema_type: 'MOBILE_AD_ID_SHA256' },
|
|
79
|
+
mapping: { ...(0, actions_core_1.defaultValues)(syncAudience_1.default.fields) },
|
|
94
80
|
type: 'automatic'
|
|
95
81
|
}
|
|
96
82
|
],
|
|
@@ -112,7 +98,7 @@ const destination = {
|
|
|
112
98
|
retention_in_days: {
|
|
113
99
|
type: 'number',
|
|
114
100
|
label: 'Retention in days',
|
|
115
|
-
description: '
|
|
101
|
+
description: 'Number of days to retain audience members. (Default retention is lifetime represented as 9999)',
|
|
116
102
|
default: 9999,
|
|
117
103
|
required: false
|
|
118
104
|
}
|
|
@@ -123,37 +109,35 @@ const destination = {
|
|
|
123
109
|
full_audience_sync: false
|
|
124
110
|
},
|
|
125
111
|
async createAudience(request, createAudienceInput) {
|
|
126
|
-
const audienceName = createAudienceInput
|
|
127
|
-
const ad_account_id = createAudienceInput.settings.ad_account_id;
|
|
128
|
-
const { customAudienceName, description, retention_in_days } = createAudienceInput.audienceSettings || {};
|
|
112
|
+
const { audienceName, settings: { ad_account_id } = {}, audienceSettings: { customAudienceName, description, retention_in_days } = {} } = createAudienceInput;
|
|
129
113
|
if (!audienceName) {
|
|
130
114
|
throw new actions_core_1.IntegrationError('Missing audience name value', 'MISSING_REQUIRED_FIELD', 400);
|
|
131
115
|
}
|
|
116
|
+
if (!ad_account_id) {
|
|
117
|
+
throw new actions_core_1.IntegrationError('Missing Ad Account ID. Please configure the Ad Account ID in the destination settings.', 'MISSING_REQUIRED_FIELD', 400);
|
|
118
|
+
}
|
|
119
|
+
const json = {
|
|
120
|
+
segments: [
|
|
121
|
+
{
|
|
122
|
+
name: customAudienceName || audienceName,
|
|
123
|
+
source_type: 'FIRST_PARTY',
|
|
124
|
+
ad_account_id,
|
|
125
|
+
description: description || `Audience ${audienceName} created by Segment`,
|
|
126
|
+
retention_in_days: retention_in_days || constants_1.DEFAULT_RETENTION_DAYS
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
};
|
|
132
130
|
const response = await request(`https://adsapi.snapchat.com/v1/adaccounts/${ad_account_id}/segments`, {
|
|
133
131
|
method: 'POST',
|
|
134
|
-
json
|
|
135
|
-
segments: [
|
|
136
|
-
{
|
|
137
|
-
name: customAudienceName !== '' ? customAudienceName : audienceName,
|
|
138
|
-
source_type: 'FIRST_PARTY',
|
|
139
|
-
ad_account_id,
|
|
140
|
-
description,
|
|
141
|
-
retention_in_days
|
|
142
|
-
}
|
|
143
|
-
]
|
|
144
|
-
}
|
|
132
|
+
json
|
|
145
133
|
});
|
|
146
|
-
|
|
147
|
-
const snapAudienceId = data.segments[0].segment.id;
|
|
148
|
-
return { externalId: snapAudienceId };
|
|
134
|
+
return { externalId: response.data.segments[0].segment.id };
|
|
149
135
|
},
|
|
150
136
|
getAudience: async (request, { externalId }) => {
|
|
151
137
|
const response = await request(`https://adsapi.snapchat.com/v1/segments/${externalId}`, {
|
|
152
138
|
method: 'GET'
|
|
153
139
|
});
|
|
154
|
-
|
|
155
|
-
const snapAudienceId = data.segments[0].segment.id;
|
|
156
|
-
return { externalId: snapAudienceId };
|
|
140
|
+
return { externalId: response.data.segments[0].segment.id };
|
|
157
141
|
}
|
|
158
142
|
}
|
|
159
143
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/snap-audiences/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAAsG;AAEtG,kEAAyC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/snap-audiences/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAAsG;AAEtG,kEAAyC;AAEzC,2CAAsE;AAEtE,MAAM,WAAW,GAA8D;IAC7E,IAAI,EAAE,0BAA0B;IAChC,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,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