@segment/action-destinations 3.28.1-alpha.1 → 3.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/destinations/index.js +0 -1
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/mixpanel/groupIdentifyUser/generated-types.d.ts +1 -1
- package/dist/destinations/mixpanel/groupIdentifyUser/index.d.ts +1 -1
- package/dist/destinations/mixpanel/groupIdentifyUser/index.js +10 -8
- package/dist/destinations/mixpanel/groupIdentifyUser/index.js.map +1 -1
- package/dist/destinations/pipedrive/createUpdateActivity/generated-types.d.ts +17 -0
- package/dist/destinations/{facebook-conversions-api/addToCart → pipedrive/createUpdateActivity}/generated-types.js +0 -0
- package/dist/destinations/pipedrive/createUpdateActivity/generated-types.js.map +1 -0
- package/dist/destinations/{facebook-conversions-api/custom → pipedrive/createUpdateActivity}/index.d.ts +1 -1
- package/dist/destinations/pipedrive/createUpdateActivity/index.js +157 -0
- package/dist/destinations/pipedrive/createUpdateActivity/index.js.map +1 -0
- package/dist/destinations/pipedrive/createUpdateDeal/generated-types.d.ts +18 -0
- package/dist/destinations/{facebook-conversions-api/custom → pipedrive/createUpdateDeal}/generated-types.js +0 -0
- package/dist/destinations/pipedrive/createUpdateDeal/generated-types.js.map +1 -0
- package/dist/destinations/{facebook-conversions-api/pageView → pipedrive/createUpdateDeal}/index.d.ts +1 -1
- package/dist/destinations/pipedrive/createUpdateDeal/index.js +174 -0
- package/dist/destinations/pipedrive/createUpdateDeal/index.js.map +1 -0
- package/dist/destinations/pipedrive/createUpdateLead/generated-types.d.ts +15 -0
- package/dist/destinations/{facebook-conversions-api → pipedrive/createUpdateLead}/generated-types.js +0 -0
- package/dist/destinations/pipedrive/createUpdateLead/generated-types.js.map +1 -0
- package/dist/destinations/{facebook-conversions-api/initiateCheckout → pipedrive/createUpdateLead}/index.d.ts +1 -1
- package/dist/destinations/pipedrive/createUpdateLead/index.js +129 -0
- package/dist/destinations/pipedrive/createUpdateLead/index.js.map +1 -0
- package/dist/destinations/pipedrive/createUpdateNote/generated-types.d.ts +11 -0
- package/dist/destinations/{facebook-conversions-api/initiateCheckout → pipedrive/createUpdateNote}/generated-types.js +0 -0
- package/dist/destinations/pipedrive/createUpdateNote/generated-types.js.map +1 -0
- package/dist/destinations/{facebook-conversions-api/addToCart → pipedrive/createUpdateNote}/index.d.ts +1 -1
- package/dist/destinations/pipedrive/createUpdateNote/index.js +115 -0
- package/dist/destinations/pipedrive/createUpdateNote/index.js.map +1 -0
- package/dist/destinations/pipedrive/createUpdateOrganization/generated-types.d.ts +5 -4
- package/dist/destinations/pipedrive/createUpdateOrganization/index.js +38 -30
- package/dist/destinations/pipedrive/createUpdateOrganization/index.js.map +1 -1
- package/dist/destinations/pipedrive/createUpdatePerson/generated-types.d.ts +6 -5
- package/dist/destinations/pipedrive/createUpdatePerson/index.js +39 -55
- package/dist/destinations/pipedrive/createUpdatePerson/index.js.map +1 -1
- package/dist/destinations/pipedrive/generated-types.d.ts +3 -0
- package/dist/destinations/pipedrive/index.js +31 -2
- package/dist/destinations/pipedrive/index.js.map +1 -1
- package/dist/destinations/pipedrive/pipedriveApi/activities.d.ts +17 -0
- package/dist/destinations/pipedrive/pipedriveApi/activities.js +11 -0
- package/dist/destinations/pipedrive/pipedriveApi/activities.js.map +1 -0
- package/dist/destinations/pipedrive/pipedriveApi/deals.d.ts +18 -0
- package/dist/destinations/pipedrive/pipedriveApi/deals.js +8 -0
- package/dist/destinations/pipedrive/pipedriveApi/deals.js.map +1 -0
- package/dist/destinations/pipedrive/pipedriveApi/domain.d.ts +19 -0
- package/dist/destinations/pipedrive/pipedriveApi/domain.js +3 -0
- package/dist/destinations/pipedrive/pipedriveApi/domain.js.map +1 -0
- package/dist/destinations/pipedrive/pipedriveApi/leads.d.ts +12 -0
- package/dist/destinations/pipedrive/pipedriveApi/leads.js +8 -0
- package/dist/destinations/pipedrive/pipedriveApi/leads.js.map +1 -0
- package/dist/destinations/pipedrive/pipedriveApi/notes.d.ts +11 -0
- package/dist/destinations/pipedrive/pipedriveApi/notes.js +8 -0
- package/dist/destinations/pipedrive/pipedriveApi/notes.js.map +1 -0
- package/dist/destinations/pipedrive/pipedriveApi/organizations.d.ts +8 -0
- package/dist/destinations/pipedrive/pipedriveApi/organizations.js +19 -0
- package/dist/destinations/pipedrive/pipedriveApi/organizations.js.map +1 -0
- package/dist/destinations/pipedrive/pipedriveApi/persons.d.ts +10 -0
- package/dist/destinations/pipedrive/pipedriveApi/persons.js +19 -0
- package/dist/destinations/pipedrive/pipedriveApi/persons.js.map +1 -0
- package/dist/destinations/pipedrive/pipedriveApi/pipedrive-client.d.ts +29 -0
- package/dist/destinations/pipedrive/pipedriveApi/pipedrive-client.js +118 -0
- package/dist/destinations/pipedrive/pipedriveApi/pipedrive-client.js.map +1 -0
- package/dist/lib/test-data.js +9 -2
- package/dist/lib/test-data.js.map +1 -1
- package/package.json +3 -4
- package/dist/destinations/facebook-conversions-api/addToCart/generated-types.d.ts +0 -37
- package/dist/destinations/facebook-conversions-api/addToCart/generated-types.js.map +0 -1
- package/dist/destinations/facebook-conversions-api/addToCart/index.js +0 -84
- package/dist/destinations/facebook-conversions-api/addToCart/index.js.map +0 -1
- package/dist/destinations/facebook-conversions-api/constants.d.ts +0 -4
- package/dist/destinations/facebook-conversions-api/constants.js +0 -485
- package/dist/destinations/facebook-conversions-api/constants.js.map +0 -1
- package/dist/destinations/facebook-conversions-api/custom/generated-types.d.ts +0 -30
- package/dist/destinations/facebook-conversions-api/custom/generated-types.js.map +0 -1
- package/dist/destinations/facebook-conversions-api/custom/index.js +0 -58
- package/dist/destinations/facebook-conversions-api/custom/index.js.map +0 -1
- package/dist/destinations/facebook-conversions-api/fb-capi-properties.d.ts +0 -13
- package/dist/destinations/facebook-conversions-api/fb-capi-properties.js +0 -100
- package/dist/destinations/facebook-conversions-api/fb-capi-properties.js.map +0 -1
- package/dist/destinations/facebook-conversions-api/fb-capi-user-data.d.ts +0 -7
- package/dist/destinations/facebook-conversions-api/fb-capi-user-data.js +0 -227
- package/dist/destinations/facebook-conversions-api/fb-capi-user-data.js.map +0 -1
- package/dist/destinations/facebook-conversions-api/generated-types.d.ts +0 -3
- package/dist/destinations/facebook-conversions-api/generated-types.js.map +0 -1
- package/dist/destinations/facebook-conversions-api/index.d.ts +0 -4
- package/dist/destinations/facebook-conversions-api/index.js +0 -51
- package/dist/destinations/facebook-conversions-api/index.js.map +0 -1
- package/dist/destinations/facebook-conversions-api/initiateCheckout/generated-types.d.ts +0 -37
- package/dist/destinations/facebook-conversions-api/initiateCheckout/generated-types.js.map +0 -1
- package/dist/destinations/facebook-conversions-api/initiateCheckout/index.js +0 -89
- package/dist/destinations/facebook-conversions-api/initiateCheckout/index.js.map +0 -1
- package/dist/destinations/facebook-conversions-api/pageView/generated-types.d.ts +0 -26
- package/dist/destinations/facebook-conversions-api/pageView/generated-types.js +0 -3
- package/dist/destinations/facebook-conversions-api/pageView/generated-types.js.map +0 -1
- package/dist/destinations/facebook-conversions-api/pageView/index.js +0 -43
- package/dist/destinations/facebook-conversions-api/pageView/index.js.map +0 -1
- package/dist/destinations/facebook-conversions-api/purchase/generated-types.d.ts +0 -38
- package/dist/destinations/facebook-conversions-api/purchase/generated-types.js +0 -3
- package/dist/destinations/facebook-conversions-api/purchase/generated-types.js.map +0 -1
- package/dist/destinations/facebook-conversions-api/purchase/index.d.ts +0 -5
- package/dist/destinations/facebook-conversions-api/purchase/index.js +0 -92
- package/dist/destinations/facebook-conversions-api/purchase/index.js.map +0 -1
- package/dist/destinations/facebook-conversions-api/search/generated-types.d.ts +0 -37
- package/dist/destinations/facebook-conversions-api/search/generated-types.js +0 -3
- package/dist/destinations/facebook-conversions-api/search/generated-types.js.map +0 -1
- package/dist/destinations/facebook-conversions-api/search/index.d.ts +0 -5
- package/dist/destinations/facebook-conversions-api/search/index.js +0 -91
- package/dist/destinations/facebook-conversions-api/search/index.js.map +0 -1
- package/dist/destinations/facebook-conversions-api/viewContent/generated-types.d.ts +0 -38
- package/dist/destinations/facebook-conversions-api/viewContent/generated-types.js +0 -3
- package/dist/destinations/facebook-conversions-api/viewContent/generated-types.js.map +0 -1
- package/dist/destinations/facebook-conversions-api/viewContent/index.d.ts +0 -5
- package/dist/destinations/facebook-conversions-api/viewContent/index.js +0 -85
- package/dist/destinations/facebook-conversions-api/viewContent/index.js.map +0 -1
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.event_id = exports.event_source_url = exports.action_source = exports.event_time = exports.num_items = exports.contents = exports.content_type = exports.content_name = exports.content_ids = exports.content_category = exports.value = exports.currency = void 0;
|
|
4
|
-
exports.currency = {
|
|
5
|
-
label: 'Currency',
|
|
6
|
-
description: 'The currency for the value specified.',
|
|
7
|
-
type: 'string',
|
|
8
|
-
default: {
|
|
9
|
-
'@path': '$.properties.currency'
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
exports.value = {
|
|
13
|
-
label: 'Value',
|
|
14
|
-
description: 'The value of a user performing this event to the business.',
|
|
15
|
-
type: 'number',
|
|
16
|
-
};
|
|
17
|
-
exports.content_category = {
|
|
18
|
-
label: 'Content Category',
|
|
19
|
-
description: 'Category of the page/product.',
|
|
20
|
-
type: 'string'
|
|
21
|
-
};
|
|
22
|
-
exports.content_ids = {
|
|
23
|
-
label: 'Content IDs',
|
|
24
|
-
description: 'Product IDs associated with the event, such as SKUs (e.g. ["ABC123", "XYZ789"]).',
|
|
25
|
-
type: 'string',
|
|
26
|
-
multiple: true,
|
|
27
|
-
};
|
|
28
|
-
exports.content_name = {
|
|
29
|
-
label: 'Content Name',
|
|
30
|
-
description: 'Name of the page/product.',
|
|
31
|
-
type: 'string'
|
|
32
|
-
};
|
|
33
|
-
exports.content_type = {
|
|
34
|
-
label: 'Content Type',
|
|
35
|
-
description: 'Either product or product_group based on the content_ids or contents being passed.',
|
|
36
|
-
type: 'string'
|
|
37
|
-
};
|
|
38
|
-
exports.contents = {
|
|
39
|
-
label: 'Contents',
|
|
40
|
-
description: 'An array of JSON objects that contains the quantity and the International Article Number (EAN) when applicable, or other product or content identifier(s). id and quantity are the required fields.',
|
|
41
|
-
type: 'object',
|
|
42
|
-
multiple: true,
|
|
43
|
-
properties: {
|
|
44
|
-
id: {
|
|
45
|
-
label: 'ID',
|
|
46
|
-
description: 'ID of the purchased item.',
|
|
47
|
-
type: 'string',
|
|
48
|
-
},
|
|
49
|
-
quantity: {
|
|
50
|
-
label: 'Quantity',
|
|
51
|
-
description: 'The number of items purchased.',
|
|
52
|
-
type: 'integer',
|
|
53
|
-
},
|
|
54
|
-
item_price: {
|
|
55
|
-
label: 'Item Price',
|
|
56
|
-
description: 'The price of the item.',
|
|
57
|
-
type: 'number'
|
|
58
|
-
},
|
|
59
|
-
delivery_category: {
|
|
60
|
-
label: 'Delivery Category',
|
|
61
|
-
description: 'Type of delivery for a purchase event. Supported values are "in_store", "curbside", "home_delivery".',
|
|
62
|
-
type: 'string'
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
exports.num_items = {
|
|
67
|
-
label: 'Number of Items',
|
|
68
|
-
description: 'The number of items when checkout was initiated.',
|
|
69
|
-
type: 'integer'
|
|
70
|
-
};
|
|
71
|
-
exports.event_time = {
|
|
72
|
-
label: 'Event Time',
|
|
73
|
-
description: 'A Unix timestamp in seconds indicating when the actual event occurred.',
|
|
74
|
-
type: 'string',
|
|
75
|
-
default: {
|
|
76
|
-
'@path': '$.timestamp'
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
exports.action_source = {
|
|
80
|
-
label: 'Action Source',
|
|
81
|
-
description: 'This field allows you to specify where your conversions occurred.',
|
|
82
|
-
type: 'string'
|
|
83
|
-
};
|
|
84
|
-
exports.event_source_url = {
|
|
85
|
-
label: 'Event Source URL',
|
|
86
|
-
description: 'The browser URL where the event happened. The URL must begin with http:// or https:// and should match the verified domain. event_source_url is required if action_source = “website”; however it is strongly recommended that you include it for any action_source.',
|
|
87
|
-
type: 'string',
|
|
88
|
-
default: {
|
|
89
|
-
'@path': '$.context.page.url'
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
exports.event_id = {
|
|
93
|
-
label: 'Event ID',
|
|
94
|
-
description: 'This ID can be any unique string chosen by the advertiser. event_id is used to deduplicate events sent by both Facebook Pixel and Conversions API.',
|
|
95
|
-
type: 'string',
|
|
96
|
-
default: {
|
|
97
|
-
'@path': '$.messageId'
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
//# sourceMappingURL=fb-capi-properties.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fb-capi-properties.js","sourceRoot":"","sources":["../../../src/destinations/facebook-conversions-api/fb-capi-properties.ts"],"names":[],"mappings":";;;AAMa,QAAA,QAAQ,GAAe;IAClC,KAAK,EAAE,UAAU;IACjB,WAAW,EAAE,uCAAuC;IACpD,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE;QACP,OAAO,EAAE,uBAAuB;KACjC;CACF,CAAA;AAEY,QAAA,KAAK,GAAe;IAC/B,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,4DAA4D;IACzE,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,gBAAgB,GAAe;IAC1C,KAAK,EAAE,kBAAkB;IACzB,WAAW,EAAE,+BAA+B;IAC5C,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,WAAW,GAAe;IACrC,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,kFAAkF;IAC/F,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;CACf,CAAA;AAEY,QAAA,YAAY,GAAe;IACtC,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,2BAA2B;IACxC,IAAI,EAAE,QAAQ;CACf,CAAA;AAEY,QAAA,YAAY,GAAe;IACtC,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE,oFA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AE,QAAQ;IACd,OAAO,EAAE;QACP,OAAO,EAAE,aAAa;KACvB;CACF,CAAA"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { InputField } from '@segment/actions-core/src/destination-kit/types';
|
|
2
|
-
import { Payload } from './addToCart/generated-types';
|
|
3
|
-
export declare const user_data_field: InputField;
|
|
4
|
-
declare type UserData = Pick<Payload, 'user_data'>;
|
|
5
|
-
export declare const normalize_user_data: (payload: UserData) => void;
|
|
6
|
-
export declare const hash_user_data: (payload: UserData) => Object;
|
|
7
|
-
export {};
|
|
@@ -1,227 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hash_user_data = exports.normalize_user_data = exports.user_data_field = void 0;
|
|
4
|
-
const crypto_1 = require("crypto");
|
|
5
|
-
const constants_1 = require("./constants");
|
|
6
|
-
exports.user_data_field = {
|
|
7
|
-
label: 'User Data',
|
|
8
|
-
description: 'These parameters are a set of identifiers Facebook can use for targeted attribution. You must provide at least one of the following user_data keys in your request.',
|
|
9
|
-
type: 'object',
|
|
10
|
-
required: true,
|
|
11
|
-
properties: {
|
|
12
|
-
externalId: {
|
|
13
|
-
label: 'External ID',
|
|
14
|
-
description: 'Any unique ID from the advertiser, such as loyalty membership IDs, user IDs, and external cookie IDs. You can send one or more external IDs for a given event.',
|
|
15
|
-
type: 'string',
|
|
16
|
-
},
|
|
17
|
-
email: {
|
|
18
|
-
label: 'Email',
|
|
19
|
-
description: 'An email address, in lowercase. Example: joe@eg.com',
|
|
20
|
-
type: 'string'
|
|
21
|
-
},
|
|
22
|
-
phone: {
|
|
23
|
-
label: 'Phone',
|
|
24
|
-
description: 'A phone number. Include only digits with country code, area code, and number. Remove symbols, letters, and any leading zeros. In addition, always include the country code as part of the customer phone number, even if all of the data is from the same country, as the country code is used for matching.',
|
|
25
|
-
type: 'string'
|
|
26
|
-
},
|
|
27
|
-
gender: {
|
|
28
|
-
label: 'Gender',
|
|
29
|
-
description: 'Gender, in lowercase. Either f or m.',
|
|
30
|
-
type: 'string'
|
|
31
|
-
},
|
|
32
|
-
dateOfBirth: {
|
|
33
|
-
label: 'Date of Birth',
|
|
34
|
-
description: 'A date of birth given as year, month, and day. Example: 19971226 for December 26, 1997.',
|
|
35
|
-
type: 'string'
|
|
36
|
-
},
|
|
37
|
-
lastName: {
|
|
38
|
-
label: 'Last Name',
|
|
39
|
-
description: 'A last name in lowercase.',
|
|
40
|
-
type: 'string'
|
|
41
|
-
},
|
|
42
|
-
firstName: {
|
|
43
|
-
label: 'First Name',
|
|
44
|
-
description: 'A first name in lowercase.',
|
|
45
|
-
type: 'string'
|
|
46
|
-
},
|
|
47
|
-
city: {
|
|
48
|
-
label: 'City',
|
|
49
|
-
description: 'A city in lower-case without spaces or punctuation. Example: menlopark.',
|
|
50
|
-
type: 'string'
|
|
51
|
-
},
|
|
52
|
-
state: {
|
|
53
|
-
label: 'State',
|
|
54
|
-
description: 'A two-letter state code in lowercase. Example: ca.',
|
|
55
|
-
type: 'string'
|
|
56
|
-
},
|
|
57
|
-
zip: {
|
|
58
|
-
label: 'Zip Code',
|
|
59
|
-
description: 'If you are in the United States, this is a five-digit zip code. For other locations, follow each country`s standards. Example: 94035 (for United States)',
|
|
60
|
-
type: 'string'
|
|
61
|
-
},
|
|
62
|
-
country: {
|
|
63
|
-
label: 'Country',
|
|
64
|
-
description: 'A two-letter country code in lowercase.',
|
|
65
|
-
type: 'string'
|
|
66
|
-
},
|
|
67
|
-
client_ip_address: {
|
|
68
|
-
label: 'Client IP Address',
|
|
69
|
-
description: 'The IP address of the browser corresponding to the event.',
|
|
70
|
-
type: 'string'
|
|
71
|
-
},
|
|
72
|
-
client_user_agent: {
|
|
73
|
-
label: 'Client User Agent',
|
|
74
|
-
description: 'The user agent for the browser corresponding to the event. client_user_agent is required if action_source = “website”; however it is strongly recommended that you include it for any action_source.',
|
|
75
|
-
type: 'string'
|
|
76
|
-
},
|
|
77
|
-
fbc: {
|
|
78
|
-
label: 'Click ID',
|
|
79
|
-
description: 'The Facebook click ID value stored in the _fbc browser cookie under your domain.',
|
|
80
|
-
type: 'string'
|
|
81
|
-
},
|
|
82
|
-
fbp: {
|
|
83
|
-
label: 'Browser ID',
|
|
84
|
-
description: 'The Facebook browser ID value stored in the _fbp browser cookie under your domain.',
|
|
85
|
-
type: 'string'
|
|
86
|
-
},
|
|
87
|
-
subscriptionID: {
|
|
88
|
-
label: 'Subscription ID',
|
|
89
|
-
description: 'The subscription ID for the user in this transaction.',
|
|
90
|
-
type: 'string'
|
|
91
|
-
},
|
|
92
|
-
leadID: {
|
|
93
|
-
label: 'Lead ID',
|
|
94
|
-
description: 'ID associated with a lead generated by Facebook`s Lead Ads.',
|
|
95
|
-
type: 'integer'
|
|
96
|
-
},
|
|
97
|
-
fbLoginID: {
|
|
98
|
-
label: 'Facebook Login ID',
|
|
99
|
-
description: 'ID issued by Facebook when a person first logs into an instance of an app.',
|
|
100
|
-
type: 'integer'
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
default: {
|
|
104
|
-
externalId: {
|
|
105
|
-
'@if': {
|
|
106
|
-
exists: { '@path': '$.properties.userId' },
|
|
107
|
-
then: { '@path': '$.properties.userId' },
|
|
108
|
-
else: { '@path': '$.properties.anonymousId' }
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
email: {
|
|
112
|
-
'@path': '$.context.traits.email'
|
|
113
|
-
},
|
|
114
|
-
phone: {
|
|
115
|
-
'@path': '$.context.traits.phone'
|
|
116
|
-
},
|
|
117
|
-
dateOfBirth: {
|
|
118
|
-
'@path': '$.context.traits.birthday'
|
|
119
|
-
},
|
|
120
|
-
lastName: {
|
|
121
|
-
'@path': '$.context.traits.lastName'
|
|
122
|
-
},
|
|
123
|
-
firstName: {
|
|
124
|
-
'@path': '$.context.traits.firstName'
|
|
125
|
-
},
|
|
126
|
-
city: {
|
|
127
|
-
'@path': '$.context.traits.address.city'
|
|
128
|
-
},
|
|
129
|
-
state: {
|
|
130
|
-
'@path': '$.context.traits.address.state'
|
|
131
|
-
},
|
|
132
|
-
zip: {
|
|
133
|
-
'@path': '$.context.traits.address.postalCode'
|
|
134
|
-
},
|
|
135
|
-
client_ip_address: {
|
|
136
|
-
'@path': '$.context.ip'
|
|
137
|
-
},
|
|
138
|
-
client_user_agent: {
|
|
139
|
-
'@path': '$.context.userAgent'
|
|
140
|
-
},
|
|
141
|
-
fbc: {
|
|
142
|
-
'@path': '$.properties.fbc'
|
|
143
|
-
},
|
|
144
|
-
fbp: {
|
|
145
|
-
'@path': '$.properties.fbp'
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
const hash = (value) => {
|
|
150
|
-
if (value === undefined)
|
|
151
|
-
return;
|
|
152
|
-
const hash = crypto_1.createHash('sha256');
|
|
153
|
-
hash.update(value);
|
|
154
|
-
return hash.digest('hex');
|
|
155
|
-
};
|
|
156
|
-
const normalize_user_data = (payload) => {
|
|
157
|
-
if (payload.user_data.email) {
|
|
158
|
-
payload.user_data.email = payload.user_data.email.replace(/\s/g, '').toLowerCase();
|
|
159
|
-
}
|
|
160
|
-
if (payload.user_data.phone) {
|
|
161
|
-
payload.user_data.phone = payload.user_data.phone.replace(/\D/g, '');
|
|
162
|
-
}
|
|
163
|
-
if (payload.user_data.gender) {
|
|
164
|
-
payload.user_data.gender = payload.user_data.gender.replace(/\s/g, '').toLowerCase();
|
|
165
|
-
switch (payload.user_data.gender) {
|
|
166
|
-
case 'male':
|
|
167
|
-
payload.user_data.gender = 'm';
|
|
168
|
-
break;
|
|
169
|
-
case 'female':
|
|
170
|
-
payload.user_data.gender = 'f';
|
|
171
|
-
break;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
if (payload.user_data.lastName) {
|
|
175
|
-
payload.user_data.lastName = payload.user_data.lastName.replace(/\s/g, '').toLowerCase();
|
|
176
|
-
}
|
|
177
|
-
if (payload.user_data.firstName) {
|
|
178
|
-
payload.user_data.firstName = payload.user_data.firstName.replace(/\s/g, '').toLowerCase();
|
|
179
|
-
}
|
|
180
|
-
if (payload.user_data.city) {
|
|
181
|
-
payload.user_data.city = payload.user_data.city.replace(/\s/g, '').toLowerCase();
|
|
182
|
-
}
|
|
183
|
-
if (payload.user_data.state) {
|
|
184
|
-
payload.user_data.state = payload.user_data.state.replace(/\s/g, '').toLowerCase();
|
|
185
|
-
if (constants_1.US_STATE_CODES.has(payload.user_data.state)) {
|
|
186
|
-
payload.user_data.state = constants_1.US_STATE_CODES.get(payload.user_data.state);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
if (payload.user_data.zip) {
|
|
190
|
-
payload.user_data.zip = payload.user_data.zip.replace(/\s/g, '').toLowerCase();
|
|
191
|
-
}
|
|
192
|
-
if (payload.user_data.country) {
|
|
193
|
-
payload.user_data.country = payload.user_data.country.replace(/\s/g, '').toLowerCase();
|
|
194
|
-
if (constants_1.COUNTRY_CODES.has(payload.user_data.country)) {
|
|
195
|
-
payload.user_data.country = constants_1.COUNTRY_CODES.get(payload.user_data.country);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
if (payload.user_data.externalId) {
|
|
199
|
-
payload.user_data.externalId = payload.user_data.externalId.replace(/\s/g, '').toLowerCase();
|
|
200
|
-
}
|
|
201
|
-
};
|
|
202
|
-
exports.normalize_user_data = normalize_user_data;
|
|
203
|
-
const hash_user_data = (payload) => {
|
|
204
|
-
exports.normalize_user_data(payload);
|
|
205
|
-
return {
|
|
206
|
-
em: hash(payload.user_data?.email),
|
|
207
|
-
ph: hash(payload.user_data?.phone),
|
|
208
|
-
ge: hash(payload.user_data?.gender),
|
|
209
|
-
db: hash(payload.user_data?.dateOfBirth),
|
|
210
|
-
ln: hash(payload.user_data?.lastName),
|
|
211
|
-
fn: hash(payload.user_data?.firstName),
|
|
212
|
-
ct: hash(payload.user_data?.city),
|
|
213
|
-
st: hash(payload.user_data?.state),
|
|
214
|
-
zp: hash(payload.user_data?.zip),
|
|
215
|
-
country: hash(payload.user_data?.country),
|
|
216
|
-
external_id: hash(payload.user_data?.externalId),
|
|
217
|
-
client_ip_address: payload.user_data?.client_ip_address,
|
|
218
|
-
client_user_agent: payload.user_data?.client_user_agent,
|
|
219
|
-
fbc: payload.user_data?.fbc,
|
|
220
|
-
fbp: payload.user_data?.fbp,
|
|
221
|
-
subscription_id: payload.user_data?.subscriptionID,
|
|
222
|
-
lead_id: payload.user_data?.leadID,
|
|
223
|
-
fb_login_id: payload.user_data?.fbLoginID
|
|
224
|
-
};
|
|
225
|
-
};
|
|
226
|
-
exports.hash_user_data = hash_user_data;
|
|
227
|
-
//# sourceMappingURL=fb-capi-user-data.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fb-capi-user-data.js","sourceRoot":"","sources":["../../../src/destinations/facebook-conversions-api/fb-capi-user-data.ts"],"names":[],"mappings":";;;AACA,mCAAmC;AACnC,2CAA2D;AAK9C,QAAA,eAAe,GAAe;IACzC,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,qKAAqK;IAClL,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE;QACV,UAAU,EAAE;YACV,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,gKAAgK;YAC7K,IAAI,EAAE,QAAQ;SACf;QACD,KAAK,EAAE;YACL,KAAK,EAAE,OAAO;YACd,WAAW,EAAE,qDAAqD;YAClE,IAAI,EAAE,QAAQ;SACf;QACD,KAAK,EAAE;YACL,KAAK,EAAE,OAAO;YACd,WAAW,EAAE,8SAA8S;YAC3T,IAAI,EAAE,QAAQ;SACf;QACD,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,sCAAsC;YACnD,IAAI,EAAE,QAAQ;SACf;QACD,WAAW,EAAE;YACX,KAAK,EAAE,eAAe;YACtB,WAAW,EAAE,yFAAyF;YACtG,IAAI,EAAE,QAAQ;SACf;QACD,QAAQ,EAAE;YAC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AS;KAC1C,CAAA;AACH,CAAC,CAAA;AAvBY,QAAA,cAAc,kBAuB1B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/facebook-conversions-api/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,51 +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 purchase_1 = __importDefault(require("./purchase"));
|
|
7
|
-
const initiateCheckout_1 = __importDefault(require("./initiateCheckout"));
|
|
8
|
-
const addToCart_1 = __importDefault(require("./addToCart"));
|
|
9
|
-
const viewContent_1 = __importDefault(require("./viewContent"));
|
|
10
|
-
const search_1 = __importDefault(require("./search"));
|
|
11
|
-
const pageView_1 = __importDefault(require("./pageView"));
|
|
12
|
-
const constants_1 = require("./constants");
|
|
13
|
-
const custom_1 = __importDefault(require("./custom"));
|
|
14
|
-
const destination = {
|
|
15
|
-
name: 'Facebook Conversions API (Actions)',
|
|
16
|
-
slug: 'actions-facebook-conversions-api',
|
|
17
|
-
mode: 'cloud',
|
|
18
|
-
authentication: {
|
|
19
|
-
scheme: 'custom',
|
|
20
|
-
fields: {
|
|
21
|
-
pixelId: {
|
|
22
|
-
label: 'Pixel ID',
|
|
23
|
-
description: 'Your Facebook Pixel ID',
|
|
24
|
-
type: 'string',
|
|
25
|
-
required: true
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
testAuthentication: async (request, { settings }) => {
|
|
29
|
-
const res = await request(`https://graph.facebook.com/v${constants_1.API_VERSION}/${settings.pixelId}/`, {
|
|
30
|
-
method: 'GET'
|
|
31
|
-
});
|
|
32
|
-
return res.status === 200;
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
extendRequest: () => {
|
|
36
|
-
return {
|
|
37
|
-
headers: { authorization: `Bearer ${process.env.ACTIONS_FB_CAPI_SYSTEM_USER_TOKEN}` }
|
|
38
|
-
};
|
|
39
|
-
},
|
|
40
|
-
actions: {
|
|
41
|
-
purchase: purchase_1.default,
|
|
42
|
-
initiateCheckout: initiateCheckout_1.default,
|
|
43
|
-
addToCart: addToCart_1.default,
|
|
44
|
-
viewContent: viewContent_1.default,
|
|
45
|
-
search: search_1.default,
|
|
46
|
-
pageView: pageView_1.default,
|
|
47
|
-
custom: custom_1.default
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
exports.default = destination;
|
|
51
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/facebook-conversions-api/index.ts"],"names":[],"mappings":";;;;;AAEA,0DAAiC;AACjC,0EAAiD;AACjD,4DAAmC;AACnC,gEAAuC;AACvC,sDAA6B;AAC7B,0DAAiC;AACjC,2CAAyC;AACzC,sDAA6B;AAE7B,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,oCAAoC;IAC1C,IAAI,EAAE,kCAAkC;IACxC,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,OAAO,EAAE;gBACP,KAAK,EAAE,UAAU;gBACjB,WAAW,EAAE,wBAAwB;gBACrC,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAClD,MAAM,GAAG,GAAG,MAAM,OAAO,CACvB,+BAA+B,uBAAW,IAAI,QAAQ,CAAC,OAAO,GAAG,EACjE;gBACE,MAAM,EAAE,KAAK;aACd,CACF,CAAA;YACD,OAAO,GAAG,CAAC,MAAM,KAAK,GAAG,CAAA;QAC3B,CAAC;KACF;IACD,aAAa,EAAE,GAAG,EAAE;QAClB,OAAO;YACL,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,OAAO,CAAC,GAAG,CAAC,iCAAiC,EAAE,EAAC;SACrF,CAAA;IACH,CAAC;IACD,OAAO,EAAE;QACP,QAAQ,EAAR,kBAAQ;QACR,gBAAgB,EAAhB,0BAAgB;QAChB,SAAS,EAAT,mBAAS;QACT,WAAW,EAAX,qBAAW;QACX,MAAM,EAAN,gBAAM;QACN,QAAQ,EAAR,kBAAQ;QACR,MAAM,EAAN,gBAAM;KACP;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export interface Payload {
|
|
2
|
-
action_source: string;
|
|
3
|
-
event_time: string;
|
|
4
|
-
user_data: {
|
|
5
|
-
externalId?: string;
|
|
6
|
-
email?: string;
|
|
7
|
-
phone?: string;
|
|
8
|
-
gender?: string;
|
|
9
|
-
dateOfBirth?: string;
|
|
10
|
-
lastName?: string;
|
|
11
|
-
firstName?: string;
|
|
12
|
-
city?: string;
|
|
13
|
-
state?: string;
|
|
14
|
-
zip?: string;
|
|
15
|
-
country?: string;
|
|
16
|
-
client_ip_address?: string;
|
|
17
|
-
client_user_agent?: string;
|
|
18
|
-
fbc?: string;
|
|
19
|
-
fbp?: string;
|
|
20
|
-
subscriptionID?: string;
|
|
21
|
-
leadID?: number;
|
|
22
|
-
fbLoginID?: number;
|
|
23
|
-
};
|
|
24
|
-
content_category?: string;
|
|
25
|
-
content_ids?: string[];
|
|
26
|
-
contents?: {
|
|
27
|
-
id?: string;
|
|
28
|
-
quantity?: number;
|
|
29
|
-
item_price?: number;
|
|
30
|
-
delivery_category?: string;
|
|
31
|
-
}[];
|
|
32
|
-
currency?: string;
|
|
33
|
-
event_id?: string;
|
|
34
|
-
event_source_url?: string;
|
|
35
|
-
num_items?: number;
|
|
36
|
-
value?: number;
|
|
37
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/facebook-conversions-api/initiateCheckout/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const constants_1 = require("../constants");
|
|
5
|
-
const fb_capi_properties_1 = require("../fb-capi-properties");
|
|
6
|
-
const fb_capi_user_data_1 = require("../fb-capi-user-data");
|
|
7
|
-
const action = {
|
|
8
|
-
title: 'Initiate Checkout',
|
|
9
|
-
description: 'Send event when a user enters the checkout flow',
|
|
10
|
-
defaultSubscription: 'type = "track" and event = "Checkout Started"',
|
|
11
|
-
fields: {
|
|
12
|
-
action_source: { ...fb_capi_properties_1.action_source, required: true },
|
|
13
|
-
event_time: { ...fb_capi_properties_1.event_time, required: true },
|
|
14
|
-
user_data: fb_capi_user_data_1.user_data_field,
|
|
15
|
-
content_category: fb_capi_properties_1.content_category,
|
|
16
|
-
content_ids: fb_capi_properties_1.content_ids,
|
|
17
|
-
contents: {
|
|
18
|
-
...fb_capi_properties_1.contents,
|
|
19
|
-
default: {
|
|
20
|
-
'@arrayPath': ["$.properties.products", {
|
|
21
|
-
id: {
|
|
22
|
-
'@path': '$.product_id'
|
|
23
|
-
},
|
|
24
|
-
quantity: {
|
|
25
|
-
'@path': '$.quantity'
|
|
26
|
-
},
|
|
27
|
-
item_price: {
|
|
28
|
-
'@path': '$.price'
|
|
29
|
-
}
|
|
30
|
-
}]
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
currency: fb_capi_properties_1.currency,
|
|
34
|
-
event_id: fb_capi_properties_1.event_id,
|
|
35
|
-
event_source_url: fb_capi_properties_1.event_source_url,
|
|
36
|
-
num_items: fb_capi_properties_1.num_items,
|
|
37
|
-
value: {
|
|
38
|
-
...fb_capi_properties_1.value,
|
|
39
|
-
default: { '@path': '$.properties.revenue' }
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
perform: (request, { payload, settings }) => {
|
|
43
|
-
if (payload.currency && !constants_1.CURRENCY_ISO_CODES.has(payload.currency)) {
|
|
44
|
-
throw new actions_core_1.IntegrationError(`${payload.currency} is not a valid currency code.`, 'Misconfigured required field', 400);
|
|
45
|
-
}
|
|
46
|
-
if (!payload.user_data) {
|
|
47
|
-
throw new actions_core_1.IntegrationError('Must include at least one user data property', 'Misconfigured required field', 400);
|
|
48
|
-
}
|
|
49
|
-
if (payload.action_source === 'website' && payload.user_data.client_user_agent === undefined) {
|
|
50
|
-
throw new actions_core_1.IntegrationError('If action source is "Website" then client_user_agent must be defined', 'Misconfigured required field', 400);
|
|
51
|
-
}
|
|
52
|
-
const valid_delivery_categories = ['in_store', 'curbside', 'home_delivery'];
|
|
53
|
-
if (payload.contents) {
|
|
54
|
-
payload.contents.forEach((obj, index) => {
|
|
55
|
-
if (!obj.id) {
|
|
56
|
-
throw new actions_core_1.IntegrationError("Contents objects must include an 'id' parameter.", 'Misconfigured required field', 400);
|
|
57
|
-
}
|
|
58
|
-
if (obj.delivery_category && !valid_delivery_categories.includes(obj.delivery_category)) {
|
|
59
|
-
throw new actions_core_1.IntegrationError(`contents[${index}].delivery_category must be one of {in_store, home_delivery, curbside}.`, 'Misconfigured field', 400);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
return request(`https://graph.facebook.com/v${constants_1.API_VERSION}/${settings.pixelId}/events`, {
|
|
64
|
-
method: 'POST',
|
|
65
|
-
json: {
|
|
66
|
-
data: [
|
|
67
|
-
{
|
|
68
|
-
event_name: 'InitiateCheckout',
|
|
69
|
-
event_time: payload.event_time,
|
|
70
|
-
action_source: payload.action_source,
|
|
71
|
-
event_source_url: payload.event_source_url,
|
|
72
|
-
event_id: payload.event_id,
|
|
73
|
-
user_data: fb_capi_user_data_1.hash_user_data({ user_data: payload.user_data }),
|
|
74
|
-
custom_data: {
|
|
75
|
-
currency: payload.currency,
|
|
76
|
-
value: payload.value,
|
|
77
|
-
content_ids: payload.content_ids,
|
|
78
|
-
contents: payload.contents,
|
|
79
|
-
num_items: payload.num_items,
|
|
80
|
-
content_category: payload.content_category
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
]
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
exports.default = action;
|
|
89
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/facebook-conversions-api/initiateCheckout/index.ts"],"names":[],"mappings":";;AAAA,wDAA0E;AAG1E,4CAA8D;AAC9D,8DAAkK;AAClK,4DAAsE;AAEtE,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EAAE,iDAAiD;IAC9D,mBAAmB,EAAE,+CAA+C;IACpE,MAAM,EAAE;QACN,aAAa,EAAE,EAAE,GAAG,kCAAa,EAAE,QAAQ,EAAE,IAAI,EAAE;QACnD,UAAU,EAAE,EAAE,GAAG,+BAAU,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC7C,SAAS,EAAE,mCAAe;QAC1B,gBAAgB,EAAE,qCAAgB;QAClC,WAAW,EAAE,gCAAW;QACxB,QAAQ,EAAE;YACR,GAAG,6BAAQ;YACX,OAAO,EAAE;gBACP,YAAY,EAAE,CAAC,uBAAuB,EAAE;wBACtC,EAAE,EAAE;4BACF,OAAO,EAAE,cAAc;yBACxB;wBACD,QAAQ,EAAE;4BACR,OAAO,EAAE,YAAY;yBACtB;wBACD,UAAU,EAAE;4BACV,OAAO,EAAE,SAAS;yBACnB;qBACF,CAAC;aACH;SACF;QACD,QAAQ,EAAE,6BAAQ;QAClB,QAAQ,EAAE,6BAAQ;QAClB,gBAAgB,EAAE,qCAAgB;QAClC,SAAS,EAAE,8BAAS;QACpB,KAAK,EAAE;YACL,GAAG,0BAAK;YACR,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C,+BAA+B,uBAAW,IAAI,QAAQ,CAAC,OAAO,SAAS,EAAE;YACtF,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,IAAI,EAAE;oBACJ;wBACE,UAAU,EAAE,kBAAkB;wBAC9B,UAAU,EAAE,OAAO,CAAC,UAAU;wBAC9B,aAAa,EAAE,OAAO,CAAC,aAAa;wBACpC,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;wBAC1C,QAAQ,EAAE,OAAO,CAAC,QAAQ;wBAC1B,SAAS,EAAE,kCAAc,CAAC,EAAC,SAAS,EAAE,OAAO,CAAC,SAAS,EAAC,CAAC;wBACzD,WAAW,EAAE;4BACX,QAAQ,EAAE,OAAO,CAAC,QAAQ;4BAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;4BACpB,WAAW,EAAE,OAAO,CAAC,WAAW;4BAChC,QAAQ,EAAE,OAAO,CAAC,QAAQ;4BAC1B,SAAS,EAAE,OAAO,CAAC,SAAS;4BAC5B,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;yBAC3C;qBACF;iBACF;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export interface Payload {
|
|
2
|
-
action_source: string;
|
|
3
|
-
event_time: string;
|
|
4
|
-
user_data: {
|
|
5
|
-
externalId?: string;
|
|
6
|
-
email?: string;
|
|
7
|
-
phone?: string;
|
|
8
|
-
gender?: string;
|
|
9
|
-
dateOfBirth?: string;
|
|
10
|
-
lastName?: string;
|
|
11
|
-
firstName?: string;
|
|
12
|
-
city?: string;
|
|
13
|
-
state?: string;
|
|
14
|
-
zip?: string;
|
|
15
|
-
country?: string;
|
|
16
|
-
client_ip_address?: string;
|
|
17
|
-
client_user_agent?: string;
|
|
18
|
-
fbc?: string;
|
|
19
|
-
fbp?: string;
|
|
20
|
-
subscriptionID?: string;
|
|
21
|
-
leadID?: number;
|
|
22
|
-
fbLoginID?: number;
|
|
23
|
-
};
|
|
24
|
-
event_id?: string;
|
|
25
|
-
event_source_url?: string;
|
|
26
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/facebook-conversions-api/pageView/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
4
|
-
const fb_capi_properties_1 = require("../fb-capi-properties");
|
|
5
|
-
const fb_capi_user_data_1 = require("../fb-capi-user-data");
|
|
6
|
-
const constants_1 = require("../constants");
|
|
7
|
-
const action = {
|
|
8
|
-
title: 'Page View',
|
|
9
|
-
description: 'Send a page view event when a user lands on a page',
|
|
10
|
-
defaultSubscription: 'type = "page"',
|
|
11
|
-
fields: {
|
|
12
|
-
action_source: { ...fb_capi_properties_1.action_source, required: true },
|
|
13
|
-
event_time: { ...fb_capi_properties_1.event_time, required: true },
|
|
14
|
-
user_data: fb_capi_user_data_1.user_data_field,
|
|
15
|
-
event_id: fb_capi_properties_1.event_id,
|
|
16
|
-
event_source_url: fb_capi_properties_1.event_source_url
|
|
17
|
-
},
|
|
18
|
-
perform: (request, { payload, settings }) => {
|
|
19
|
-
if (!payload.user_data) {
|
|
20
|
-
throw new actions_core_1.IntegrationError('Must include at least one user data property', 'Misconfigured required field', 400);
|
|
21
|
-
}
|
|
22
|
-
if (payload.action_source === 'website' && payload.user_data.client_user_agent === undefined) {
|
|
23
|
-
throw new actions_core_1.IntegrationError('If action source is "Website" then client_user_agent must be defined', 'Misconfigured required field', 400);
|
|
24
|
-
}
|
|
25
|
-
return request(`https://graph.facebook.com/v${constants_1.API_VERSION}/${settings.pixelId}/events`, {
|
|
26
|
-
method: 'POST',
|
|
27
|
-
json: {
|
|
28
|
-
data: [
|
|
29
|
-
{
|
|
30
|
-
event_name: 'PageView',
|
|
31
|
-
event_time: payload.event_time,
|
|
32
|
-
action_source: payload.action_source,
|
|
33
|
-
event_source_url: payload.event_source_url,
|
|
34
|
-
event_id: payload.event_id,
|
|
35
|
-
user_data: fb_capi_user_data_1.hash_user_data({ user_data: payload.user_data })
|
|
36
|
-
}
|
|
37
|
-
]
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
exports.default = action;
|
|
43
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/facebook-conversions-api/pageView/index.ts"],"names":[],"mappings":";;AAAA,wDAA2E;AAC3E,8DAA6F;AAC7F,4DAAsE;AAGtE,4CAA0C;AAC1C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,WAAW;IAClB,WAAW,EAAE,oDAAoD;IACjE,mBAAmB,EAAE,eAAe;IACpC,MAAM,EAAE;QACN,aAAa,EAAE,EAAE,GAAG,kCAAa,EAAE,QAAQ,EAAE,IAAI,EAAE;QACnD,UAAU,EAAE,EAAE,GAAG,+BAAU,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC7C,SAAS,EAAE,mCAAe;QAC1B,QAAQ,EAAE,6BAAQ;QAClB,gBAAgB,EAAE,qCAAgB;KACnC;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE;QAC1C,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE;YACtB,MAAM,IAAI,+BAAgB,CAAC,8CAA8C,EAAE,8BAA8B,EAAE,GAAG,CAAC,CAAA;SAChH;QAED,IAAI,OAAO,CAAC,aAAa,KAAK,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC,iBAAiB,KAAK,SAAS,EAAE;YAC5F,MAAM,IAAI,+BAAgB,CACxB,sEAAsE,EACtE,8BAA8B,EAC9B,GAAG,CACJ,CAAA;SACF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