@segment/action-destinations 3.65.1-alpha.6 → 3.65.1-alpha.9
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/snap-conversions-api/generated-types.d.ts +0 -3
- package/dist/destinations/snap-conversions-api/index.d.ts +1 -1
- package/dist/destinations/snap-conversions-api/index.js +1 -167
- package/dist/destinations/snap-conversions-api/index.js.map +1 -1
- package/dist/destinations/snap-conversions-api/reportConversionEvent/generated-types.d.ts +0 -23
- package/dist/destinations/snap-conversions-api/reportConversionEvent/index.d.ts +1 -1
- package/dist/destinations/snap-conversions-api/reportConversionEvent/index.js +4 -53
- package/dist/destinations/snap-conversions-api/reportConversionEvent/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/destinations/snap-conversions-api/_tests_/index.test.d.ts +0 -1
- package/dist/destinations/snap-conversions-api/_tests_/index.test.js +0 -292
- package/dist/destinations/snap-conversions-api/_tests_/index.test.js.map +0 -1
- package/dist/destinations/snap-conversions-api/snap-capi-properties.d.ts +0 -28
- package/dist/destinations/snap-conversions-api/snap-capi-properties.js +0 -289
- package/dist/destinations/snap-conversions-api/snap-capi-properties.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DestinationDefinition } from '@segment/actions-core';
|
|
1
|
+
import type { DestinationDefinition } from '@segment/actions-core';
|
|
2
2
|
import type { Settings } from './generated-types';
|
|
3
3
|
declare const destination: DestinationDefinition<Settings>;
|
|
4
4
|
export default destination;
|
|
@@ -3,181 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
7
6
|
const reportConversionEvent_1 = __importDefault(require("./reportConversionEvent"));
|
|
8
|
-
const defaultVals = { ...actions_core_1.defaultValues(reportConversionEvent_1.default.fields) };
|
|
9
|
-
const presets = [
|
|
10
|
-
{
|
|
11
|
-
name: 'Add Billing',
|
|
12
|
-
subscribe: 'event = "Payment Info Entered"',
|
|
13
|
-
partnerAction: 'reportConversionEvent',
|
|
14
|
-
mapping: {
|
|
15
|
-
...defaultVals,
|
|
16
|
-
event_type: 'ADD_BILLING'
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: 'Add to Cart',
|
|
21
|
-
subscribe: 'event = "Product Added"',
|
|
22
|
-
partnerAction: 'reportConversionEvent',
|
|
23
|
-
mapping: {
|
|
24
|
-
...defaultVals,
|
|
25
|
-
event_type: 'ADD_CART'
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: 'Add to Wishlist',
|
|
30
|
-
subscribe: 'event = "Product Added to Wishlist"',
|
|
31
|
-
partnerAction: 'reportConversionEvent',
|
|
32
|
-
mapping: {
|
|
33
|
-
...defaultVals,
|
|
34
|
-
event_type: 'ADD_TO_WISHLIST'
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
name: 'App Install',
|
|
39
|
-
subscribe: 'event = "Application Installed"',
|
|
40
|
-
partnerAction: 'reportConversionEvent',
|
|
41
|
-
mapping: {
|
|
42
|
-
...defaultVals,
|
|
43
|
-
event_type: 'APP_INSTALL'
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
name: 'List View',
|
|
48
|
-
subscribe: 'event = "Product List Viewed"',
|
|
49
|
-
partnerAction: 'reportConversionEvent',
|
|
50
|
-
mapping: {
|
|
51
|
-
...defaultVals,
|
|
52
|
-
event_type: 'LIST_VIEW'
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
name: 'App Open',
|
|
57
|
-
subscribe: 'event = "Application Opened"',
|
|
58
|
-
partnerAction: 'reportConversionEvent',
|
|
59
|
-
mapping: {
|
|
60
|
-
...defaultVals,
|
|
61
|
-
event_type: 'APP_OPEN'
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
name: 'Login',
|
|
66
|
-
subscribe: 'event = "Signed In"',
|
|
67
|
-
partnerAction: 'reportConversionEvent',
|
|
68
|
-
mapping: {
|
|
69
|
-
...defaultVals,
|
|
70
|
-
event_type: 'LOGIN'
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
name: 'Page View',
|
|
75
|
-
subscribe: 'type = "page"',
|
|
76
|
-
partnerAction: 'reportConversionEvent',
|
|
77
|
-
mapping: {
|
|
78
|
-
...defaultVals,
|
|
79
|
-
event_type: 'PAGE_VIEW'
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
name: 'Purchase',
|
|
84
|
-
subscribe: 'event = "Order Completed"',
|
|
85
|
-
partnerAction: 'reportConversionEvent',
|
|
86
|
-
mapping: {
|
|
87
|
-
...defaultVals,
|
|
88
|
-
event_type: 'PURCHASE'
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
name: 'Search',
|
|
93
|
-
subscribe: 'event = "Products Searched"',
|
|
94
|
-
partnerAction: 'reportConversionEvent',
|
|
95
|
-
mapping: {
|
|
96
|
-
...defaultVals,
|
|
97
|
-
event_type: 'SEARCH'
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
name: 'Share',
|
|
102
|
-
subscribe: 'event = "Product Shared"',
|
|
103
|
-
partnerAction: 'reportConversionEvent',
|
|
104
|
-
mapping: {
|
|
105
|
-
...defaultVals,
|
|
106
|
-
event_type: 'SHARE'
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
name: 'Sign Up',
|
|
111
|
-
subscribe: 'event = "Signed Up"',
|
|
112
|
-
partnerAction: 'reportConversionEvent',
|
|
113
|
-
mapping: {
|
|
114
|
-
...defaultVals,
|
|
115
|
-
event_type: 'SIGN_UP'
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
name: 'Start Checkout',
|
|
120
|
-
subscribe: 'event = "Checkout Started"',
|
|
121
|
-
partnerAction: 'reportConversionEvent',
|
|
122
|
-
mapping: {
|
|
123
|
-
...defaultVals,
|
|
124
|
-
event_type: 'START_CHECKOUT'
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
name: 'View Content',
|
|
129
|
-
subscribe: 'event = "Product Viewed"',
|
|
130
|
-
partnerAction: 'reportConversionEvent',
|
|
131
|
-
mapping: {
|
|
132
|
-
...defaultVals,
|
|
133
|
-
event_type: 'VIEW_CONTENT'
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
];
|
|
137
7
|
const destination = {
|
|
138
8
|
name: 'Snap Conversions Api',
|
|
139
9
|
slug: 'actions-snap-conversions',
|
|
140
10
|
mode: 'cloud',
|
|
141
11
|
authentication: {
|
|
142
12
|
scheme: 'oauth2',
|
|
143
|
-
fields: {
|
|
144
|
-
pixel_id: {
|
|
145
|
-
label: 'Pixel ID',
|
|
146
|
-
description: 'The Pixel ID for your Snapchat Ad Account. Required for web and offline events.',
|
|
147
|
-
type: 'string'
|
|
148
|
-
},
|
|
149
|
-
snap_app_id: {
|
|
150
|
-
label: 'Snap App ID',
|
|
151
|
-
description: 'The Snap App ID associated with your app. This is a unique code generated in Snapchat Ads Manager and included in your MMP dashboard. Required for app events.',
|
|
152
|
-
type: 'string'
|
|
153
|
-
},
|
|
154
|
-
app_id: {
|
|
155
|
-
label: 'App ID',
|
|
156
|
-
description: 'The unique ID assigned for a given application. It should be numeric for iOS, and the human interpretable string for Android. Required for app events.',
|
|
157
|
-
type: 'string'
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
refreshAccessToken: async (request, { auth }) => {
|
|
161
|
-
const res = await request('https://accounts.snapchat.com/login/oauth2/access_token', {
|
|
162
|
-
method: 'POST',
|
|
163
|
-
body: new URLSearchParams({
|
|
164
|
-
refresh_token: auth.refreshToken,
|
|
165
|
-
client_id: auth.clientId,
|
|
166
|
-
client_secret: auth.clientSecret,
|
|
167
|
-
grant_type: 'refresh_token'
|
|
168
|
-
})
|
|
169
|
-
});
|
|
170
|
-
return { accessToken: res.data.access_token };
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
extendRequest({ auth }) {
|
|
174
|
-
return {
|
|
175
|
-
headers: {
|
|
176
|
-
authorization: `Bearer ${auth?.accessToken}`
|
|
177
|
-
}
|
|
178
|
-
};
|
|
13
|
+
fields: {}
|
|
179
14
|
},
|
|
180
|
-
presets,
|
|
181
15
|
actions: {
|
|
182
16
|
reportConversionEvent: reportConversionEvent_1.default
|
|
183
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/snap-conversions-api/index.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/snap-conversions-api/index.ts"],"names":[],"mappings":";;;;;AAGA,oFAA2D;AAE3D,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE,0BAA0B;IAChC,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,EAAE;KAkCX;IACD,OAAO,EAAE;QACP,qBAAqB,EAArB,+BAAqB;KACtB;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -1,25 +1,2 @@
|
|
|
1
1
|
export interface Payload {
|
|
2
|
-
event_type: string;
|
|
3
|
-
event_conversion_type: string;
|
|
4
|
-
event_tag?: string;
|
|
5
|
-
timestamp: string;
|
|
6
|
-
email?: string;
|
|
7
|
-
mobile_ad_id?: string;
|
|
8
|
-
uuid_c1?: string;
|
|
9
|
-
idfv?: string;
|
|
10
|
-
phone_number?: string;
|
|
11
|
-
user_agent?: string;
|
|
12
|
-
ip_address?: string;
|
|
13
|
-
item_category?: string;
|
|
14
|
-
item_ids?: string;
|
|
15
|
-
description?: string;
|
|
16
|
-
number_items?: string;
|
|
17
|
-
price?: number;
|
|
18
|
-
currency?: string;
|
|
19
|
-
transaction_id?: string;
|
|
20
|
-
level?: string;
|
|
21
|
-
client_dedup_id?: string;
|
|
22
|
-
search_string?: string;
|
|
23
|
-
page_url?: string;
|
|
24
|
-
sign_up_method?: string;
|
|
25
2
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActionDefinition } from '@segment/actions-core';
|
|
1
|
+
import type { 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>;
|
|
@@ -1,60 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const snap_capi_properties_1 = require("../snap-capi-properties");
|
|
5
3
|
const action = {
|
|
6
4
|
title: 'Report Conversion Event',
|
|
7
|
-
description: '
|
|
8
|
-
fields: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
event_tag: snap_capi_properties_1.event_tag,
|
|
12
|
-
timestamp: { ...snap_capi_properties_1.timestamp, required: true },
|
|
13
|
-
email: snap_capi_properties_1.email,
|
|
14
|
-
mobile_ad_id: snap_capi_properties_1.mobile_ad_id,
|
|
15
|
-
uuid_c1: snap_capi_properties_1.uuid_c1,
|
|
16
|
-
idfv: snap_capi_properties_1.idfv,
|
|
17
|
-
phone_number: snap_capi_properties_1.phone_number,
|
|
18
|
-
user_agent: snap_capi_properties_1.user_agent,
|
|
19
|
-
ip_address: snap_capi_properties_1.ip_address,
|
|
20
|
-
item_category: snap_capi_properties_1.item_category,
|
|
21
|
-
item_ids: snap_capi_properties_1.item_ids,
|
|
22
|
-
description: snap_capi_properties_1.description,
|
|
23
|
-
number_items: snap_capi_properties_1.number_items,
|
|
24
|
-
price: snap_capi_properties_1.price,
|
|
25
|
-
currency: snap_capi_properties_1.currency,
|
|
26
|
-
transaction_id: snap_capi_properties_1.transaction_id,
|
|
27
|
-
level: snap_capi_properties_1.level,
|
|
28
|
-
client_dedup_id: snap_capi_properties_1.client_dedup_id,
|
|
29
|
-
search_string: snap_capi_properties_1.search_string,
|
|
30
|
-
page_url: snap_capi_properties_1.page_url,
|
|
31
|
-
sign_up_method: snap_capi_properties_1.sign_up_method
|
|
32
|
-
},
|
|
33
|
-
perform: (request, data) => {
|
|
34
|
-
const payload = snap_capi_properties_1.formatPayload(data.payload);
|
|
35
|
-
if (data.payload.event_conversion_type === 'MOBILE_APP') {
|
|
36
|
-
if (data.settings?.snap_app_id === undefined || data.settings?.app_id === undefined) {
|
|
37
|
-
throw new actions_core_1.IntegrationError('If event conversion type is "MOBILE_APP" then snap_app_id and app_id must be defined', 'Misconfigured required field', 400);
|
|
38
|
-
}
|
|
39
|
-
delete data.settings?.pixel_id;
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
if (data.settings?.pixel_id === undefined) {
|
|
43
|
-
throw new actions_core_1.IntegrationError(`If event conversion type is "${data.payload.event_conversion_type}" then pixel_id must be defined`, 'Misconfigured required field', 400);
|
|
44
|
-
}
|
|
45
|
-
delete data.settings?.snap_app_id;
|
|
46
|
-
delete data.settings?.app_id;
|
|
47
|
-
}
|
|
48
|
-
if (data.payload.currency && !snap_capi_properties_1.CURRENCY_ISO_CODES.has(data.payload.currency)) {
|
|
49
|
-
throw new actions_core_1.IntegrationError(`${data.payload.currency} is not a valid currency code.`, 'Misconfigured required field', 400);
|
|
50
|
-
}
|
|
51
|
-
return request('https://tr.snapchat.com/v2/conversion', {
|
|
52
|
-
method: 'post',
|
|
53
|
-
json: {
|
|
54
|
-
...payload,
|
|
55
|
-
...data.settings
|
|
56
|
-
}
|
|
57
|
-
});
|
|
5
|
+
description: '',
|
|
6
|
+
fields: {},
|
|
7
|
+
perform: () => {
|
|
8
|
+
return;
|
|
58
9
|
}
|
|
59
10
|
};
|
|
60
11
|
exports.default = action;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/snap-conversions-api/reportConversionEvent/index.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/snap-conversions-api/reportConversionEvent/index.ts"],"names":[],"mappings":";;AAIA,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,yBAAyB;IAChC,WAAW,EAAE,EAAE;IACf,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,GAAG,EAAE;QAOZ,OAAM;IACR,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@segment/action-destinations",
|
|
3
3
|
"description": "Destination Actions engine and definitions.",
|
|
4
|
-
"version": "3.65.1-alpha.
|
|
4
|
+
"version": "3.65.1-alpha.9",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/segmentio/action-destinations",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"<rootDir>/test/setup-after-env.ts"
|
|
63
63
|
]
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "b9129c95962ad4b2ea4e8b155b69a555d9c2034b"
|
|
66
66
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,292 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const nock_1 = __importDefault(require("nock"));
|
|
7
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
8
|
-
const index_1 = __importDefault(require("../index"));
|
|
9
|
-
const testDestination = actions_core_1.createTestIntegration(index_1.default);
|
|
10
|
-
const timestamp = '2022-05-12T15:21:15.449Z';
|
|
11
|
-
const settings = {
|
|
12
|
-
snap_app_id: 'test123',
|
|
13
|
-
pixel_id: 'test123',
|
|
14
|
-
app_id: 'test123'
|
|
15
|
-
};
|
|
16
|
-
const accessToken = 'test123';
|
|
17
|
-
const refreshToken = 'test123';
|
|
18
|
-
describe('Snap Conversions API ', () => {
|
|
19
|
-
describe('ReportConversionEvent', () => {
|
|
20
|
-
it('should handle a basic event', async () => {
|
|
21
|
-
nock_1.default(`https://tr.snapchat.com/v2/conversion`).post('').reply(200, {});
|
|
22
|
-
const event = actions_core_1.createTestEvent({
|
|
23
|
-
timestamp: timestamp,
|
|
24
|
-
messageId: 'test-message-rv4t40s898k',
|
|
25
|
-
event: 'PURCHASE',
|
|
26
|
-
type: 'track',
|
|
27
|
-
properties: {
|
|
28
|
-
email: 'test123@gmail.com',
|
|
29
|
-
phone: '+44 844 412 4653',
|
|
30
|
-
event_tag: 'back-to-school',
|
|
31
|
-
number_items: 10,
|
|
32
|
-
price: '15',
|
|
33
|
-
currency: 'USD',
|
|
34
|
-
level: 3
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
const responses = await testDestination.testAction('reportConversionEvent', {
|
|
38
|
-
event,
|
|
39
|
-
settings,
|
|
40
|
-
useDefaultMappings: true,
|
|
41
|
-
auth: {
|
|
42
|
-
accessToken,
|
|
43
|
-
refreshToken
|
|
44
|
-
},
|
|
45
|
-
mapping: {
|
|
46
|
-
event_type: 'PURCHASE',
|
|
47
|
-
event_conversion_type: 'WEB'
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
expect(responses.length).toBe(1);
|
|
51
|
-
expect(responses[0].status).toBe(200);
|
|
52
|
-
expect(responses[0].options.body).toMatchInlineSnapshot(`"{\\"event_type\\":\\"PURCHASE\\",\\"event_conversion_type\\":\\"WEB\\",\\"timestamp\\":1652368875449,\\"hashed_email\\":\\"cc779c04191c2e736d89e45c11339c8382832bcaf70383f7df94e3d08ba7a6d9\\",\\"hashed_phone_number\\":\\"dc008fda46e2e64002cf2f82a4906236282d431c4f75e5b60bfe79fc48546383\\",\\"user_agent\\":\\"Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1\\",\\"hashed_ip_address\\":\\"838c4c2573848f58e74332341a7ca6bc5cd86a8aec7d644137d53b4d597f10f5\\",\\"price\\":15,\\"currency\\":\\"USD\\",\\"page_url\\":\\"https://segment.com/academy/\\",\\"pixel_id\\":\\"test123\\"}"`);
|
|
53
|
-
});
|
|
54
|
-
it('should fail web event without pixel_id', async () => {
|
|
55
|
-
nock_1.default(`https://tr.snapchat.com/v2/conversion`).post('').reply(400, {});
|
|
56
|
-
const event = actions_core_1.createTestEvent({
|
|
57
|
-
timestamp: timestamp,
|
|
58
|
-
messageId: 'test-message-rv4t40s898k',
|
|
59
|
-
event: 'PURCHASE',
|
|
60
|
-
type: 'track',
|
|
61
|
-
properties: {
|
|
62
|
-
email: 'test123@gmail.com',
|
|
63
|
-
phone: '+44 844 412 4653',
|
|
64
|
-
event_tag: 'back-to-school',
|
|
65
|
-
number_items: 10,
|
|
66
|
-
price: '15',
|
|
67
|
-
currency: 'USD',
|
|
68
|
-
level: 3
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
await expect(testDestination.testAction('reportConversionEvent', {
|
|
72
|
-
event,
|
|
73
|
-
settings: {
|
|
74
|
-
app_id: 'test123'
|
|
75
|
-
},
|
|
76
|
-
useDefaultMappings: true,
|
|
77
|
-
auth: {
|
|
78
|
-
accessToken,
|
|
79
|
-
refreshToken
|
|
80
|
-
},
|
|
81
|
-
mapping: {
|
|
82
|
-
event_type: 'PURCHASE',
|
|
83
|
-
event_conversion_type: 'WEB'
|
|
84
|
-
}
|
|
85
|
-
})).rejects.toThrowError('If event conversion type is "WEB" then pixel_id must be defined');
|
|
86
|
-
});
|
|
87
|
-
it('should fail web event without snap_app_id', async () => {
|
|
88
|
-
nock_1.default(`https://tr.snapchat.com/v2/conversion`).post('').reply(400, {});
|
|
89
|
-
const event = actions_core_1.createTestEvent({
|
|
90
|
-
timestamp: timestamp,
|
|
91
|
-
messageId: 'test-message-rv4t40s898k',
|
|
92
|
-
event: 'PURCHASE',
|
|
93
|
-
type: 'track',
|
|
94
|
-
properties: {
|
|
95
|
-
email: 'test123@gmail.com',
|
|
96
|
-
phone: '+44 844 412 4653',
|
|
97
|
-
event_tag: 'back-to-school',
|
|
98
|
-
number_items: 10,
|
|
99
|
-
price: '15',
|
|
100
|
-
currency: 'USD',
|
|
101
|
-
level: 3
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
await expect(testDestination.testAction('reportConversionEvent', {
|
|
105
|
-
event,
|
|
106
|
-
settings: {
|
|
107
|
-
pixel_id: 'test123',
|
|
108
|
-
app_id: 'test123'
|
|
109
|
-
},
|
|
110
|
-
useDefaultMappings: true,
|
|
111
|
-
auth: {
|
|
112
|
-
accessToken,
|
|
113
|
-
refreshToken
|
|
114
|
-
},
|
|
115
|
-
mapping: {
|
|
116
|
-
event_type: 'PURCHASE',
|
|
117
|
-
event_conversion_type: 'MOBILE_APP'
|
|
118
|
-
}
|
|
119
|
-
})).rejects.toThrowError('If event conversion type is "MOBILE_APP" then snap_app_id and app_id must be defined');
|
|
120
|
-
});
|
|
121
|
-
it('should handle an offline event conversion type', async () => {
|
|
122
|
-
nock_1.default(`https://tr.snapchat.com/v2/conversion`).post('').reply(200, {});
|
|
123
|
-
const event = actions_core_1.createTestEvent({
|
|
124
|
-
timestamp: timestamp,
|
|
125
|
-
messageId: 'test-message-rv4t40s898k',
|
|
126
|
-
event: 'SAVE',
|
|
127
|
-
type: 'track',
|
|
128
|
-
properties: {
|
|
129
|
-
email: 'test123@gmail.com',
|
|
130
|
-
phone: '+44 844 412 4653',
|
|
131
|
-
event_tag: 'back-to-school',
|
|
132
|
-
number_items: 10,
|
|
133
|
-
price: '15',
|
|
134
|
-
currency: 'USD',
|
|
135
|
-
level: 3
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
const responses = await testDestination.testAction('reportConversionEvent', {
|
|
139
|
-
event,
|
|
140
|
-
settings,
|
|
141
|
-
useDefaultMappings: true,
|
|
142
|
-
auth: {
|
|
143
|
-
accessToken,
|
|
144
|
-
refreshToken
|
|
145
|
-
},
|
|
146
|
-
mapping: {
|
|
147
|
-
event_type: 'SAVE',
|
|
148
|
-
event_conversion_type: 'OFFLINE'
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
expect(responses.length).toBe(1);
|
|
152
|
-
expect(responses[0].status).toBe(200);
|
|
153
|
-
expect(responses[0].options.body).toMatchInlineSnapshot(`"{\\"event_type\\":\\"SAVE\\",\\"event_conversion_type\\":\\"OFFLINE\\",\\"timestamp\\":1652368875449,\\"hashed_email\\":\\"cc779c04191c2e736d89e45c11339c8382832bcaf70383f7df94e3d08ba7a6d9\\",\\"hashed_phone_number\\":\\"dc008fda46e2e64002cf2f82a4906236282d431c4f75e5b60bfe79fc48546383\\",\\"user_agent\\":\\"Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1\\",\\"hashed_ip_address\\":\\"838c4c2573848f58e74332341a7ca6bc5cd86a8aec7d644137d53b4d597f10f5\\",\\"price\\":15,\\"currency\\":\\"USD\\",\\"page_url\\":\\"https://segment.com/academy/\\",\\"pixel_id\\":\\"test123\\"}"`);
|
|
154
|
-
});
|
|
155
|
-
it('should handle a mobile app event conversion type', async () => {
|
|
156
|
-
nock_1.default(`https://tr.snapchat.com/v2/conversion`).post('').reply(200, {});
|
|
157
|
-
const event = actions_core_1.createTestEvent({
|
|
158
|
-
timestamp: timestamp,
|
|
159
|
-
messageId: 'test-message-rv4t40s898k',
|
|
160
|
-
event: 'SAVE',
|
|
161
|
-
type: 'track',
|
|
162
|
-
properties: {
|
|
163
|
-
email: 'test123@gmail.com',
|
|
164
|
-
phone: '+44 844 412 4653',
|
|
165
|
-
event_tag: 'back-to-school',
|
|
166
|
-
number_items: 10,
|
|
167
|
-
price: '15',
|
|
168
|
-
currency: 'USD',
|
|
169
|
-
level: 3
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
const responses = await testDestination.testAction('reportConversionEvent', {
|
|
173
|
-
event,
|
|
174
|
-
settings: {
|
|
175
|
-
snap_app_id: '123',
|
|
176
|
-
app_id: '123'
|
|
177
|
-
},
|
|
178
|
-
useDefaultMappings: true,
|
|
179
|
-
auth: {
|
|
180
|
-
accessToken,
|
|
181
|
-
refreshToken
|
|
182
|
-
},
|
|
183
|
-
mapping: {
|
|
184
|
-
event_type: 'SAVE',
|
|
185
|
-
event_conversion_type: 'MOBILE_APP'
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
expect(responses.length).toBe(1);
|
|
189
|
-
expect(responses[0].status).toBe(200);
|
|
190
|
-
expect(responses[0].options.body).toMatchInlineSnapshot(`"{\\"event_type\\":\\"SAVE\\",\\"event_conversion_type\\":\\"MOBILE_APP\\",\\"timestamp\\":1652368875449,\\"hashed_email\\":\\"cc779c04191c2e736d89e45c11339c8382832bcaf70383f7df94e3d08ba7a6d9\\",\\"hashed_phone_number\\":\\"dc008fda46e2e64002cf2f82a4906236282d431c4f75e5b60bfe79fc48546383\\",\\"user_agent\\":\\"Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1\\",\\"hashed_ip_address\\":\\"838c4c2573848f58e74332341a7ca6bc5cd86a8aec7d644137d53b4d597f10f5\\",\\"price\\":15,\\"currency\\":\\"USD\\",\\"page_url\\":\\"https://segment.com/academy/\\",\\"snap_app_id\\":\\"123\\",\\"app_id\\":\\"123\\"}"`);
|
|
191
|
-
});
|
|
192
|
-
it('should fail invalid currency', async () => {
|
|
193
|
-
nock_1.default(`https://tr.snapchat.com/v2/conversion`).post('').reply(400, {});
|
|
194
|
-
const event = actions_core_1.createTestEvent({
|
|
195
|
-
timestamp: timestamp,
|
|
196
|
-
messageId: 'test-message-rv4t40s898k',
|
|
197
|
-
event: 'PURCHASE',
|
|
198
|
-
type: 'track',
|
|
199
|
-
properties: {
|
|
200
|
-
email: 'test123@gmail.com',
|
|
201
|
-
phone: '+44 844 412 4653',
|
|
202
|
-
event_tag: 'back-to-school',
|
|
203
|
-
number_items: 10,
|
|
204
|
-
price: '15',
|
|
205
|
-
currency: 'Galleon',
|
|
206
|
-
level: 3
|
|
207
|
-
}
|
|
208
|
-
});
|
|
209
|
-
await expect(testDestination.testAction('reportConversionEvent', {
|
|
210
|
-
event,
|
|
211
|
-
settings,
|
|
212
|
-
useDefaultMappings: true,
|
|
213
|
-
auth: {
|
|
214
|
-
accessToken,
|
|
215
|
-
refreshToken
|
|
216
|
-
},
|
|
217
|
-
mapping: {
|
|
218
|
-
event_type: 'PURCHASE',
|
|
219
|
-
event_conversion_type: 'WEB'
|
|
220
|
-
}
|
|
221
|
-
})).rejects.toThrowError('Galleon is not a valid currency code.');
|
|
222
|
-
});
|
|
223
|
-
it('should fail missing event conversion type', async () => {
|
|
224
|
-
nock_1.default(`https://tr.snapchat.com/v2/conversion`).post('').reply(400, {});
|
|
225
|
-
const event = actions_core_1.createTestEvent({
|
|
226
|
-
timestamp: timestamp,
|
|
227
|
-
messageId: 'test-message-rv4t40s898k',
|
|
228
|
-
event: 'PURCHASE',
|
|
229
|
-
type: 'track',
|
|
230
|
-
properties: {
|
|
231
|
-
email: 'test123@gmail.com',
|
|
232
|
-
phone: '+44 844 412 4653',
|
|
233
|
-
event_tag: 'back-to-school',
|
|
234
|
-
number_items: 10,
|
|
235
|
-
price: '15',
|
|
236
|
-
currency: 'Galleon',
|
|
237
|
-
level: 3
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
await expect(testDestination.testAction('reportConversionEvent', {
|
|
241
|
-
event,
|
|
242
|
-
settings,
|
|
243
|
-
useDefaultMappings: true,
|
|
244
|
-
auth: {
|
|
245
|
-
accessToken,
|
|
246
|
-
refreshToken
|
|
247
|
-
},
|
|
248
|
-
mapping: {
|
|
249
|
-
event_type: 'PURCHASE'
|
|
250
|
-
}
|
|
251
|
-
})).rejects.toThrowError("The root value is missing the required field 'event_conversion_type'.");
|
|
252
|
-
});
|
|
253
|
-
it('should handle a custom event', async () => {
|
|
254
|
-
nock_1.default(`https://tr.snapchat.com/v2/conversion`).post('').reply(200, {});
|
|
255
|
-
const event = actions_core_1.createTestEvent({
|
|
256
|
-
timestamp: timestamp,
|
|
257
|
-
messageId: 'test-message-rv4t40s898k',
|
|
258
|
-
event: 'CUSTOM_EVENT_5',
|
|
259
|
-
type: 'track',
|
|
260
|
-
properties: {
|
|
261
|
-
email: 'test123@gmail.com',
|
|
262
|
-
phone: '+44 844 412 4653',
|
|
263
|
-
event_tag: 'back-to-school',
|
|
264
|
-
number_items: 10,
|
|
265
|
-
price: '15',
|
|
266
|
-
currency: 'USD',
|
|
267
|
-
level: 3
|
|
268
|
-
}
|
|
269
|
-
});
|
|
270
|
-
const responses = await testDestination.testAction('reportConversionEvent', {
|
|
271
|
-
event,
|
|
272
|
-
settings: {
|
|
273
|
-
snap_app_id: '123',
|
|
274
|
-
app_id: '123'
|
|
275
|
-
},
|
|
276
|
-
useDefaultMappings: true,
|
|
277
|
-
auth: {
|
|
278
|
-
accessToken,
|
|
279
|
-
refreshToken
|
|
280
|
-
},
|
|
281
|
-
mapping: {
|
|
282
|
-
event_type: { '@path': '$.event' },
|
|
283
|
-
event_conversion_type: 'MOBILE_APP'
|
|
284
|
-
}
|
|
285
|
-
});
|
|
286
|
-
expect(responses.length).toBe(1);
|
|
287
|
-
expect(responses[0].status).toBe(200);
|
|
288
|
-
expect(responses[0].options.body).toMatchInlineSnapshot(`"{\\"event_type\\":\\"CUSTOM_EVENT_5\\",\\"event_conversion_type\\":\\"MOBILE_APP\\",\\"timestamp\\":1652368875449,\\"hashed_email\\":\\"cc779c04191c2e736d89e45c11339c8382832bcaf70383f7df94e3d08ba7a6d9\\",\\"hashed_phone_number\\":\\"dc008fda46e2e64002cf2f82a4906236282d431c4f75e5b60bfe79fc48546383\\",\\"user_agent\\":\\"Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1\\",\\"hashed_ip_address\\":\\"838c4c2573848f58e74332341a7ca6bc5cd86a8aec7d644137d53b4d597f10f5\\",\\"price\\":15,\\"currency\\":\\"USD\\",\\"page_url\\":\\"https://segment.com/academy/\\",\\"snap_app_id\\":\\"123\\",\\"app_id\\":\\"123\\"}"`);
|
|
289
|
-
});
|
|
290
|
-
});
|
|
291
|
-
});
|
|
292
|
-
//# sourceMappingURL=index.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../../../../src/destinations/snap-conversions-api/_tests_/index.test.ts"],"names":[],"mappings":";;;;;AAAA,gDAAuB;AACvB,wDAA8E;AAC9E,qDAAiC;AAGjC,MAAM,eAAe,GAAG,oCAAqB,CAAC,eAAU,CAAC,CAAA;AACzD,MAAM,SAAS,GAAG,0BAA0B,CAAA;AAC5C,MAAM,QAAQ,GAAa;IACzB,WAAW,EAAE,SAAS;IACtB,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE,SAAS;CAClB,CAAA;AACD,MAAM,WAAW,GAAG,SAAS,CAAA;AAC7B,MAAM,YAAY,GAAG,SAAS,CAAA;AAE9B,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;QACrC,EAAE,CAA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,CAAC;iBACT;aACF,CAAC,CAAA;YAEF,MAAM,SAAS,GAAG,MAAM,eAAe,CAAC,UAAU,CAAC,uBAAuB,EAAE;gBAC1E,KAAK;gBACL,QAAQ,EAAE;oBACR,WAAW,EAAE,KAAK;oBAClB,MAAM,EAAE,KAAK;iBACd;gBACD,kBAAkB,EAAE,IAAI;gBACxB,IAAI,EAAE;oBACJ,WAAW;oBACX,YAAY;iBACb;gBACD,OAAO,EAAE;oBACP,UAAU,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;oBAClC,qBAAqB,EAAE,YAAY;iBACpC;aACF,CAAC,CAAA;YAEF,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YAChC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;YAErC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,qBAAqB,CACrD,0rBAA0rB,CAC3rB,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { InputField } from '@segment/actions-core/src/destination-kit/types';
|
|
2
|
-
import { Payload } from './reportConversionEvent/generated-types';
|
|
3
|
-
export declare const CURRENCY_ISO_CODES: Set<string>;
|
|
4
|
-
export declare const event_type: InputField;
|
|
5
|
-
export declare const event_conversion_type: InputField;
|
|
6
|
-
export declare const event_tag: InputField;
|
|
7
|
-
export declare const timestamp: InputField;
|
|
8
|
-
export declare const email: InputField;
|
|
9
|
-
export declare const mobile_ad_id: InputField;
|
|
10
|
-
export declare const uuid_c1: InputField;
|
|
11
|
-
export declare const idfv: InputField;
|
|
12
|
-
export declare const phone_number: InputField;
|
|
13
|
-
export declare const user_agent: InputField;
|
|
14
|
-
export declare const ip_address: InputField;
|
|
15
|
-
export declare const item_category: InputField;
|
|
16
|
-
export declare const item_ids: InputField;
|
|
17
|
-
export declare const description: InputField;
|
|
18
|
-
export declare const number_items: InputField;
|
|
19
|
-
export declare const price: InputField;
|
|
20
|
-
export declare const currency: InputField;
|
|
21
|
-
export declare const transaction_id: InputField;
|
|
22
|
-
export declare const level: InputField;
|
|
23
|
-
export declare const client_dedup_id: InputField;
|
|
24
|
-
export declare const search_string: InputField;
|
|
25
|
-
export declare const page_url: InputField;
|
|
26
|
-
export declare const sign_up_method: InputField;
|
|
27
|
-
export declare const hash: (value: string | undefined) => string | undefined;
|
|
28
|
-
export declare const formatPayload: (payload: Payload) => Object;
|
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatPayload = exports.hash = exports.sign_up_method = exports.page_url = exports.search_string = exports.client_dedup_id = exports.level = exports.transaction_id = exports.currency = exports.price = exports.number_items = exports.description = exports.item_ids = exports.item_category = exports.ip_address = exports.user_agent = exports.phone_number = exports.idfv = exports.uuid_c1 = exports.mobile_ad_id = exports.email = exports.timestamp = exports.event_tag = exports.event_conversion_type = exports.event_type = exports.CURRENCY_ISO_CODES = void 0;
|
|
4
|
-
const crypto_1 = require("crypto");
|
|
5
|
-
exports.CURRENCY_ISO_CODES = new Set([
|
|
6
|
-
'USD',
|
|
7
|
-
'AED',
|
|
8
|
-
'AUD',
|
|
9
|
-
'BGN',
|
|
10
|
-
'BRL',
|
|
11
|
-
'CAD',
|
|
12
|
-
'CHF',
|
|
13
|
-
'CLP',
|
|
14
|
-
'CNY',
|
|
15
|
-
'COP',
|
|
16
|
-
'CZK',
|
|
17
|
-
'DKK',
|
|
18
|
-
'EGP',
|
|
19
|
-
'EUR',
|
|
20
|
-
'GBP',
|
|
21
|
-
'GIP',
|
|
22
|
-
'HKD',
|
|
23
|
-
'HRK',
|
|
24
|
-
'HUF',
|
|
25
|
-
'IDR',
|
|
26
|
-
'ILS',
|
|
27
|
-
'INR',
|
|
28
|
-
'JPY',
|
|
29
|
-
'KRW',
|
|
30
|
-
'KWD',
|
|
31
|
-
'KZT',
|
|
32
|
-
'LBP',
|
|
33
|
-
'MXN',
|
|
34
|
-
'MYR',
|
|
35
|
-
'NGN',
|
|
36
|
-
'NOK',
|
|
37
|
-
'NZD',
|
|
38
|
-
'PEN',
|
|
39
|
-
'PHP',
|
|
40
|
-
'PKR',
|
|
41
|
-
'PLN',
|
|
42
|
-
'QAR',
|
|
43
|
-
'RON',
|
|
44
|
-
'RUB',
|
|
45
|
-
'SAR',
|
|
46
|
-
'SEK',
|
|
47
|
-
'SGD',
|
|
48
|
-
'THB',
|
|
49
|
-
'TRY',
|
|
50
|
-
'TWD',
|
|
51
|
-
'TZS',
|
|
52
|
-
'UAH',
|
|
53
|
-
'VND',
|
|
54
|
-
'ZAR',
|
|
55
|
-
'ALL',
|
|
56
|
-
'BHD',
|
|
57
|
-
'DZD',
|
|
58
|
-
'GHS',
|
|
59
|
-
'IQD',
|
|
60
|
-
'ISK',
|
|
61
|
-
'JOD',
|
|
62
|
-
'KES',
|
|
63
|
-
'MAD',
|
|
64
|
-
'OMR',
|
|
65
|
-
'XOF'
|
|
66
|
-
]);
|
|
67
|
-
exports.event_type = {
|
|
68
|
-
label: 'Event Type',
|
|
69
|
-
description: 'The conversion event type. Please refer to the possible event types in [Snapchat Marketing API docs](https://marketingapi.snapchat.com/docs/conversion.html#conversion-parameters).',
|
|
70
|
-
type: 'string'
|
|
71
|
-
};
|
|
72
|
-
exports.event_conversion_type = {
|
|
73
|
-
label: 'Event Conversion Type',
|
|
74
|
-
description: 'Where the event took place. This must be OFFLINE, WEB, or MOBILE_APP.',
|
|
75
|
-
type: 'string',
|
|
76
|
-
choices: [
|
|
77
|
-
{ label: 'Offline', value: 'OFFLINE' },
|
|
78
|
-
{ label: 'Web', value: 'WEB' },
|
|
79
|
-
{ label: 'Mobile App', value: 'MOBILE_APP' }
|
|
80
|
-
]
|
|
81
|
-
};
|
|
82
|
-
exports.event_tag = {
|
|
83
|
-
label: 'Event Tag',
|
|
84
|
-
description: 'Custom event label',
|
|
85
|
-
type: 'string'
|
|
86
|
-
};
|
|
87
|
-
exports.timestamp = {
|
|
88
|
-
label: 'Event Timestamp',
|
|
89
|
-
description: 'The Epoch timestamp for when the conversion happened. The timestamp cannot be more than 28 days in the past',
|
|
90
|
-
type: 'string',
|
|
91
|
-
default: {
|
|
92
|
-
'@path': '$.timestamp'
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
exports.email = {
|
|
96
|
-
label: 'Email',
|
|
97
|
-
description: 'Email address of the user who triggered the conversion event. Segment will normalize and hash this value before sending to Snapchat.',
|
|
98
|
-
type: 'string',
|
|
99
|
-
default: {
|
|
100
|
-
'@if': {
|
|
101
|
-
exists: { '@path': '$.properties.email' },
|
|
102
|
-
then: { '@path': '$.properties.email' },
|
|
103
|
-
else: { '@path': '$.traits.email' }
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
exports.mobile_ad_id = {
|
|
108
|
-
label: 'Mobile Ad Indeentifier',
|
|
109
|
-
description: 'Mobile ad identifier (IDFA or AAID) of the user who triggered the conversion event. Segment will normalize and hash this value before sending to Snapchat.',
|
|
110
|
-
type: 'string',
|
|
111
|
-
default: {
|
|
112
|
-
'@path': '$.context.device.advertisingId'
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
exports.uuid_c1 = {
|
|
116
|
-
label: 'uuid_c1 Cookie',
|
|
117
|
-
description: 'Unique user ID cookie. If you are using the Pixel SDK, you can access a cookie1 by looking at the _scid value.',
|
|
118
|
-
type: 'string'
|
|
119
|
-
};
|
|
120
|
-
exports.idfv = {
|
|
121
|
-
label: 'Indentifier for Vendor',
|
|
122
|
-
description: 'IDFV of the user’s device. Segment will normalize and hash this value before sending to Snapchat.',
|
|
123
|
-
type: 'string',
|
|
124
|
-
default: {
|
|
125
|
-
'@path': '$.context.device.id'
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
exports.phone_number = {
|
|
129
|
-
label: 'Phone Number',
|
|
130
|
-
description: 'Phone number of the user who triggered the conversion event. Segment will normalize and hash this value before sending to Snapchat.',
|
|
131
|
-
type: 'string',
|
|
132
|
-
default: {
|
|
133
|
-
'@if': {
|
|
134
|
-
exists: { '@path': '$.properties.phone' },
|
|
135
|
-
then: { '@path': '$.properties.phone' },
|
|
136
|
-
else: { '@path': '$.traits.phone' }
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
exports.user_agent = {
|
|
141
|
-
label: 'User Agent',
|
|
142
|
-
description: 'User agent from the user’s device.',
|
|
143
|
-
type: 'string',
|
|
144
|
-
default: {
|
|
145
|
-
'@path': '$.context.userAgent'
|
|
146
|
-
}
|
|
147
|
-
};
|
|
148
|
-
exports.ip_address = {
|
|
149
|
-
label: 'IP Address',
|
|
150
|
-
description: 'IP address of the device or browser. Segment will normalize and hash this value before sending to Snapchat.',
|
|
151
|
-
type: 'string',
|
|
152
|
-
default: {
|
|
153
|
-
'@path': '$.context.ip'
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
exports.item_category = {
|
|
157
|
-
label: 'Item Category',
|
|
158
|
-
description: 'Category of the item.',
|
|
159
|
-
type: 'string',
|
|
160
|
-
default: {
|
|
161
|
-
'@path': '$.properties.category'
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
exports.item_ids = {
|
|
165
|
-
label: 'Item IDs',
|
|
166
|
-
description: 'International Article Number (EAN) when applicable, or other product or category identifier. ',
|
|
167
|
-
type: 'string',
|
|
168
|
-
default: {
|
|
169
|
-
'@path': '$.properties.product_id'
|
|
170
|
-
}
|
|
171
|
-
};
|
|
172
|
-
exports.description = {
|
|
173
|
-
label: 'Description',
|
|
174
|
-
description: 'A string description for additional info.',
|
|
175
|
-
type: 'string'
|
|
176
|
-
};
|
|
177
|
-
exports.number_items = {
|
|
178
|
-
label: 'Number of Items',
|
|
179
|
-
description: 'Number of items.',
|
|
180
|
-
type: 'string',
|
|
181
|
-
default: {
|
|
182
|
-
'@path': '$.properties.quantity'
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
exports.price = {
|
|
186
|
-
label: 'Price',
|
|
187
|
-
description: 'Value of the purchase.',
|
|
188
|
-
type: 'number',
|
|
189
|
-
default: {
|
|
190
|
-
'@if': {
|
|
191
|
-
exists: { '@path': '$.properties.price' },
|
|
192
|
-
then: { '@path': '$.properties.price' },
|
|
193
|
-
else: { '@path': '$.properties.value' }
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
exports.currency = {
|
|
198
|
-
label: 'Currency',
|
|
199
|
-
description: 'Currency for the value specified as ISO 4217 code.',
|
|
200
|
-
type: 'string',
|
|
201
|
-
default: {
|
|
202
|
-
'@path': '$.properties.currency'
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
exports.transaction_id = {
|
|
206
|
-
label: 'Transaction ID',
|
|
207
|
-
description: 'Transaction ID or order ID tied to the conversion event. Please refer to the [Snapchat Marketing API docs](https://marketingapi.snapchat.com/docs/conversion.html#deduplication) for information on how this field is used for deduplication against Snap Pixel SDK and App Adds Kit events.',
|
|
208
|
-
type: 'string',
|
|
209
|
-
default: {
|
|
210
|
-
'@path': '$.properties.order_id'
|
|
211
|
-
}
|
|
212
|
-
};
|
|
213
|
-
exports.level = {
|
|
214
|
-
label: 'Level',
|
|
215
|
-
description: 'Represents a level in the context of a game.',
|
|
216
|
-
type: 'string'
|
|
217
|
-
};
|
|
218
|
-
exports.client_dedup_id = {
|
|
219
|
-
label: 'Client Deduplication ID',
|
|
220
|
-
description: 'If you are reporting events via more than one method (Snap Pixel, App Ads Kit, Conversions API) you should use the same client_dedup_id across all methods. Please refer to the [Snapchat Marketing API docs](https://marketingapi.snapchat.com/docs/conversion.html#deduplication) for information on how this field is used for deduplication against Snap Pixel SDK and App Adds Kit events.',
|
|
221
|
-
type: 'string'
|
|
222
|
-
};
|
|
223
|
-
exports.search_string = {
|
|
224
|
-
label: 'Search String',
|
|
225
|
-
description: 'The text string that was searched for.',
|
|
226
|
-
type: 'string',
|
|
227
|
-
default: {
|
|
228
|
-
'@path': '$.properties.query'
|
|
229
|
-
}
|
|
230
|
-
};
|
|
231
|
-
exports.page_url = {
|
|
232
|
-
label: 'Page URL',
|
|
233
|
-
description: 'The URL of the web page where the event took place.',
|
|
234
|
-
type: 'string',
|
|
235
|
-
default: {
|
|
236
|
-
'@path': '$.context.page.url'
|
|
237
|
-
}
|
|
238
|
-
};
|
|
239
|
-
exports.sign_up_method = {
|
|
240
|
-
label: 'Sign Up Method',
|
|
241
|
-
description: 'A string indicating the sign up method.',
|
|
242
|
-
type: 'string'
|
|
243
|
-
};
|
|
244
|
-
const hash = (value) => {
|
|
245
|
-
if (value === undefined)
|
|
246
|
-
return;
|
|
247
|
-
const hash = crypto_1.createHash('sha256');
|
|
248
|
-
hash.update(value);
|
|
249
|
-
return hash.digest('hex');
|
|
250
|
-
};
|
|
251
|
-
exports.hash = hash;
|
|
252
|
-
const formatPayload = (payload) => {
|
|
253
|
-
if (payload.email) {
|
|
254
|
-
payload.email = payload.email.replace(/\s/g, '').toLowerCase();
|
|
255
|
-
}
|
|
256
|
-
if (payload.phone_number) {
|
|
257
|
-
payload.phone_number = payload.phone_number.replace(/\D|^0+/g, '');
|
|
258
|
-
}
|
|
259
|
-
if (payload.mobile_ad_id) {
|
|
260
|
-
payload.mobile_ad_id = payload.mobile_ad_id.toLowerCase();
|
|
261
|
-
}
|
|
262
|
-
return {
|
|
263
|
-
event_type: payload?.event_type,
|
|
264
|
-
event_conversion_type: payload?.event_conversion_type,
|
|
265
|
-
event_tag: payload?.event_tag,
|
|
266
|
-
timestamp: Date.parse(payload?.timestamp),
|
|
267
|
-
hashed_email: exports.hash(payload?.email),
|
|
268
|
-
mobile_ad_id: exports.hash(payload?.mobile_ad_id),
|
|
269
|
-
uuid_c1: payload?.uuid_c1,
|
|
270
|
-
hashed_idfv: exports.hash(payload?.idfv),
|
|
271
|
-
hashed_phone_number: exports.hash(payload?.phone_number),
|
|
272
|
-
user_agent: payload?.user_agent,
|
|
273
|
-
hashed_ip_address: exports.hash(payload?.ip_address),
|
|
274
|
-
item_category: payload?.item_category,
|
|
275
|
-
item_ids: payload?.item_ids,
|
|
276
|
-
description: payload?.description,
|
|
277
|
-
number_items: payload?.number_items,
|
|
278
|
-
price: payload?.price,
|
|
279
|
-
currency: payload?.currency,
|
|
280
|
-
transaction_id: payload?.transaction_id,
|
|
281
|
-
level: payload?.level,
|
|
282
|
-
client_dedup_id: payload?.client_dedup_id,
|
|
283
|
-
search_string: payload?.search_string,
|
|
284
|
-
page_url: payload?.page_url,
|
|
285
|
-
sign_up_method: payload?.sign_up_method
|
|
286
|
-
};
|
|
287
|
-
};
|
|
288
|
-
exports.formatPayload = formatPayload;
|
|
289
|
-
//# sourceMappingURL=snap-capi-properties.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snap-capi-properties.js","sourceRoot":"","sources":["../../../src/destinations/snap-conversions-api/snap-capi-properties.ts"],"names":[],"mappings":";;;AACA,mCAAmC;AAGtB,QAAA,kBAAkB,GAAG,IAAI,GAAG,CAAC;IACxC,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;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